# HG changeset patch # User Matt Mackall # Date 1164947928 21600 # Node ID ad3d5b4367cb0cfc3c1b19a279db568e9846be02 # Parent 205f0fd4a4a173809dbf3a3e134ecf4d49e6f46c make manifest friendlier switch to using context code ..which uses first parent by default show file hashes only with debug switch show permissions with verbose fix up tests diff -r 205f0fd4a4a1 -r ad3d5b4367cb mercurial/commands.py --- a/mercurial/commands.py Thu Nov 30 19:50:28 2006 -0600 +++ b/mercurial/commands.py Thu Nov 30 22:38:48 2006 -0600 @@ -1513,25 +1513,22 @@ Print a list of version controlled files for the given revision. The manifest is the list of files being version controlled. If no revision - is given then the tip is used. + is given then the first parent of the working directory is used. + + With -v flag, print file permissions. With --debug flag, print + file revision hashes. """ - if rev: - try: - # assume all revision numbers are for changesets - n = repo.lookup(rev) - change = repo.changelog.read(n) - n = change[0] - except hg.RepoError: - n = repo.manifest.lookup(rev) - else: - n = repo.manifest.tip() - m = repo.manifest.read(n) + + m = repo.changectx(rev).manifest() files = m.keys() files.sort() for f in files: - ui.write("%40s %3s %s\n" % (hex(m[f]), - m.execf(f) and "755" or "644", f)) + if ui.debugflag: + ui.write("%40s " % hex(m[f])) + if ui.verbose: + ui.write("%3s " % (m.execf(f) and "755" or "644")) + ui.write("%s\n" % f) def merge(ui, repo, node=None, force=None, branch=None): """Merge working directory with another revision diff -r 205f0fd4a4a1 -r ad3d5b4367cb tests/test-basic --- a/tests/test-basic Thu Nov 30 19:50:28 2006 -0600 +++ b/tests/test-basic Thu Nov 30 22:38:48 2006 -0600 @@ -7,6 +7,6 @@ hg add a hg commit -m test -d "1000000 0" hg history -hg manifest +hg manifest --debug hg cat a hg verify diff -r 205f0fd4a4a1 -r ad3d5b4367cb tests/test-empty-file --- a/tests/test-empty-file Thu Nov 30 19:50:28 2006 -0600 +++ b/tests/test-empty-file Thu Nov 30 22:38:48 2006 -0600 @@ -22,4 +22,4 @@ # empty file that came from rev 1. hg status hg commit -m merge -d '1000000 0' -hg manifest tip +hg manifest --debug tip diff -r 205f0fd4a4a1 -r ad3d5b4367cb tests/test-excessive-merge --- a/tests/test-excessive-merge Thu Nov 30 19:50:28 2006 -0600 +++ b/tests/test-excessive-merge Thu Nov 30 22:38:48 2006 -0600 @@ -31,13 +31,13 @@ echo echo 1 -hg manifest 1 +hg manifest --debug 1 echo 2 -hg manifest 2 +hg manifest --debug 2 echo 3 -hg manifest 3 +hg manifest --debug 3 echo 4 -hg manifest 4 +hg manifest --debug 4 echo diff -r 205f0fd4a4a1 -r ad3d5b4367cb tests/test-filebranch --- a/tests/test-filebranch Thu Nov 30 19:50:28 2006 -0600 +++ b/tests/test-filebranch Thu Nov 30 22:38:48 2006 -0600 @@ -71,7 +71,7 @@ hg debugindex .hg/data/quux.i echo "manifest entries should match tips of all files" -hg manifest +hg manifest --debug echo "everything should be clean now" hg status diff -r 205f0fd4a4a1 -r ad3d5b4367cb tests/test-git-import --- a/tests/test-git-import Thu Nov 30 19:50:28 2006 -0600 +++ b/tests/test-git-import Thu Nov 30 22:38:48 2006 -0600 @@ -161,7 +161,7 @@ rename to foo2 EOF cat foo2 -hg manifest | grep binary +hg manifest --debug | grep binary echo % many binary files hg import -m multibinary - < b hg add b hg commit -m1 -d "1000000 0" -hg manifest 1 +hg manifest --debug 1 echo this is c1 > c hg rawcommit -p 1 -d "1000000 0" -m2 c -hg manifest 2 +hg manifest --debug 2 hg -v parents rm b hg rawcommit -p 2 -d "1000000 0" -m3 b -hg manifest 3 +hg manifest --debug 3 hg -v parents echo this is a22 > a hg rawcommit -p 3 -d "1000000 0" -m4 a -hg manifest 4 +hg manifest --debug 4 hg -v parents echo this is c22 > c hg rawcommit -p 1 -d "1000000 0" -m5 c -hg manifest 5 +hg manifest --debug 5 hg -v parents # merge, but no files changed hg rawcommit -p 4 -p 5 -d "1000000 0" -m6 -hg manifest 6 +hg manifest --debug 6 hg -v parents # no changes what-so-ever hg rawcommit -p 6 -d "1000000 0" -m7 -hg manifest 7 +hg manifest --debug 7 hg -v parents diff -r 205f0fd4a4a1 -r ad3d5b4367cb tests/test-simple-update --- a/tests/test-simple-update Thu Nov 30 19:50:28 2006 -0600 +++ b/tests/test-simple-update Thu Nov 30 22:38:48 2006 -0600 @@ -21,4 +21,4 @@ hg verify hg co cat foo -hg manifest +hg manifest --debug