Details
Details
- Reviewers
indygreg dlax pulkit - Group Reviewers
hg-reviewers - Commits
- rHG5b90a050082b: scmutil: add assertions to help pytype
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
indygreg | |
dlax | |
pulkit |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/scmutil.py (2 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
0ca11fb0d4b1 | 126e5506403f | Matt Harbison | Nov 19 2019, 2:13 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | mharbison72 | ||
Closed | mharbison72 | ||
Closed | mharbison72 | ||
Closed | mharbison72 |
# unfiltered object and restore the filtering when retrieving the | # unfiltered object and restore the filtering when retrieving the | ||||
# repository through the weakref. | # repository through the weakref. | ||||
filtername = repo.filtername | filtername = repo.filtername | ||||
reporef = weakref.ref(repo.unfiltered()) | reporef = weakref.ref(repo.unfiltered()) | ||||
def wrapped(tr): | def wrapped(tr): | ||||
repo = reporef() | repo = reporef() | ||||
if filtername: | if filtername: | ||||
assert repo is not None # help pytype | |||||
repo = repo.filtered(filtername) | repo = repo.filtered(filtername) | ||||
func(repo, tr) | func(repo, tr) | ||||
newcat = b'%02i-txnreport' % len(categories) | newcat = b'%02i-txnreport' % len(categories) | ||||
otr.addpostclose(newcat, wrapped) | otr.addpostclose(newcat, wrapped) | ||||
categories.append(newcat) | categories.append(newcat) | ||||
return wrapped | return wrapped | ||||
@reportsummary | @reportsummary | ||||
def reportchangegroup(repo, tr): | def reportchangegroup(repo, tr): | ||||
cgchangesets = tr.changes.get(b'changegroup-count-changesets', 0) | cgchangesets = tr.changes.get(b'changegroup-count-changesets', 0) | ||||
cgrevisions = tr.changes.get(b'changegroup-count-revisions', 0) | cgrevisions = tr.changes.get(b'changegroup-count-revisions', 0) | ||||
cgfiles = tr.changes.get(b'changegroup-count-files', 0) | cgfiles = tr.changes.get(b'changegroup-count-files', 0) | ||||
cgheads = tr.changes.get(b'changegroup-count-heads', 0) | cgheads = tr.changes.get(b'changegroup-count-heads', 0) | ||||
if cgchangesets or cgrevisions or cgfiles: | if cgchangesets or cgrevisions or cgfiles: | ||||
htext = b"" | htext = b"" | ||||
if cgheads: | if cgheads: | ||||
htext = _(b" (%+d heads)") % cgheads | htext = _(b" (%+d heads)") % cgheads | ||||
msg = _(b"added %d changesets with %d changes to %d files%s\n") | msg = _(b"added %d changesets with %d changes to %d files%s\n") | ||||
assert repo is not None # help pytype | |||||
repo.ui.status(msg % (cgchangesets, cgrevisions, cgfiles, htext)) | repo.ui.status(msg % (cgchangesets, cgrevisions, cgfiles, htext)) | ||||
if txmatch(_reportobsoletedsource): | if txmatch(_reportobsoletedsource): | ||||
@reportsummary | @reportsummary | ||||
def reportobsoleted(repo, tr): | def reportobsoleted(repo, tr): | ||||
obsoleted = obsutil.getobsoleted(repo, tr) | obsoleted = obsutil.getobsoleted(repo, tr) | ||||
newmarkers = len(tr.changes.get(b'obsmarkers', ())) | newmarkers = len(tr.changes.get(b'obsmarkers', ())) |