Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG4e573e7e512d: diff: simplify by converting contexts to nodeids a little later
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | mercurial/commands.py (8 lines) |
| Status | Author | Revision | |
|---|---|---|---|
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz |
| stat = opts.get('stat') | stat = opts.get('stat') | ||||
| reverse = opts.get('reverse') | reverse = opts.get('reverse') | ||||
| if revs and change: | if revs and change: | ||||
| msg = _('cannot specify --rev and --change at the same time') | msg = _('cannot specify --rev and --change at the same time') | ||||
| raise error.Abort(msg) | raise error.Abort(msg) | ||||
| elif change: | elif change: | ||||
| repo = scmutil.unhidehashlikerevs(repo, [change], 'nowarn') | repo = scmutil.unhidehashlikerevs(repo, [change], 'nowarn') | ||||
| node2 = scmutil.revsingle(repo, change, None).node() | ctx2 = scmutil.revsingle(repo, change, None) | ||||
| node1 = repo[node2].p1().node() | ctx1 = ctx2.p1() | ||||
| else: | else: | ||||
| repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn') | repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn') | ||||
| ctx1, ctx2 = scmutil.revpair(repo, revs) | ctx1, ctx2 = scmutil.revpair(repo, revs) | ||||
| node1, node2 = ctx1.node(), ctx2.node() | node1, node2 = ctx1.node(), ctx2.node() | ||||
| if reverse: | if reverse: | ||||
| node1, node2 = node2, node1 | node1, node2 = node2, node1 | ||||
| diffopts = patch.diffallopts(ui, opts) | diffopts = patch.diffallopts(ui, opts) | ||||
| m = scmutil.match(repo[node2], pats, opts) | m = scmutil.match(ctx2, pats, opts) | ||||
| ui.pager('diff') | ui.pager('diff') | ||||
| logcmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat, | logcmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat, | ||||
| listsubrepos=opts.get('subrepos'), | listsubrepos=opts.get('subrepos'), | ||||
| root=opts.get('root')) | root=opts.get('root')) | ||||
| @command('^export', | @command('^export', | ||||
| [('o', 'output', '', | [('o', 'output', '', | ||||
| _('print output to file with formatted name'), _('FORMAT')), | _('print output to file with formatted name'), _('FORMAT')), | ||||