Same reasoning as in the previous patch. hg diff time drops from
0.226s to 0.170s.
Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
durin42 |
hg-reviewers |
Same reasoning as in the previous patch. hg diff time drops from
0.226s to 0.170s.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/commands.py (5 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
cc10a832015f | 156441f045ee | Martin von Zweigbergk | Oct 22 2019, 1:10 PM |
Status | Author | Revision | |
---|---|---|---|
Abandoned | martinvonz | ||
Abandoned | martinvonz | ||
Abandoned | martinvonz | ||
Abandoned | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
"""decides if we can optimize by using an unfiltered repo | """decides if we can optimize by using an unfiltered repo | ||||
Extracted to a function so extensions can override it. | Extracted to a function so extensions can override it. | ||||
""" | """ | ||||
use_unfiltered = False | use_unfiltered = False | ||||
if commandname == b'status': | if commandname == b'status': | ||||
if not kwargs.get(b'rev') and not kwargs.get(b'change'): | if not kwargs.get(b'rev') and not kwargs.get(b'change'): | ||||
use_unfiltered = True | use_unfiltered = True | ||||
elif commandname == b'diff': | |||||
if not kwargs.get(b'rev') and not kwargs.get(b'change'): | |||||
use_unfiltered = True | |||||
return repo.unfiltered() if use_unfiltered else repo | return repo.unfiltered() if use_unfiltered else repo | ||||
# Commands start here, listed alphabetically | # Commands start here, listed alphabetically | ||||
@command( | @command( | ||||
""" | """ | ||||
opts = pycompat.byteskwargs(opts) | opts = pycompat.byteskwargs(opts) | ||||
revs = opts.get(b'rev') | revs = opts.get(b'rev') | ||||
change = opts.get(b'change') | change = opts.get(b'change') | ||||
stat = opts.get(b'stat') | stat = opts.get(b'stat') | ||||
reverse = opts.get(b'reverse') | reverse = opts.get(b'reverse') | ||||
repo = _maybeunfilteredrepo(repo, b'diff', pats, opts) | |||||
if revs and change: | if revs and change: | ||||
msg = _(b'cannot specify --rev and --change at the same time') | msg = _(b'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], b'nowarn') | repo = scmutil.unhidehashlikerevs(repo, [change], b'nowarn') | ||||
ctx2 = scmutil.revsingle(repo, change, None) | ctx2 = scmutil.revsingle(repo, change, None) | ||||
ctx1 = ctx2.p1() | ctx1 = ctx2.p1() | ||||
else: | else: |