tests/test-mq-subrepo-svn.t
author Matt Mackall <mpm@selenic.com>
Mon, 06 Feb 2012 15:10:01 -0600
changeset 16073 b254f827b7a6
parent 15346 53f37b24f26a
child 16894 f9b352b65180
permissions -rw-r--r--
subrepo: rewrite handling of subrepo state at commit (issue2403) When the contents of .hgsubstate are stale (either because they've manually been tweaked or partial updates have confused it), we get confused about whether it actually needs committing. So instead, we actively consult the parent's substate and compare it the actual current state when deciding whether it needs committing. Side effect: lots of "committing subrepo" messages that didn't correspond with real commits disappear. This change is fairly invasive for a fairly obscure condition, so it's kept on the default branch.

  $ "$TESTDIR/hghave" svn13 || exit 80

  $ echo "[extensions]" >> $HGRCPATH
  $ echo "mq=" >> $HGRCPATH
  $ echo "[diff]" >> $HGRCPATH
  $ echo "nodates=1" >> $HGRCPATH

fn to create new repository, and cd into it
  $ mkrepo() {
  >     hg init $1
  >     cd $1
  >     hg qinit
  > }


handle svn subrepos safely

  $ svnadmin create svn-repo-2499
  $ curpath=`pwd | tr '\\\\' /`
  $ expr "$svnpath" : "\/" > /dev/null
  > if [ $? -ne 0 ]; then
  >   curpath="/$curpath"
  > fi
  $ svnurl="file://$curpath/svn-repo-2499/project"
  $ mkdir -p svn-project-2499/trunk
  $ svn import -m 'init project' svn-project-2499 "$svnurl"
  Adding         svn-project-2499/trunk
  
  Committed revision 1.

qnew on repo w/svn subrepo
  $ mkrepo repo-2499-svn-subrepo
  $ svn co "$svnurl"/trunk sub
  Checked out revision 1.
  $ echo 'sub = [svn]sub' >> .hgsub
  $ hg add .hgsub
  $ hg status -S -X '**/format'
  A .hgsub
  $ hg qnew -m0 0.diff
  $ cd sub
  $ echo a > a
  $ svn add a
  A         a
  $ svn st
  A*    a (glob)
  $ cd ..
  $ hg status -S        # doesn't show status for svn subrepos (yet)
  $ hg qnew -m1 1.diff
  abort: uncommitted changes in subrepository sub
  [255]