Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 3619:8c4fd0de5de8
Fix up parent display in logging
For changesets with a first parent nullid, but not rev 0, we ought to
display a null parent.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 07 Nov 2006 14:04:15 -0600 |
parents | 8ee579885d23 |
children | 44e75d9fa654 |
comparison
equal
deleted
inserted
replaced
3618:3109f012c305 | 3619:8c4fd0de5de8 |
---|---|
322 | 322 |
323 hexfunc = self.ui.debugflag and hex or short | 323 hexfunc = self.ui.debugflag and hex or short |
324 | 324 |
325 parents = log.parentrevs(rev) | 325 parents = log.parentrevs(rev) |
326 if not self.ui.debugflag: | 326 if not self.ui.debugflag: |
327 parents = [p for p in parents if p != nullrev] | 327 if parents[1] == nullrev: |
328 if len(parents) == 1 and parents[0] == rev-1: | 328 if parents[0] >= rev - 1: |
329 parents = [] | 329 parents = [] |
330 else: | |
331 parents = [parents[0]] | |
330 parents = [(p, hexfunc(log.node(p))) for p in parents] | 332 parents = [(p, hexfunc(log.node(p))) for p in parents] |
331 | |
332 | 333 |
333 self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode))) | 334 self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode))) |
334 | 335 |
335 if branch: | 336 if branch: |
336 self.ui.write(_("branch: %s\n") % branch) | 337 self.ui.write(_("branch: %s\n") % branch) |