Show More
@@ -1195,7 +1195,7 b' class changeset_printer(object):' | |||||
1195 | # i18n: column positioning for "hg log" |
|
1195 | # i18n: column positioning for "hg log" | |
1196 | self.ui.write(_("phase: %s\n") % ctx.phasestr(), |
|
1196 | self.ui.write(_("phase: %s\n") % ctx.phasestr(), | |
1197 | label='log.phase') |
|
1197 | label='log.phase') | |
1198 |
for pctx in self. |
|
1198 | for pctx in scmutil.meaningfulparents(self.repo, ctx): | |
1199 | label = 'log.parent changeset.%s' % pctx.phasestr() |
|
1199 | label = 'log.parent changeset.%s' % pctx.phasestr() | |
1200 | # i18n: column positioning for "hg log" |
|
1200 | # i18n: column positioning for "hg log" | |
1201 | self.ui.write(_("parent: %d:%s\n") |
|
1201 | self.ui.write(_("parent: %d:%s\n") | |
@@ -1279,22 +1279,6 b' class changeset_printer(object):' | |||||
1279 | match=matchfn, stat=False) |
|
1279 | match=matchfn, stat=False) | |
1280 | self.ui.write("\n") |
|
1280 | self.ui.write("\n") | |
1281 |
|
1281 | |||
1282 | def _meaningful_parentrevs(self, ctx): |
|
|||
1283 | """Return list of meaningful (or all if debug) parentrevs for rev. |
|
|||
1284 |
|
||||
1285 | For merges (two non-nullrev revisions) both parents are meaningful. |
|
|||
1286 | Otherwise the first parent revision is considered meaningful if it |
|
|||
1287 | is not the preceding revision. |
|
|||
1288 | """ |
|
|||
1289 | parents = ctx.parents() |
|
|||
1290 | if len(parents) > 1: |
|
|||
1291 | return parents |
|
|||
1292 | if self.ui.debugflag: |
|
|||
1293 | return [parents[0], self.repo['null']] |
|
|||
1294 | if parents[0].rev() >= scmutil.intrev(ctx.rev()) - 1: |
|
|||
1295 | return [] |
|
|||
1296 | return parents |
|
|||
1297 |
|
||||
1298 | class jsonchangeset(changeset_printer): |
|
1282 | class jsonchangeset(changeset_printer): | |
1299 | '''format changeset information.''' |
|
1283 | '''format changeset information.''' | |
1300 |
|
1284 | |||
@@ -1456,7 +1440,7 b' class changeset_templater(changeset_prin' | |||||
1456 | parents = [[('rev', p.rev()), |
|
1440 | parents = [[('rev', p.rev()), | |
1457 | ('node', p.hex()), |
|
1441 | ('node', p.hex()), | |
1458 | ('phase', p.phasestr())] |
|
1442 | ('phase', p.phasestr())] | |
1459 |
for p in self. |
|
1443 | for p in scmutil.meaningfulparents(self.repo, ctx)] | |
1460 | return showlist('parent', parents, **args) |
|
1444 | return showlist('parent', parents, **args) | |
1461 |
|
1445 | |||
1462 | props = props.copy() |
|
1446 | props = props.copy() |
@@ -734,6 +734,22 b' def revrange(repo, revs):' | |||||
734 | m = revset.matchany(repo.ui, allspecs, repo) |
|
734 | m = revset.matchany(repo.ui, allspecs, repo) | |
735 | return m(repo) |
|
735 | return m(repo) | |
736 |
|
736 | |||
|
737 | def meaningfulparents(repo, ctx): | |||
|
738 | """Return list of meaningful (or all if debug) parentrevs for rev. | |||
|
739 | ||||
|
740 | For merges (two non-nullrev revisions) both parents are meaningful. | |||
|
741 | Otherwise the first parent revision is considered meaningful if it | |||
|
742 | is not the preceding revision. | |||
|
743 | """ | |||
|
744 | parents = ctx.parents() | |||
|
745 | if len(parents) > 1: | |||
|
746 | return parents | |||
|
747 | if repo.ui.debugflag: | |||
|
748 | return [parents[0], repo['null']] | |||
|
749 | if parents[0].rev() >= intrev(ctx.rev()) - 1: | |||
|
750 | return [] | |||
|
751 | return parents | |||
|
752 | ||||
737 | def expandpats(pats): |
|
753 | def expandpats(pats): | |
738 | '''Expand bare globs when running on windows. |
|
754 | '''Expand bare globs when running on windows. | |
739 | On posix we assume it already has already been done by sh.''' |
|
755 | On posix we assume it already has already been done by sh.''' |
General Comments 0
You need to be logged in to leave comments.
Login now