##// END OF EJS Templates
convert: add a mode where mercurial_sink skips empty revisions....
convert: add a mode where mercurial_sink skips empty revisions. The getchanges function of some converter_source classes can return some false positives. I.e. they sometimes claim that a file "foo" was changed in some revision, even though its contents are still the same. convert_svn is particularly bad, but I think this can also happen with convert_cvs and, at least in theory, with mercurial_source. For regular conversions this is not really a problem - as long as getfile returns the right contents, we'll get a converted revision with the right contents. But when we use --filemap, this could lead to superfluous revisions being converted. Instead of fixing every converter_source, I decided to change mercurial_sink to work around this problem. When --filemap is used, we're interested only in revisions that touch some specific files. If a revision doesn't change any of these files, then we're not interested in it (at least for revisions with a single parent; merges are special). For mercurial_sink, we abuse this property and rollback a commit if the manifest text hasn't changed. This avoids duplicating the logic from localrepo.filecommit to detect unchanged files.

File last commit:

r4050:75313c36 default
r5378:8a2915f5 default
Show More
test-transplant
98 lines | 1.7 KiB | text/plain | TextLexer
Brendan Cully
Add transplant extension
r3714 #!/bin/sh
cat <<EOF >> $HGRCPATH
[extensions]
transplant=
EOF
hg init t
cd t
echo r1 > r1
hg ci -Amr1 -d'0 0'
echo r2 > r2
hg ci -Amr2 -d'1 0'
hg up 0
echo b1 > b1
hg ci -Amb1 -d '0 0'
echo b2 > b2
hg ci -Amb2 -d '1 0'
echo b3 > b3
hg ci -Amb3 -d '2 0'
hg log --template '{rev} {parents} {desc}\n'
Brendan Cully
Minor test-transplant cleanup
r4034 hg clone . ../rebase
cd ../rebase
Brendan Cully
Add transplant extension
r3714
hg up -C 1
echo '% rebase b onto r1'
hg transplant -a -b tip
hg log --template '{rev} {parents} {desc}\n'
Brendan Cully
Minor test-transplant cleanup
r4034 hg clone ../t ../prune
cd ../prune
Brendan Cully
Add transplant extension
r3714
hg up -C 1
echo '% rebase b onto r1, skipping b2'
hg transplant -a -b tip -p 3
hg log --template '{rev} {parents} {desc}\n'
echo '% remote transplant'
Brendan Cully
Minor test-transplant cleanup
r4034 hg clone -r 1 ../t ../remote
cd ../remote
Brendan Cully
Add transplant extension
r3714 hg transplant --log -s ../t 2 4
hg log --template '{rev} {parents} {desc}\n'
echo '% skip previous transplants'
hg transplant -s ../t -a -b 4
hg log --template '{rev} {parents} {desc}\n'
echo '% skip local changes transplanted to the source'
echo b4 > b4
hg ci -Amb4 -d '3 0'
Brendan Cully
Minor test-transplant cleanup
r4034 hg clone ../t ../pullback
cd ../pullback
Brendan Cully
Add transplant extension
r3714 hg transplant -s ../remote -a -b tip
Brendan Cully
transplant: fix --continue; add --continue test
r3724
Brendan Cully
Make test-transplant test pull case
r4036 echo '% remote transplant with pull'
Brendan Cully
transplant: test non-local source
r4050 hg -R ../t serve -p 20062 -d --pid-file=../t.pid
cat ../t.pid >> $DAEMON_PIDS
Brendan Cully
Make test-transplant test pull case
r4036 hg clone -r 0 ../t ../rp
cd ../rp
Brendan Cully
transplant: test non-local source
r4050 hg transplant -s http://localhost:20062/ 2 4
Brendan Cully
Make test-transplant test pull case
r4036 hg log --template '{rev} {parents} {desc}\n'
Brendan Cully
transplant: fix --continue; add --continue test
r3724 echo '% transplant --continue'
hg init ../tc
cd ../tc
cat <<EOF > foo
foo
bar
baz
EOF
Brendan Cully
transplant: recover added/removed files after failed application
r3726 echo toremove > toremove
Brendan Cully
transplant: fix --continue; add --continue test
r3724 hg ci -Amfoo -d '0 0'
cat <<EOF > foo
foo2
bar2
baz2
EOF
Brendan Cully
transplant: recover added/removed files after failed application
r3726 rm toremove
echo added > added
hg ci -Amfoo2 -d '0 0'
Brendan Cully
transplant: fix --continue; add --continue test
r3724 echo bar > bar
hg ci -Ambar -d '0 0'
echo bar2 >> bar
hg ci -mbar2 -d '0 0'
hg up 0
echo foobar > foo
hg ci -mfoobar -d '0 0'
hg transplant 1:3
Brendan Cully
transplant: log source node when recovering too.
r3758 # transplant -c shouldn't use an old changeset
hg up -C
hg transplant 1
Brendan Cully
transplant: fix --continue; add --continue test
r3724 hg transplant --continue
Brendan Cully
transplant: log source node when recovering too.
r3758 hg transplant 1:3
Brendan Cully
transplant: recover added/removed files after failed application
r3726 hg locate