Mercurial > hg
comparison mercurial/commands.py @ 3576:00427c4b533b
log speedup: don't call revlog.node if we don't have to
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sat, 28 Oct 2006 20:21:59 -0300 |
parents | 0facae7566cc |
children | 3b4e00cba57a |
comparison
equal
deleted
inserted
replaced
3575:0facae7566cc | 3576:00427c4b533b |
---|---|
318 extra = changes[5] | 318 extra = changes[5] |
319 branch = extra.get("branch") | 319 branch = extra.get("branch") |
320 | 320 |
321 hexfunc = self.ui.debugflag and hex or short | 321 hexfunc = self.ui.debugflag and hex or short |
322 | 322 |
323 parents = [(p, hexfunc(log.node(p))) for p in log.parentrevs(rev) | 323 parents = log.parentrevs(rev) |
324 if self.ui.debugflag or p != -1] | 324 if not self.ui.debugflag: |
325 if (not self.ui.debugflag and len(parents) == 1 and | 325 parents = [p for p in parents if p != -1] |
326 parents[0][0] == rev-1): | 326 if len(parents) == 1 and parents[0] == rev-1: |
327 parents = [] | 327 parents = [] |
328 parents = [(p, hexfunc(log.node(p))) for p in parents] | |
329 | |
328 | 330 |
329 self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode))) | 331 self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode))) |
330 | 332 |
331 if branch: | 333 if branch: |
332 self.ui.write(_("branch: %s\n") % branch) | 334 self.ui.write(_("branch: %s\n") % branch) |
1913 mf = getchange(rev)[0] | 1915 mf = getchange(rev)[0] |
1914 for fn in getchange(rev)[3]: | 1916 for fn in getchange(rev)[3]: |
1915 rename = getrenamed(fn, rev, mf) | 1917 rename = getrenamed(fn, rev, mf) |
1916 if rename: | 1918 if rename: |
1917 copies.append((fn, rename[0])) | 1919 copies.append((fn, rename[0])) |
1918 displayer.show(rev, brinfo=br, copies=copies) | 1920 displayer.show(rev, changenode, brinfo=br, copies=copies) |
1919 if opts['patch']: | 1921 if opts['patch']: |
1920 if parents: | 1922 if parents: |
1921 prev = parents[0] | 1923 prev = parents[0] |
1922 else: | 1924 else: |
1923 prev = -1 | 1925 prev = -1 |