Mercurial > hg
view tests/test-convert-svn-branches @ 7177:09ed32b79656
mq: Fix --qrefresh --short to work with --exclude and --include
pmezard expects
hg qref -s -X b
to apply the -X to the list of files in the patch, and thus remove b from the
patch.
That's how it worked before f7fc5f5ecd62. That change seemed sensible, but it
wasn't...
mpm says
(17:22:30) pmezard_: kiilerix1: do you mean that -X should be forbidden with -s ?
(17:22:54) pmezard_: kiilerix1: and --include too
(17:23:03) mpm: No because you should be able to say hg qref -s foo* -X foo-bar
so mpm expects
hg qref -s -X b *
to apply the -X to the list of files in the working directory, and thus don't
include b in the patch
This patch tries to make both usecases work by creating a matchfn which uses
the include/excludes but not the filelist.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sun, 19 Oct 2008 16:31:24 +0200 |
parents | 6ec941b6003d |
children | 90d8dfb481e7 |
line wrap: on
line source
#!/bin/sh "$TESTDIR/hghave" svn svn-bindings || exit 80 fix_path() { tr '\\' / } echo "[extensions]" >> $HGRCPATH echo "convert = " >> $HGRCPATH echo "hgext.graphlog =" >> $HGRCPATH svnadmin create svn-repo svnpath=`pwd | fix_path` # SVN wants all paths to start with a slash. Unfortunately, # Windows ones don't. Handle that. expr $svnpath : "\/" > /dev/null if [ $? -ne 0 ]; then svnpath='/'$svnpath fi echo % initial svn import mkdir projA cd projA mkdir trunk mkdir branches mkdir tags cd .. svnurl=file://$svnpath/svn-repo/projA svn import -m "init projA" projA $svnurl | fix_path echo % update svn repository svn co $svnurl A | fix_path cd A echo a > trunk/a echo b > trunk/b echo c > trunk/c # Add a file within branches, used to confuse branch detection echo d > branches/notinbranch svn add trunk/a trunk/b trunk/c branches/notinbranch svn ci -m hello echo % branch to old svn copy trunk branches/old svn rm branches/old/c svn ci -m "branch trunk, remove c" svn up echo % update trunk "$TESTDIR/svn-safe-append.py" a trunk/a svn ci -m "change a" echo % update old branch "$TESTDIR/svn-safe-append.py" b branches/old/b svn ci -m "change b" echo % create a cross-branch revision svn move trunk/b branches/old/c "$TESTDIR/svn-safe-append.py" c branches/old/c svn ci -m "move and update c" echo % update old branch again "$TESTDIR/svn-safe-append.py" b branches/old/b svn ci -m "change b again" echo % move back and forth between branch of similar names # This used to generate fake copy records svn up svn move branches/old branches/old2 svn ci -m "move to old2" svn move branches/old2 branches/old svn ci -m "move back to old" echo % update trunk again "$TESTDIR/svn-safe-append.py" a trunk/a svn ci -m "last change to a" cd .. echo % convert trunk and branches hg convert --datesort $svnurl A-hg echo % branch again from a converted revision cd A svn copy -r 1 $svnurl/trunk branches/old3 svn ci -m "branch trunk@1 into old3" cd .. echo % convert again hg convert --datesort $svnurl A-hg cd A-hg hg glog --template 'branch=#branches# #rev# #desc|firstline# files: #files#\n' hg branches | sed 's/:.*/:/' hg tags -q cd ..