Mercurial > hg
changeset 3319:80654c248793
merge with crew
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Mon, 09 Oct 2006 15:52:37 +0200 |
parents | a225055b3b59 (diff) 399c04369a1b (current diff) |
children | fa59d6763441 |
files | mercurial/commands.py |
diffstat | 3 files changed, 64 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Sun Oct 08 20:27:23 2006 -0300 +++ b/mercurial/commands.py Mon Oct 09 15:52:37 2006 +0200 @@ -789,16 +789,25 @@ if dest: raise util.Abort(_("--base is incompatible with specifiying " "a destination")) + base = [repo.lookup(rev) for rev in base] + # create the right base + # XXX: nodesbetween / changegroup* should be "fixed" instead o = [] + has_set = sets.Set(base) for n in base: - o.extend(repo.changelog.children(repo.lookup(n))) - # add common ancestor + has_set.update(repo.changelog.reachable(n)) if revs: - all = o + revs + visit = list(revs) else: - all = o + repo.changelog.heads() - ancestor = reduce(lambda a, b: repo.changelog.ancestor(a, b), all) - o.append(ancestor) + visit = repo.changelog.heads() + while visit: + n = visit.pop(0) + parents = [p for p in repo.changelog.parents(n) + if p != nullid and p not in has_set] + if len(parents) == 0: + o.insert(0, n) + else: + visit.extend(parents) else: setremoteconfig(ui, opts) dest = ui.expandpath(dest or 'default-push', dest or 'default')
--- a/tests/test-bundle-r Sun Oct 08 20:27:23 2006 -0300 +++ b/tests/test-bundle-r Mon Oct 09 15:52:37 2006 +0200 @@ -72,7 +72,8 @@ hg -R test bundle --base 2 -r 7 test-bundle-branch2.hg hg -R test bundle --base 2 test-bundle-all.hg hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg -cd test-2 +hg clone test-2 test-9 +cd test-9 echo % 2 hg tip -q hg unbundle ../test-bundle-should-fail.hg @@ -81,13 +82,28 @@ hg unbundle ../test-bundle-all.hg echo % 8 hg tip -q +hg verify hg rollback echo % 2 hg tip -q hg unbundle ../test-bundle-branch1.hg echo % 4 hg tip -q +hg verify +hg rollback hg unbundle ../test-bundle-branch2.hg -echo % 8 +echo % 6 hg tip -q hg verify + +cd ../test +hg merge 7 +hg ci -m merge -d "1000000 0" +cd .. +hg -R test bundle --base 2 test-bundle-head.hg +hg clone test-2 test-10 +cd test-10 +hg unbundle ../test-bundle-head.hg +echo % 9 +hg tip -q +hg verify
--- a/tests/test-bundle-r.out Sun Oct 08 20:27:23 2006 -0300 +++ b/tests/test-bundle-r.out Mon Oct 09 15:52:37 2006 +0200 @@ -148,6 +148,7 @@ % should fail abort: --base is incompatible with specifiying a destination abort: repository default-push not found! +1 files updated, 0 files merged, 0 files removed, 0 files unresolved % 2 2:d62976ca1e50 adding changesets @@ -163,6 +164,11 @@ (run 'hg heads' to see heads, 'hg merge' to merge) % 8 8:836ac62537ab +checking changesets +checking manifests +crosschecking files in changesets and manifests +checking files +4 files, 9 changesets, 7 total revisions rolling back last transaction % 2 2:d62976ca1e50 @@ -173,15 +179,36 @@ (run 'hg update' to get a working copy) % 4 4:836ac62537ab +checking changesets +checking manifests +crosschecking files in changesets and manifests +checking files +2 files, 5 changesets, 5 total revisions +rolling back last transaction adding changesets adding manifests adding file changes -added 4 changesets with 2 changes to 3 files (+1 heads) +added 4 changesets with 3 changes to 3 files (+1 heads) (run 'hg heads' to see heads, 'hg merge' to merge) -% 8 -8:80fe151401c2 +% 6 +6:80fe151401c2 checking changesets checking manifests crosschecking files in changesets and manifests checking files -4 files, 9 changesets, 7 total revisions +3 files, 7 changesets, 6 total revisions +2 files updated, 0 files merged, 0 files removed, 0 files unresolved +(branch merge, don't forget to commit) +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +adding changesets +adding manifests +adding file changes +added 7 changesets with 4 changes to 4 files +(run 'hg update' to get a working copy) +% 9 +9:607fe5912aad +checking changesets +checking manifests +crosschecking files in changesets and manifests +checking files +4 files, 10 changesets, 7 total revisions