Mercurial > hg-stable
changeset 3323:b7a46cbf3f59
merge with upstream
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Tue, 10 Oct 2006 09:30:05 +0200 |
parents | a1aad25ccc3e (diff) b16456909a0a (current diff) |
children | 34f08b8883cf |
files | mercurial/localrepo.py tests/test-flags.out |
diffstat | 8 files changed, 326 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Tue Oct 10 02:15:20 2006 -0500 +++ b/mercurial/commands.py Tue Oct 10 09:30:05 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') @@ -3137,7 +3146,7 @@ found = a break if found is not None: - if aliases[0].startswith("debug"): + if aliases[0].startswith("debug") or found.startswith("debug"): debugchoice[found] = (aliases, table[e]) else: choice[found] = (aliases, table[e])
--- a/mercurial/localrepo.py Tue Oct 10 02:15:20 2006 -0500 +++ b/mercurial/localrepo.py Tue Oct 10 09:30:05 2006 +0200 @@ -681,7 +681,7 @@ def mfmatches(node): change = self.changelog.read(node) - mf = dict(self.manifest.read(change[0])) + mf = self.manifest.read(change[0]).copy() for fn in mf.keys(): if not match(fn): del mf[fn] @@ -726,9 +726,11 @@ else: # we are comparing working dir against non-parent # generate a pseudo-manifest for the working dir + # XXX: create it in dirstate.py ? mf2 = mfmatches(self.dirstate.parents()[0]) for f in lookup + modified + added: mf2[f] = "" + mf2.set(f, execf=util.is_exec(self.wjoin(f), mf2.execf(f))) for f in removed: if f in mf2: del mf2[f] @@ -746,7 +748,8 @@ mf2keys.sort() for fn in mf2keys: if mf1.has_key(fn): - if mf1[fn] != mf2[fn] and (mf2[fn] != "" or fcmp(fn, mf1)): + if mf1.flags(fn) != mf2.flags(fn) or \ + (mf1[fn] != mf2[fn] and (mf2[fn] != "" or fcmp(fn, mf1))): modified.append(fn) elif list_clean: clean.append(fn)
--- a/tests/test-bundle-r Tue Oct 10 02:15:20 2006 -0500 +++ b/tests/test-bundle-r Tue Oct 10 09:30:05 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 Tue Oct 10 02:15:20 2006 -0500 +++ b/tests/test-bundle-r.out Tue Oct 10 09:30:05 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-debugcomplete Tue Oct 10 09:30:05 2006 +0200 @@ -0,0 +1,39 @@ +#!/bin/sh + +echo '% Show all commands except debug commands' +hg debugcomplete + +echo +echo '% Show all commands that start with "a"' +hg debugcomplete a + +echo +echo '% Do not show debug commands if there are other candidates' +hg debugcomplete d + +echo +echo '% Show debug commands if there are no other candidates' +hg debugcomplete debug + +echo +echo '% Do not show the alias of a debug command if there are other candidates' +echo '% (this should hide rawcommit)' +hg debugcomplete r + +echo +echo '% Show the alias of a debug command if there are no other candidates' +hg debugcomplete rawc + +echo +echo '% Show the global options' +hg debugcomplete --options | sort + +echo +echo '% Show the options for the "serve" command' +hg debugcomplete --options serve | sort + +echo +echo '% Show an error if we use --options with an ambiguous abbreviation' +hg debugcomplete --options s + +exit 0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-debugcomplete.out Tue Oct 10 09:30:05 2006 +0200 @@ -0,0 +1,150 @@ +% Show all commands except debug commands +add +addremove +annotate +archive +backout +bundle +cat +clone +commit +copy +diff +export +grep +heads +help +identify +import +incoming +init +locate +log +manifest +merge +outgoing +parents +paths +pull +push +recover +remove +rename +revert +rollback +root +serve +showconfig +status +tag +tags +tip +unbundle +update +verify +version + +% Show all commands that start with "a" +add +addremove +annotate +archive + +% Do not show debug commands if there are other candidates +diff + +% Show debug commands if there are no other candidates +debugancestor +debugcheckstate +debugcomplete +debugconfig +debugdata +debugforget +debugindex +debugindexdot +debugrawcommit +debugrebuildstate +debugrename +debugsetparents +debugstate +debugundo +debugwalk + +% Do not show the alias of a debug command if there are other candidates +% (this should hide rawcommit) +recover +remove +rename +revert +rollback +root + +% Show the alias of a debug command if there are no other candidates +rawcommit + +% Show the global options +--config +--cwd +--debug +--debugger +--help +--lsprof +--noninteractive +--profile +--quiet +--repository +--time +--traceback +--verbose +--version +-R +-h +-q +-v +-y + +% Show the options for the "serve" command +--accesslog +--address +--config +--cwd +--daemon +--daemon-pipefds +--debug +--debugger +--errorlog +--help +--ipv6 +--lsprof +--name +--noninteractive +--pid-file +--port +--profile +--quiet +--repository +--stdio +--style +--templates +--time +--traceback +--verbose +--version +--webdir-conf +-6 +-A +-E +-R +-a +-d +-h +-n +-p +-q +-t +-v +-y + +% Show an error if we use --options with an ambiguous abbreviation +hg: command 's' is ambiguous: + serve showconfig status
--- a/tests/test-flags Tue Oct 10 02:15:20 2006 -0500 +++ b/tests/test-flags Tue Oct 10 09:30:05 2006 +0200 @@ -10,6 +10,7 @@ hg ci -m "added a b" -d "1000000 0" cd .. +hg clone test1 test3 mkdir test2 cd test2 @@ -29,6 +30,19 @@ hg -v merge -ls -l ../test[12]/a > foo +cd ../test3 +echo 123 >>b +hg ci -m "b updated" -d "1000000 0" + +hg pull ../test2 +hg heads +hg history + +hg -v merge + +ls -l ../test[123]/a > foo cut -b 1-10 < foo +hg debugindex .hg/data/a.i +hg debugindex ../test2/.hg/data/a.i +hg debugindex ../test1/.hg/data/a.i
--- a/tests/test-flags.out Tue Oct 10 02:15:20 2006 -0500 +++ b/tests/test-flags.out Tue Oct 10 09:30:05 2006 +0200 @@ -1,3 +1,4 @@ +2 files updated, 0 files merged, 0 files removed, 0 files unresolved pulling from ../test1 requesting all changes adding changesets @@ -46,5 +47,56 @@ merging a 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) +pulling from ../test2 +searching for changes +adding changesets +adding manifests +adding file changes +added 1 changesets with 1 changes to 1 files (+1 heads) +(run 'hg heads' to see heads, 'hg merge' to merge) +changeset: 2:b833d578451e +tag: tip +parent: 0:4536b1c2ca69 +user: test +date: Mon Jan 12 13:46:40 1970 +0000 +summary: chmod +x a + +changeset: 1:d54568174d8e +user: test +date: Mon Jan 12 13:46:40 1970 +0000 +summary: b updated + +changeset: 2:b833d578451e +tag: tip +parent: 0:4536b1c2ca69 +user: test +date: Mon Jan 12 13:46:40 1970 +0000 +summary: chmod +x a + +changeset: 1:d54568174d8e +user: test +date: Mon Jan 12 13:46:40 1970 +0000 +summary: b updated + +changeset: 0:4536b1c2ca69 +user: test +date: Mon Jan 12 13:46:40 1970 +0000 +summary: added a b + +resolving manifests +getting a +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +(branch merge, don't forget to commit) -rwxr-x--- -rwxr-x--- +-rwxr-x--- + rev offset length base linkrev nodeid p1 p2 + 0 0 0 0 0 b80de5d13875 000000000000 000000000000 + 1 0 0 0 2 37c42bd6cc03 b80de5d13875 000000000000 + rev offset length base linkrev nodeid p1 p2 + 0 0 0 0 0 b80de5d13875 000000000000 000000000000 + 1 0 0 0 1 37c42bd6cc03 b80de5d13875 000000000000 + rev offset length base linkrev nodeid p1 p2 + 0 0 0 0 0 b80de5d13875 000000000000 000000000000 + 1 0 5 1 1 7fe919cc0336 b80de5d13875 000000000000 + 2 5 0 2 2 37c42bd6cc03 b80de5d13875 000000000000