Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGa40041caf8af: py3: use '%d' for integers in hgext/infinitepush/__init__.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/infinitepush/__init__.py (10 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Pulkit Goyal | May 19 2018, 8:53 AM |
Status | Author | Revision | |
---|---|---|---|
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit | ||
Closed | pulkit |
def _lookupwrap(orig): | def _lookupwrap(orig): | ||||
def _lookup(repo, proto, key): | def _lookup(repo, proto, key): | ||||
localkey = encoding.tolocal(key) | localkey = encoding.tolocal(key) | ||||
if isinstance(localkey, str) and _scratchbranchmatcher(localkey): | if isinstance(localkey, str) and _scratchbranchmatcher(localkey): | ||||
scratchnode = repo.bundlestore.index.getnode(localkey) | scratchnode = repo.bundlestore.index.getnode(localkey) | ||||
if scratchnode: | if scratchnode: | ||||
return "%s %s\n" % (1, scratchnode) | return "%d %s\n" % (1, scratchnode) | ||||
else: | else: | ||||
return "%s %s\n" % (0, 'scratch branch %s not found' % localkey) | return "%d %s\n" % (0, 'scratch branch %s not found' % localkey) | ||||
else: | else: | ||||
try: | try: | ||||
r = hex(repo.lookup(localkey)) | r = hex(repo.lookup(localkey)) | ||||
return "%s %s\n" % (1, r) | return "%d %s\n" % (1, r) | ||||
except Exception as inst: | except Exception as inst: | ||||
if repo.bundlestore.index.getbundle(localkey): | if repo.bundlestore.index.getbundle(localkey): | ||||
return "%s %s\n" % (1, localkey) | return "%d %s\n" % (1, localkey) | ||||
else: | else: | ||||
r = str(inst) | r = str(inst) | ||||
return "%s %s\n" % (0, r) | return "%d %s\n" % (0, r) | ||||
return _lookup | return _lookup | ||||
def _pull(orig, ui, repo, source="default", **opts): | def _pull(orig, ui, repo, source="default", **opts): | ||||
opts = pycompat.byteskwargs(opts) | opts = pycompat.byteskwargs(opts) | ||||
# Copy paste from `pull` command | # Copy paste from `pull` command | ||||
source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch')) | source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch')) | ||||
scratchbookmarks = {} | scratchbookmarks = {} |