Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | hgext/extdiff.py (8 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
166fe33b1418 | a89016fce811 | Joerg Sonnenberger | Mar 28 2021, 3:54 PM |
Status | Author | Revision | |
---|---|---|---|
Abandoned | joerg.sonnenberger | D10278 extdiff: avoid nullid | |
Closed | joerg.sonnenberger | D10277 fix: merge imports |
import os | import os | ||||
import re | import re | ||||
import shutil | import shutil | ||||
import stat | import stat | ||||
import subprocess | import subprocess | ||||
from mercurial.i18n import _ | from mercurial.i18n import _ | ||||
from mercurial.node import ( | from mercurial.node import ( | ||||
nullid, | nullrev, | ||||
short, | short, | ||||
) | ) | ||||
from mercurial import ( | from mercurial import ( | ||||
archival, | archival, | ||||
cmdutil, | cmdutil, | ||||
encoding, | encoding, | ||||
error, | error, | ||||
filemerge, | filemerge, | ||||
if change: | if change: | ||||
ctx2 = scmutil.revsingle(repo, change, None) | ctx2 = scmutil.revsingle(repo, change, None) | ||||
ctx1a, ctx1b = ctx2.p1(), ctx2.p2() | ctx1a, ctx1b = ctx2.p1(), ctx2.p2() | ||||
elif from_rev or to_rev: | elif from_rev or to_rev: | ||||
repo = scmutil.unhidehashlikerevs( | repo = scmutil.unhidehashlikerevs( | ||||
repo, [from_rev] + [to_rev], b'nowarn' | repo, [from_rev] + [to_rev], b'nowarn' | ||||
) | ) | ||||
ctx1a = scmutil.revsingle(repo, from_rev, None) | ctx1a = scmutil.revsingle(repo, from_rev, None) | ||||
ctx1b = repo[nullid] | ctx1b = repo[nullrev] | ||||
ctx2 = scmutil.revsingle(repo, to_rev, None) | ctx2 = scmutil.revsingle(repo, to_rev, None) | ||||
else: | else: | ||||
ctx1a, ctx2 = scmutil.revpair(repo, revs) | ctx1a, ctx2 = scmutil.revpair(repo, revs) | ||||
if not revs: | if not revs: | ||||
ctx1b = repo[None].p2() | ctx1b = repo[None].p2() | ||||
else: | else: | ||||
ctx1b = repo[nullid] | ctx1b = repo[nullrev] | ||||
# Disable 3-way merge if there is only one parent | # Disable 3-way merge if there is only one parent | ||||
if do3way: | if do3way: | ||||
if ctx1b.node() == nullid: | if ctx1b.rev() == nullrev: | ||||
do3way = False | do3way = False | ||||
matcher = scmutil.match(ctx2, pats, opts) | matcher = scmutil.match(ctx2, pats, opts) | ||||
if opts.get(b'patch'): | if opts.get(b'patch'): | ||||
if opts.get(b'subrepos'): | if opts.get(b'subrepos'): | ||||
raise error.Abort(_(b'--patch cannot be used with --subrepos')) | raise error.Abort(_(b'--patch cannot be used with --subrepos')) | ||||
if opts.get(b'per_file'): | if opts.get(b'per_file'): |