comparison mercurial/commands.py @ 2630:837119f1bf4d

Merge with tonfa
author Matt Mackall <mpm@selenic.com>
date Mon, 17 Jul 2006 11:30:33 -0500
parents de82749d3a71 f84e166eb0de
children 001703ec311d
comparison
equal deleted inserted replaced
2623:d1cbfe9e13cd 2630:837119f1bf4d
126 # No files, no patterns. Display all revs. 126 # No files, no patterns. Display all revs.
127 wanted = dict(zip(revs, revs)) 127 wanted = dict(zip(revs, revs))
128 if not slowpath: 128 if not slowpath:
129 # Only files, no patterns. Check the history of each file. 129 # Only files, no patterns. Check the history of each file.
130 def filerevgen(filelog): 130 def filerevgen(filelog):
131 cl_count = repo.changelog.count()
131 for i, window in increasing_windows(filelog.count()-1, -1): 132 for i, window in increasing_windows(filelog.count()-1, -1):
132 revs = [] 133 revs = []
133 for j in xrange(i - window, i + 1): 134 for j in xrange(i - window, i + 1):
134 revs.append(filelog.linkrev(filelog.node(j))) 135 revs.append(filelog.linkrev(filelog.node(j)))
135 revs.reverse() 136 revs.reverse()
136 for rev in revs: 137 for rev in revs:
137 yield rev 138 # only yield rev for which we have the changelog, it can
139 # happen while doing "hg log" during a pull or commit
140 if rev < cl_count:
141 yield rev
138 142
139 minrev, maxrev = min(revs), max(revs) 143 minrev, maxrev = min(revs), max(revs)
140 for file_ in files: 144 for file_ in files:
141 filelog = repo.file(file_) 145 filelog = repo.file(file_)
142 # A zero count may be a directory or deleted file, so 146 # A zero count may be a directory or deleted file, so
3512 # Commands shouldn't sys.exit directly, but give a return code. 3516 # Commands shouldn't sys.exit directly, but give a return code.
3513 # Just in case catch this and and pass exit code to caller. 3517 # Just in case catch this and and pass exit code to caller.
3514 return inst.code 3518 return inst.code
3515 except: 3519 except:
3516 u.warn(_("** unknown exception encountered, details follow\n")) 3520 u.warn(_("** unknown exception encountered, details follow\n"))
3517 u.warn(_("** report bug details to mercurial@selenic.com\n")) 3521 u.warn(_("** report bug details to "
3522 "http://www.selenic.com/mercurial/bts\n"))
3523 u.warn(_("** or mercurial@selenic.com\n"))
3518 u.warn(_("** Mercurial Distributed SCM (version %s)\n") 3524 u.warn(_("** Mercurial Distributed SCM (version %s)\n")
3519 % version.get_version()) 3525 % version.get_version())
3520 raise 3526 raise
3521 3527
3522 return -1 3528 return -1