Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG5f2dc1b71cf1: py3: use utils.stringutil.forcebytestr to convert error to bytes
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 (2 lines) | |||
M | mercurial/fileset.py (3 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Pulkit Goyal | May 19 2018, 9:18 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 |
else: | else: | ||||
try: | try: | ||||
r = hex(repo.lookup(localkey)) | r = hex(repo.lookup(localkey)) | ||||
return "%d %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 "%d %s\n" % (1, localkey) | return "%d %s\n" % (1, localkey) | ||||
else: | else: | ||||
r = str(inst) | r = stringutil.forcebytestr(inst) | ||||
return "%d %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')) | ||||
@predicate('grep(regex)', callexisting=True) | @predicate('grep(regex)', callexisting=True) | ||||
def grep(mctx, x): | def grep(mctx, x): | ||||
"""File contains the given regular expression. | """File contains the given regular expression. | ||||
""" | """ | ||||
try: | try: | ||||
# i18n: "grep" is a keyword | # i18n: "grep" is a keyword | ||||
r = re.compile(getstring(x, _("grep requires a pattern"))) | r = re.compile(getstring(x, _("grep requires a pattern"))) | ||||
except re.error as e: | except re.error as e: | ||||
raise error.ParseError(_('invalid match pattern: %s') % e) | raise error.ParseError(_('invalid match pattern: %s') % | ||||
stringutil.forcebytestr(e)) | |||||
return [f for f in mctx.existing() if r.search(mctx.ctx[f].data())] | return [f for f in mctx.existing() if r.search(mctx.ctx[f].data())] | ||||
def _sizetomax(s): | def _sizetomax(s): | ||||
try: | try: | ||||
s = s.strip().lower() | s = s.strip().lower() | ||||
for k, v in util._sizeunits: | for k, v in util._sizeunits: | ||||
if s.endswith(k): | if s.endswith(k): | ||||
# max(4k) = 5k - 1, max(4.5k) = 4.6k - 1 | # max(4k) = 5k - 1, max(4.5k) = 4.6k - 1 |