comparison mercurial/commands.py @ 3736:ad3d5b4367cb

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
author Matt Mackall <mpm@selenic.com>
date Thu, 30 Nov 2006 22:38:48 -0600
parents 67f44b825784
children 1861fa38a6a7
comparison
equal deleted inserted replaced
3735:205f0fd4a4a1 3736:ad3d5b4367cb
1511 """output the latest or given revision of the project manifest 1511 """output the latest or given revision of the project manifest
1512 1512
1513 Print a list of version controlled files for the given revision. 1513 Print a list of version controlled files for the given revision.
1514 1514
1515 The manifest is the list of files being version controlled. If no revision 1515 The manifest is the list of files being version controlled. If no revision
1516 is given then the tip is used. 1516 is given then the first parent of the working directory is used.
1517 """ 1517
1518 if rev: 1518 With -v flag, print file permissions. With --debug flag, print
1519 try: 1519 file revision hashes.
1520 # assume all revision numbers are for changesets 1520 """
1521 n = repo.lookup(rev) 1521
1522 change = repo.changelog.read(n) 1522 m = repo.changectx(rev).manifest()
1523 n = change[0]
1524 except hg.RepoError:
1525 n = repo.manifest.lookup(rev)
1526 else:
1527 n = repo.manifest.tip()
1528 m = repo.manifest.read(n)
1529 files = m.keys() 1523 files = m.keys()
1530 files.sort() 1524 files.sort()
1531 1525
1532 for f in files: 1526 for f in files:
1533 ui.write("%40s %3s %s\n" % (hex(m[f]), 1527 if ui.debugflag:
1534 m.execf(f) and "755" or "644", f)) 1528 ui.write("%40s " % hex(m[f]))
1529 if ui.verbose:
1530 ui.write("%3s " % (m.execf(f) and "755" or "644"))
1531 ui.write("%s\n" % f)
1535 1532
1536 def merge(ui, repo, node=None, force=None, branch=None): 1533 def merge(ui, repo, node=None, force=None, branch=None):
1537 """Merge working directory with another revision 1534 """Merge working directory with another revision
1538 1535
1539 Merge the contents of the current working directory and the 1536 Merge the contents of the current working directory and the