Mercurial > hg-stable
view tests/test-convert-darcs @ 10251:a19d2993385d stable
subrepo: fix merging of already merged subrepos (issue1986)
This fixes a bug seen when merging a main repo which contains a subrepo when
both repos have been merged before. Each repo (main and sub) has two
branches, both of which have been merged before.
In a subrepo, if the revision to merge to is an ancestor of the current rev,
then the merge should be a noop.
Test provided by Steve Losh.
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Fri, 15 Jan 2010 21:08:04 +0100 |
parents | b3c13e721593 |
children | bb5ea66789e3 |
line wrap: on
line source
#!/bin/sh "$TESTDIR/hghave" darcs || exit 80 echo "[extensions]" >> $HGRCPATH echo "convert=" >> $HGRCPATH echo 'hgext.graphlog =' >> $HGRCPATH DARCS_EMAIL='test@example.org'; export DARCS_EMAIL HOME=`pwd`/do_not_use_HOME_darcs; export HOME # skip if we can't import elementtree mkdir dummy mkdir dummy/_darcs if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then echo 'skipped: missing feature: elementtree module' exit 80 fi echo % initialize darcs repo mkdir darcs-repo cd darcs-repo darcs init echo a > a darcs record -a -l -m p0 cd .. echo % branch and update darcs get darcs-repo darcs-clone >/dev/null cd darcs-clone echo c >> a echo c > c darcs record -a -l -m p1.1 cd .. echo % update source cd darcs-repo echo b >> a echo b > b darcs record -a -l -m p1.2 echo % merge branch darcs pull -a ../darcs-clone sleep 1 echo e > a echo f > f mkdir dir echo d > dir/d echo d > dir/d2 darcs record -a -l -m p2 echo % test file and directory move darcs mv f ff # Test remove + move darcs remove dir/d2 rm dir/d2 darcs mv dir dir2 darcs record -a -l -m p3 cd .. glog() { hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" } hg convert darcs-repo darcs-repo-hg # The converter does not currently handle patch conflicts very well. # When they occur, it reverts *all* changes and moves forward, # letting the conflict resolving patch fix collisions. # Unfortunately, non-conflicting changes, like the addition of the # "c" file in p1.1 patch are reverted too. # Just to say that manifest not listing "c" here is a bug. glog -R darcs-repo-hg hg up -q -R darcs-repo-hg hg -R darcs-repo-hg manifest --debug