comparison mercurial/commands.py @ 484:934279f3ca53

Pull from TAH -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Pull from TAH manifest hash: 470ea90dd95189a019f4d96016a45db8a297b841 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCvzZzywK+sNU5EO8RAkZhAKCUJKX1vFtkFxV7qFwbuWQj62zcnQCfU687 jxKpBVesIXSOpBO4NbW/RIM= =hSBe -----END PGP SIGNATURE-----
author mpm@selenic.com
date Sun, 26 Jun 2005 15:12:51 -0800
parents 0ab093b473c5 84d5ddf82856
children c5705ab9cebd
comparison
equal deleted inserted replaced
474:b2ae8283d1a6 484:934279f3ca53
170 show_version(ui) 170 show_version(ui)
171 ui.write('\n') 171 ui.write('\n')
172 ui.write('hg commands:\n\n') 172 ui.write('hg commands:\n\n')
173 173
174 h = {} 174 h = {}
175 for c,e in table.items(): 175 for c, e in table.items():
176 f = c 176 f = c.split("|")[0]
177 aliases = None 177 if f.startswith("debug"):
178 if "|" in f: 178 continue
179 l = f.split("|")
180 f, aliases = l[0], l[1:]
181 if f.startswith("debug"): continue
182 d = "" 179 d = ""
183 if e[0].__doc__: 180 if e[0].__doc__:
184 d = e[0].__doc__.splitlines(0)[0].rstrip() 181 d = e[0].__doc__.splitlines(0)[0].rstrip()
185 h[f] = d 182 h[f] = d
186 183
240 node = repo.dirstate.parents()[0] 237 node = repo.dirstate.parents()[0]
241 if ops['revision']: 238 if ops['revision']:
242 node = repo.changelog.lookup(ops['revision']) 239 node = repo.changelog.lookup(ops['revision'])
243 change = repo.changelog.read(node) 240 change = repo.changelog.read(node)
244 mmap = repo.manifest.read(change[0]) 241 mmap = repo.manifest.read(change[0])
245 maxuserlen = 0
246 maxchangelen = 0
247 for f in relpath(repo, (file,) + files): 242 for f in relpath(repo, (file,) + files):
248 lines = repo.file(f).annotate(mmap[f]) 243 lines = repo.file(f).annotate(mmap[f])
249 pieces = [] 244 pieces = []
250 245
251 for o, f in opmap: 246 for o, f in opmap:
341 revs = [] 336 revs = []
342 if opts['rev']: 337 if opts['rev']:
343 revs = map(lambda x: repo.lookup(x), opts['rev']) 338 revs = map(lambda x: repo.lookup(x), opts['rev'])
344 339
345 if len(revs) > 2: 340 if len(revs) > 2:
346 self.ui.warn("too many revisions to diff\n") 341 ui.warn("too many revisions to diff\n")
347 sys.exit(1) 342 sys.exit(1)
348 343
349 if files: 344 if files:
350 files = relpath(repo, files) 345 files = relpath(repo, files)
351 else: 346 else:
432 427
433 f = os.popen("patch -p%d < %s" % (strip, pf)) 428 f = os.popen("patch -p%d < %s" % (strip, pf))
434 files = [] 429 files = []
435 for l in f.read().splitlines(): 430 for l in f.read().splitlines():
436 l.rstrip('\r\n'); 431 l.rstrip('\r\n');
437 if not quiet: 432 ui.status("%s\n" % l)
438 print l
439 if l[:14] == 'patching file ': 433 if l[:14] == 'patching file ':
440 pf = l[14:] 434 pf = l[14:]
441 if pf not in files: 435 if pf not in files:
442 files.append(pf) 436 files.append(pf)
443 patcherr = f.close() 437 patcherr = f.close()
660 654
661 repo.commit([".hgtags"], opts['text'], opts['user'], opts['date']) 655 repo.commit([".hgtags"], opts['text'], opts['user'], opts['date'])
662 656
663 def tags(ui, repo): 657 def tags(ui, repo):
664 """list repository tags""" 658 """list repository tags"""
665 659
666 l = repo.tagslist() 660 l = repo.tagslist()
667 l.reverse() 661 l.reverse()
668 for t,n in l: 662 for t, n in l:
669 try: 663 try:
670 r = repo.changelog.rev(n) 664 r = "%5d:%s" % (repo.changelog.rev(n), hg.hex(n))
671 except KeyError: 665 except KeyError:
672 r = "?" 666 r = " ?:?"
673 print "%-30s %5d:%s" % (t, repo.changelog.rev(n), hg.hex(n)) 667 ui.write("%-30s %s\n" % (t, r))
674 668
675 def tip(ui, repo): 669 def tip(ui, repo):
676 """show the tip revision""" 670 """show the tip revision"""
677 n = repo.changelog.tip() 671 n = repo.changelog.tip()
678 show_changeset(ui, repo, changenode=n) 672 show_changeset(ui, repo, changenode=n)
780 } 774 }
781 775
782 norepo = "init version help debugindex debugindexdot" 776 norepo = "init version help debugindex debugindexdot"
783 777
784 def find(cmd): 778 def find(cmd):
785 i = None
786 for e in table.keys(): 779 for e in table.keys():
787 if re.match("(%s)$" % e, cmd): 780 if re.match("(%s)$" % e, cmd):
788 return table[e] 781 return table[e]
789 782
790 raise UnknownCommand(cmd) 783 raise UnknownCommand(cmd)