D2296: py3: whitelist test-pull-http.t
durin42 created this revision. Herald added a reviewer: pulkit. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY There's a lot of work left to do on network-related stuff, but I at least got one more test passing. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2296 AFFECTED FILES contrib/python3-whitelist CHANGE DETAILS diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -163,6 +163,7 @@ test-parents.t test-permissions.t test-pull-branch.t +test-pull-http.t test-pull-permission.t test-push-checkheads-partial-C1.t test-push-checkheads-partial-C2.t To: durin42, pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2295: py3: get bytes-repr of network errors portably
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This resolves a lot of weird issues in Python 3 around error strings. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2295 AFFECTED FILES mercurial/hgweb/hgweb_mod.py mercurial/hgweb/request.py mercurial/hgweb/webutil.py mercurial/wireproto.py mercurial/wireprotoserver.py CHANGE DETAILS diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py +++ b/mercurial/wireprotoserver.py @@ -339,7 +339,7 @@ # TODO This response body assumes the failed command was # "unbundle." That assumption is not always valid. -req.respond(e, HGTYPE, body='0\n%s\n' % e) +req.respond(e, HGTYPE, body='0\n%s\n' % pycompat.bytestr(e)) return '' diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -879,11 +879,11 @@ # cleanly forward Abort error to the client if not exchange.bundle2requested(opts.get('bundlecaps')): if proto.name == 'http-v1': -return ooberror(str(exc) + '\n') +return ooberror(pycompat.bytestr(exc) + '\n') raise # cannot do better for bundle1 + ssh # bundle2 request expect a bundle2 reply bundler = bundle2.bundle20(repo.ui) -manargs = [('message', str(exc))] +manargs = [('message', pycompat.bytestr(exc))] advargs = [] if exc.hint is not None: advargs.append(('hint', exc.hint)) diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -347,7 +347,7 @@ try: return util.processlinerange(fromline, toline) except error.ParseError as exc: -raise ErrorResponse(HTTP_BAD_REQUEST, str(exc)) +raise ErrorResponse(HTTP_BAD_REQUEST, pycompat.bytestr(exc)) def formatlinerange(fromline, toline): return '%d:%d' % (fromline + 1, toline) diff --git a/mercurial/hgweb/request.py b/mercurial/hgweb/request.py --- a/mercurial/hgweb/request.py +++ b/mercurial/hgweb/request.py @@ -121,7 +121,8 @@ elif isinstance(status, int): status = statusmessage(status) -self.server_write = self._start_response(status, self.headers) +self.server_write = self._start_response( +pycompat.sysstr(status), self.headers) self._start_response = None self.headers = [] if body is not None: diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -443,20 +443,20 @@ except (error.LookupError, error.RepoLookupError) as err: req.respond(HTTP_NOT_FOUND, ctype) -msg = str(err) +msg = pycompat.bytestr(err) if (util.safehasattr(err, 'name') and not isinstance(err, error.ManifestLookupError)): msg = 'revision not found: %s' % err.name return tmpl('error', error=msg) except (error.RepoError, error.RevlogError) as inst: req.respond(HTTP_SERVER_ERROR, ctype) -return tmpl('error', error=str(inst)) +return tmpl('error', error=pycompat.bytestr(inst)) except ErrorResponse as inst: req.respond(inst, ctype) if inst.code == HTTP_NOT_MODIFIED: # Not allowed to return a body on a 304 return [''] -return tmpl('error', error=str(inst)) +return tmpl('error', error=pycompat.bytestr(inst)) def check_perm(self, rctx, req, op): for permhook in permhooks: To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2294: hgweb: open server logs in binary mode
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is consistent with when we're logging to stdout, so we don't have to do something annoyingly complicated in the logging infrastructure. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2294 AFFECTED FILES mercurial/hgweb/server.py CHANGE DETAILS diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py @@ -273,7 +273,7 @@ def openlog(opt, default): if opt and opt != '-': -return open(opt, 'a') +return open(opt, 'ab') return default class MercurialHTTPServer(_mixin, httpservermod.httpserver, object): To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2292: scmutil: bytes-ify IOErrors before wrapping them in abort message
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2292 AFFECTED FILES mercurial/scmutil.py CHANGE DETAILS diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -215,7 +215,7 @@ ui.warn(_("(is your Python install correct?)\n")) except IOError as inst: if util.safehasattr(inst, "code"): -ui.warn(_("abort: %s\n") % inst) +ui.warn(_("abort: %s\n") % pycompat.bytestr(inst)) elif util.safehasattr(inst, "reason"): try: # usually it is in the form (errno, strerror) reason = inst.reason.args[1] To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2290: printenv: port to python3
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2290 AFFECTED FILES tests/printenv.py CHANGE DETAILS diff --git a/tests/printenv.py b/tests/printenv.py --- a/tests/printenv.py +++ b/tests/printenv.py @@ -35,7 +35,7 @@ # variables with empty values may not exist on all platforms, filter # them now for portability sake. -env = [(k, v) for k, v in os.environ.iteritems() +env = [(k, v) for k, v in os.environ.items() if k.startswith("HG_") and v] env.sort() To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2293: tests: add some b prefixes in test-http-bundle1.t
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 1. skip-blame just some b prefixes REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2293 AFFECTED FILES tests/test-http-bundle1.t CHANGE DETAILS diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t --- a/tests/test-http-bundle1.t +++ b/tests/test-http-bundle1.t @@ -68,7 +68,7 @@ $ cat > $TESTTMP/removesupportedformat.py << EOF > from mercurial import localrepo > def extsetup(ui): - > localrepo.localrepository.supportedformats.remove('generaldelta') + > localrepo.localrepository.supportedformats.remove(b'generaldelta') > EOF $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3 @@ -181,7 +181,8 @@ > if not auth: > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) - > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: + > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', + > b'pass']: > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') > def extsetup(): > common.permhooks.insert(0, perform_authentication) To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2291: hgweb: correctly bytes-ify status, not string-ify
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2291 AFFECTED FILES mercurial/hgweb/request.py CHANGE DETAILS diff --git a/mercurial/hgweb/request.py b/mercurial/hgweb/request.py --- a/mercurial/hgweb/request.py +++ b/mercurial/hgweb/request.py @@ -115,7 +115,7 @@ self.headers = [(k, v) for (k, v) in self.headers if k in ('Date', 'ETag', 'Expires', 'Cache-Control', 'Vary')] -status = statusmessage(status.code, str(status)) +status = statusmessage(status.code, pycompat.bytestr(status)) elif status == 200: status = '200 Script output follows' elif isinstance(status, int): To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@36239: 4 new changesets
4 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/564dec70b50c changeset: 36236:564dec70b50c user:Kyle Lippincottdate:Thu Jan 04 16:29:07 2018 -0800 summary: debugcommands: print out the editor that was searched for (post shlexsplit) https://www.mercurial-scm.org/repo/hg/rev/b39f0fdb0338 changeset: 36237:b39f0fdb0338 user:Martin von Zweigbergk date:Fri Feb 16 11:30:18 2018 -0800 summary: tests: actually check that HGDEMANDIMPORT=disable disables demandimport https://www.mercurial-scm.org/repo/hg/rev/f574cc00831a changeset: 36238:f574cc00831a user:Augie Fackler date:Wed Feb 14 21:34:12 2018 -0500 summary: node: make bin() be a wrapper instead of just an alias https://www.mercurial-scm.org/repo/hg/rev/428de1a59f2d changeset: 36239:428de1a59f2d bookmark:@ tag: tip user:Yuya Nishihara date:Sun Jan 07 11:26:16 2018 +0900 summary: cmdutil: narrow scope of KeyError in makefilename() -- Repository URL: https://www.mercurial-scm.org/repo/hg ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 5795] New: Server side evolve crashes with current default branch
https://bz.mercurial-scm.org/show_bug.cgi?id=5795 Bug ID: 5795 Summary: Server side evolve crashes with current default branch Product: Mercurial Version: default branch Hardware: All OS: All Status: UNCONFIRMED Severity: bug Priority: normal Component: evolution Assignee: bugzi...@mercurial-scm.org Reporter: matt_harbi...@yahoo.com CC: mercurial-devel@mercurial-scm.org, pierre-yves.da...@ens-lyon.org With hg 2234fe1af5dd and evolve 152daa6967af, a pull from `hg serve` results in this on the server side: $ ../hg --config extensions.lfs= --config extensions.narrow= -R "C:\Users\Matt\Downloads\bug_5794\bug_5794" serve listening at http://Envy:8000/ (bound to *:8000) 127.0.0.1 - - [16/Feb/2018 23:39:48] "GET /?cmd=capabilities HTTP/1.1" 500 - 127.0.0.1 - - [16/Feb/2018 23:39:48] Exception happened during processing request '/?cmd=capabilities': Traceback (most recent call last): File "c:\Users\Matt\projects\hg\mercurial\hgweb\server.py", line 101, in do_POST self.do_write() File "c:\Users\Matt\projects\hg\mercurial\hgweb\server.py", line 94, in do_write self.do_hgweb() File "c:\Users\Matt\projects\hg\mercurial\hgweb\server.py", line 173, in do_hgweb for chunk in self.server.application(env, self._start_response): File "c:\Users\Matt\projects\hg\mercurial\hgweb\hgweb_mod.py", line 324, in run_wsgi for r in self._runwsgi(req, repo): File "c:\Users\Matt\projects\hg\mercurial\hgweb\hgweb_mod.py", line 374, in _runwsgi return protohandler['dispatch']() File "c:\Users\Matt\projects\hg\mercurial\wireprotoserver.py", line 213, in 'dispatch': lambda: _callhttp(repo, req, proto, cmd), File "c:\Users\Matt\projects\hg\mercurial\wireprotoserver.py", line 269, in _callhttp rsp = wireproto.dispatch(repo, proto, cmd) File "c:\Users\Matt\projects\hg\mercurial\wireproto.py", line 502, in dispatch return func(repo, proto, *args) File "C:/Users/Matt/Projects/hg-evolve/hgext3rd\evolve\obsexchange.py", line 131, in newcap return _obscommon_capabilities(oldcap, repo, proto) File "C:/Users/Matt/Projects/hg-evolve/hgext3rd\evolve\obsexchange.py", line 107, in _obscommon_capabilities caps = orig(repo, proto) File "C:/Users/Matt/Projects/hg-evolve/hgext3rd\evolve\obsdiscovery.py", line 862, in newcap return _obshash_capabilities(oldcap, repo, proto) File "C:/Users/Matt/Projects/hg-evolve/hgext3rd\evolve\obsdiscovery.py", line 843, in _obshash_capabilities caps = caps.split() AttributeError: 'bytesresponse' object has no attribute 'split' -- You are receiving this mail because: You are on the CC list for the bug. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] debuginstall: do not parse editor command in posix way on Windows
# HG changeset patch # User Yuya Nishihara# Date 1518840784 -32400 # Sat Feb 17 13:13:04 2018 +0900 # Node ID b42f9a63030fee00568add7aa5a5ff983fbcd06d # Parent c9f30dcc3f43793088c99c3acef7db12857cc2cc debuginstall: do not parse editor command in posix way on Windows An editor command is executed by a system shell, which is cmd.exe on Windows. diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -1240,7 +1240,7 @@ def debuginstall(ui, **opts): # editor editor = ui.geteditor() editor = util.expandpath(editor) -editorbin = pycompat.shlexsplit(editor)[0] +editorbin = pycompat.shlexsplit(editor, posix=not pycompat.iswindows)[0] fm.write('editor', _("checking commit editor... (%s)\n"), editorbin) cmdpath = util.findexe(editorbin) fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound', diff --git a/tests/test-install.t b/tests/test-install.t --- a/tests/test-install.t +++ b/tests/test-install.t @@ -140,8 +140,10 @@ not found (this is intentionally using b checking "re2" regexp engine \((available|missing)\) (re) checking templates (*mercurial?templates)... (glob) checking default template (*mercurial?templates?map-cmdline.default) (glob) - checking commit editor... (c:foobarbaz.exe) - Can't find editor 'c:foobarbaz.exe' in PATH + checking commit editor... (c:\foo\bar\baz.exe) (windows !) + Can't find editor 'c:\foo\bar\baz.exe' in PATH (windows !) + checking commit editor... (c:foobarbaz.exe) (no-windows !) + Can't find editor 'c:foobarbaz.exe' in PATH (no-windows !) (specify a commit editor in your configuration file) checking username (test) 1 problems detected, please check your install! ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2281: py3: whitelist another eight passing tests
This revision was automatically updated to reflect the committed changes. Closed by commit rHGc9f30dcc3f43: py3: whitelist another eight passing tests (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2281?vs=5791=5793 REVISION DETAIL https://phab.mercurial-scm.org/D2281 AFFECTED FILES contrib/python3-whitelist CHANGE DETAILS diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -18,6 +18,7 @@ test-bundle-vs-outgoing.t test-casecollision.t test-cat.t +test-censor.t test-changelog-exec.t test-check-commit.t test-check-execute.t @@ -91,6 +92,7 @@ test-filebranch.t test-flags.t test-generaldelta.t +test-git-export.t test-glog-topological.t test-gpg.t test-hghave.t @@ -154,6 +156,7 @@ test-newbranch.t test-obshistory.t test-obsmarkers-effectflag.t +test-obsolete-bundle-strip.t test-obsolete-changeset-exchange.t test-obsolete-checkheads.t test-obsolete-distributed.t @@ -194,14 +197,16 @@ test-rebase-inmemory.t test-rebase-issue-noparam-single-rev.t test-rebase-legacy.t +test-rebase-named-branches.t test-rebase-pull.t test-rebase-transaction.t test-record.t test-remove.t test-rename-after-merge.t test-rename-dir-merge.t test-rename-merge1.t test-rename.t +test-repair-strip.t test-revert-flags.t test-revert-unknown.t test-revlog-group-emptyiter.t @@ -220,6 +225,8 @@ test-sparse-requirement.t test-sparse-verbose-json.t test-ssh-clone-r.t +test-ssh-proto.t +test-sshserver.py test-status-terse.t test-strip-cross.t test-strip.t @@ -233,5 +240,6 @@ test-update-issue1456.t test-update-names.t test-update-reverse.t +test-username-newline.t test-win32text.t test-xdg.t To: durin42, pulkit, #hg-reviewers, yuja Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2280: remotenames: port partway to python3 by using collections.MutableMapping
This revision was automatically updated to reflect the committed changes. Closed by commit rHG25a7d2761898: remotenames: port partway to python3 by using collections.MutableMapping (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2280?vs=5785=5792 REVISION DETAIL https://phab.mercurial-scm.org/D2280 AFFECTED FILES hgext/remotenames.py CHANGE DETAILS diff --git a/hgext/remotenames.py b/hgext/remotenames.py --- a/hgext/remotenames.py +++ b/hgext/remotenames.py @@ -22,7 +22,7 @@ from __future__ import absolute_import -import UserDict +import collections from mercurial.i18n import _ @@ -57,7 +57,7 @@ default=True, ) -class lazyremotenamedict(UserDict.DictMixin): +class lazyremotenamedict(collections.MutableMapping): """ Read-only dict-like Class to lazily resolve remotename entries @@ -110,6 +110,18 @@ else: raise KeyError() +def __iter__(self): +return iter(self.potentialentries) + +def __len__(self): +return len(self.potentialentries) + +def __setitem__(self): +raise NotImplementedError + +def __delitem__(self): +raise NotImplementedError + def _fetchandcache(self, key): if key in self.cache: return self.cache[key] To: durin42, #hg-reviewers, yuja Cc: dlax, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2278: bundle: updates the help text for hg bundle (issue5744) [bugzilla]
yuja requested changes to this revision. yuja added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > commands.py:1165 > (or --base null). Otherwise, hg assumes the destination will have > -all the nodes you specify with --base parameters. Otherwise, hg > +all the nodes you specify with --base parameters, where destination is > +the repository you provide through [DEST] option. Otherwise, hg where the destination repository isn't DEST. :) `--base` and `--all` are the options incompatible with DEST. Can you move this to the last sentence? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2278 To: khanchi97, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2281: py3: whitelist another eight passing tests
durin42 updated this revision to Diff 5791. durin42 retitled this revision from "py3: whitelist another six passing tests" to "py3: whitelist another eight passing tests". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2281?vs=5769=5791 REVISION DETAIL https://phab.mercurial-scm.org/D2281 AFFECTED FILES contrib/python3-whitelist CHANGE DETAILS diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -18,6 +18,7 @@ test-bundle-vs-outgoing.t test-casecollision.t test-cat.t +test-censor.t test-changelog-exec.t test-check-commit.t test-check-execute.t @@ -91,6 +92,7 @@ test-filebranch.t test-flags.t test-generaldelta.t +test-git-export.t test-glog-topological.t test-gpg.t test-hghave.t @@ -154,6 +156,7 @@ test-newbranch.t test-obshistory.t test-obsmarkers-effectflag.t +test-obsolete-bundle-strip.t test-obsolete-changeset-exchange.t test-obsolete-checkheads.t test-obsolete-distributed.t @@ -194,14 +197,16 @@ test-rebase-inmemory.t test-rebase-issue-noparam-single-rev.t test-rebase-legacy.t +test-rebase-named-branches.t test-rebase-pull.t test-rebase-transaction.t test-record.t test-remove.t test-rename-after-merge.t test-rename-dir-merge.t test-rename-merge1.t test-rename.t +test-repair-strip.t test-revert-flags.t test-revert-unknown.t test-revlog-group-emptyiter.t @@ -220,6 +225,8 @@ test-sparse-requirement.t test-sparse-verbose-json.t test-ssh-clone-r.t +test-ssh-proto.t +test-sshserver.py test-status-terse.t test-strip-cross.t test-strip.t @@ -233,5 +240,6 @@ test-update-issue1456.t test-update-names.t test-update-reverse.t +test-username-newline.t test-win32text.t test-xdg.t To: durin42, pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@36235: 4 new changesets (1 on stable)
4 new changesets (1 on stable) in mercurial: https://www.mercurial-scm.org/repo/hg/rev/881596e51fca changeset: 36232:881596e51fca user:Anton Shestakovdate:Thu Feb 15 21:05:31 2018 +0800 summary: gitweb: make span.age CSS selector more specific https://www.mercurial-scm.org/repo/hg/rev/7ec5925c971e changeset: 36233:7ec5925c971e user:Anton Shestakov date:Thu Feb 15 21:14:57 2018 +0800 summary: hgweb: show dates recorded in obsolescence markers https://www.mercurial-scm.org/repo/hg/rev/4878f45c changeset: 36234:4878f45c branch: stable parent: 36001:9f454a717c43 user:Jun Wu date:Fri Feb 16 13:25:39 2018 -0800 summary: date: fix parsing months https://www.mercurial-scm.org/repo/hg/rev/d879aab17786 changeset: 36235:d879aab17786 bookmark:@ tag: tip parent: 36233:7ec5925c971e parent: 36234:4878f45c user:Augie Fackler date:Fri Feb 16 17:24:31 2018 -0500 summary: merge with stable -- Repository URL: https://www.mercurial-scm.org/repo/hg ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2287: tests: avoid referring to pvec in demandimport test
This revision was automatically updated to reflect the committed changes. Closed by commit rHG0ae9fe9952b5: tests: avoid referring to pvec in demandimport test (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2287?vs=5780=5790 REVISION DETAIL https://phab.mercurial-scm.org/D2287 AFFECTED FILES tests/test-demandimport.py tests/test-demandimport.py.out CHANGE DETAILS diff --git a/tests/test-demandimport.py.out b/tests/test-demandimport.py.out --- a/tests/test-demandimport.py.out +++ b/tests/test-demandimport.py.out @@ -1,4 +1,9 @@ node = +errorproxy = +errorproxy.__doc__ = 'Mercurial exceptions. This ...' +errorproxy.__name__ = 'mercurial.error' +errorproxy.__dict__['__name__'] = 'mercurial.error' +errorproxy = os = os.system = os = @@ -19,11 +24,6 @@ re = re.stderr = ', mode 'w' at 0x?> re = -pvecproxy = -pvecproxy.__doc__ = 'A "pvec" is ...' -pvecproxy.__name__ = 'mercurial.pvec' -pvecproxy.__dict__['__name__'] = 'mercurial.pvec' -pvecproxy = contextlib = contextlib.unknownattr = ImportError: cannot import name unknownattr __import__('contextlib', ..., ['unknownattr']) = diff --git a/tests/test-demandimport.py b/tests/test-demandimport.py --- a/tests/test-demandimport.py +++ b/tests/test-demandimport.py @@ -41,6 +41,17 @@ del os.environ['HGDEMANDIMPORT'] demandimport.enable() +# Test access to special attributes through demandmod proxy +from mercurial import error as errorproxy +print("errorproxy =", f(errorproxy)) +print("errorproxy.__doc__ = %r" + % (' '.join(errorproxy.__doc__.split()[:3]) + ' ...')) +print("errorproxy.__name__ = %r" % errorproxy.__name__) +# __name__ must be accessible via __dict__ so the relative imports can be +# resolved +print("errorproxy.__dict__['__name__'] = %r" % errorproxy.__dict__['__name__']) +print("errorproxy =", f(errorproxy)) + import os print("os =", f(os)) @@ -79,17 +90,6 @@ print("re.stderr =", f(re.stderr)) print("re =", f(re)) -# Test access to special attributes through demandmod proxy -from mercurial import pvec as pvecproxy -print("pvecproxy =", f(pvecproxy)) -print("pvecproxy.__doc__ = %r" - % (' '.join(pvecproxy.__doc__.split()[:3]) + ' ...')) -print("pvecproxy.__name__ = %r" % pvecproxy.__name__) -# __name__ must be accessible via __dict__ so the relative imports can be -# resolved -print("pvecproxy.__dict__['__name__'] = %r" % pvecproxy.__dict__['__name__']) -print("pvecproxy =", f(pvecproxy)) - import contextlib print("contextlib =", f(contextlib)) try: To: martinvonz, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2287: tests: avoid referring to pvec in demandimport test
martinvonz added a comment. In https://phab.mercurial-scm.org/D2287#37835, @durin42 wrote: > +1 on decoupling this from pvec, but per discussion on https://phab.mercurial-scm.org/D2288 revise commit message per pvec's (temporary) stay of execution? Done REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2287 To: martinvonz, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2288: pvec: delete module
martinvonz updated this revision to Diff 5789. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2288?vs=5781=5789 REVISION DETAIL https://phab.mercurial-scm.org/D2288 AFFECTED FILES mercurial/debugcommands.py mercurial/pvec.py tests/test-completion.t tests/test-help.t CHANGE DETAILS diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -953,7 +953,6 @@ debugpickmergetool examine which merge tool is chosen for specified file debugpushkey access the pushkey key/value protocol - debugpvec (no help text available) debugrebuilddirstate rebuild the dirstate as it would look like for the given revision diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -105,7 +105,6 @@ debugpeer debugpickmergetool debugpushkey - debugpvec debugrebuilddirstate debugrebuildfncache debugrename @@ -285,7 +284,6 @@ debugpeer: debugpickmergetool: rev, changedelete, include, exclude, tool debugpushkey: - debugpvec: debugrebuilddirstate: rev, minimal debugrebuildfncache: debugrename: rev diff --git a/mercurial/pvec.py b/mercurial/pvec.py deleted file mode 100644 --- a/mercurial/pvec.py +++ /dev/null @@ -1,214 +0,0 @@ -# pvec.py - probabilistic vector clocks for Mercurial -# -# Copyright 2012 Matt Mackall-# -# This software may be used and distributed according to the terms of the -# GNU General Public License version 2 or any later version. - -''' -A "pvec" is a changeset property based on the theory of vector clocks -that can be compared to discover relatedness without consulting a -graph. This can be useful for tasks like determining how a -disconnected patch relates to a repository. - -Currently a pvec consist of 448 bits, of which 24 are 'depth' and the -remainder are a bit vector. It is represented as a 70-character base85 -string. - -Construction: - -- a root changeset has a depth of 0 and a bit vector based on its hash -- a normal commit has a changeset where depth is increased by one and - one bit vector bit is flipped based on its hash -- a merge changeset pvec is constructed by copying changes from one pvec into - the other to balance its depth - -Properties: - -- for linear changes, difference in depth is always <= hamming distance -- otherwise, changes are probably divergent -- when hamming distance is < 200, we can reliably detect when pvecs are near - -Issues: - -- hamming distance ceases to work over distances of ~ 200 -- detecting divergence is less accurate when the common ancestor is very close - to either revision or total distance is high -- this could probably be improved by modeling the relation between - delta and hdist - -Uses: - -- a patch pvec can be used to locate the nearest available common ancestor for - resolving conflicts -- ordering of patches can be established without a DAG -- two head pvecs can be compared to determine whether push/pull/merge is needed - and approximately how many changesets are involved -- can be used to find a heuristic divergence measure between changesets on - different branches -''' - -from __future__ import absolute_import - -from .node import nullrev -from . import ( -util, -) - -_size = 448 # 70 chars b85-encoded -_bytes = _size / 8 -_depthbits = 24 -_depthbytes = _depthbits / 8 -_vecbytes = _bytes - _depthbytes -_vecbits = _vecbytes * 8 -_radius = (_vecbits - 30) / 2 # high probability vectors are related - -def _bin(bs): -'''convert a bytestring to a long''' -v = 0 -for b in bs: -v = v * 256 + ord(b) -return v - -def _str(v, l): -bs = "" -for p in xrange(l): -bs = chr(v & 255) + bs -v >>= 8 -return bs - -def _split(b): -'''depth and bitvec''' -return _bin(b[:_depthbytes]), _bin(b[_depthbytes:]) - -def _join(depth, bitvec): -return _str(depth, _depthbytes) + _str(bitvec, _vecbytes) - -def _hweight(x): -c = 0 -while x: -if x & 1: -c += 1 -x >>= 1 -return c -_htab = [_hweight(x) for x in xrange(256)] - -def _hamming(a, b): -'''find the hamming distance between two longs''' -d = a ^ b -c = 0 -while d: -c += _htab[d & 0xff] -d >>= 8 -return c - -def _mergevec(x, y, c): -# Ideally, this function would be x ^ y ^ ancestor, but finding -# ancestors is a nuisance. So instead we find the minimal number -# of changes to balance the depth and hamming distance - -d1, v1 = x -d2, v2 = y -if d1 < d2: -d1, d2, v1, v2 = d2, d1, v2, v1 - -hdist = _hamming(v1, v2) -ddist = d1 - d2 -v = v1 -m = v1 ^ v2 # mask of different bits -i = 1 - -if hdist > ddist: -# if delta = 10 and hdist = 100, then we need to go up 55 steps -# to the ancestor and down 45 -changes =
Re: [PATCH 3 of 3] help: use cmdutil.parsealiases() to resolve command name
On Thu, Feb 15, 2018 at 10:42:38PM +0900, Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara> # Date 1515380983 -32400 > # Mon Jan 08 12:09:43 2018 +0900 > # Node ID 74f1b48042c6595ae49aaee050d1eac3b672fe6d > # Parent d5c440f7e2840eae190246159ec31d74b4df655f > help: use cmdutil.parsealiases() to resolve command name queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2279: node: make bin() be a wrapper instead of just an alias
This revision was automatically updated to reflect the committed changes. Closed by commit rHGaba1d578c97f: node: make bin() be a wrapper instead of just an alias (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2279?vs=5784=5788 REVISION DETAIL https://phab.mercurial-scm.org/D2279 AFFECTED FILES hgext/histedit.py mercurial/node.py mercurial/revlog.py CHANGE DETAILS diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -13,7 +13,6 @@ from __future__ import absolute_import -import binascii import collections import contextlib import errno @@ -1430,7 +1429,7 @@ if maybewdir: raise error.WdirUnsupported return None -except (TypeError, binascii.Error): +except TypeError: pass def lookup(self, id): diff --git a/mercurial/node.py b/mercurial/node.py --- a/mercurial/node.py +++ b/mercurial/node.py @@ -11,7 +11,14 @@ # This ugly style has a noticeable effect in manifest parsing hex = binascii.hexlify -bin = binascii.unhexlify +# Adapt to Python 3 API changes. If this ends up showing up in +# profiles, we can use this version only on Python 3, and forward +# binascii.unhexlify like we used to on Python 2. +def bin(s): +try: +return binascii.unhexlify(s) +except binascii.Error as e: +raise TypeError(e) nullrev = -1 nullid = b"\0" * 20 diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -183,7 +183,6 @@ from __future__ import absolute_import -import binascii import errno import os @@ -426,7 +425,7 @@ rulehash = rule.strip().split(' ', 1)[0] try: rev = node.bin(rulehash) -except (TypeError, binascii.Error): +except TypeError: raise error.ParseError("invalid changeset %s" % rulehash) return cls(state, rev) To: durin42, #hg-reviewers, martinvonz, indygreg Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 6 of 6] cmdutil: expand filename format string by templater (BC)
On Thu, Feb 15, 2018 at 10:18:44PM +0900, Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara> # Date 1515293587 -32400 > # Sun Jan 07 11:53:07 2018 +0900 > # Node ID 437212580debfa26ee266598f64139b4df5a9cfd > # Parent e7f4a2b09c484d4313aa6624470d92aef3ad5a10 > cmdutil: expand filename format string by templater (BC) queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2286: tests: actually check that HGDEMANDIMPORT=disable disables demandimport
This revision was automatically updated to reflect the committed changes. Closed by commit rHG02bb24cf6fd9: tests: actually check that HGDEMANDIMPORT=disable disables demandimport (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2286?vs=5779=5787 REVISION DETAIL https://phab.mercurial-scm.org/D2286 AFFECTED FILES tests/test-demandimport.py tests/test-demandimport.py.out CHANGE DETAILS diff --git a/tests/test-demandimport.py.out b/tests/test-demandimport.py.out --- a/tests/test-demandimport.py.out +++ b/tests/test-demandimport.py.out @@ -1,3 +1,4 @@ +node = os = os.system = os = @@ -27,4 +28,3 @@ contextlib.unknownattr = ImportError: cannot import name unknownattr __import__('contextlib', ..., ['unknownattr']) = hasattr(contextlibimp, 'unknownattr') = False -node = diff --git a/tests/test-demandimport.py b/tests/test-demandimport.py --- a/tests/test-demandimport.py +++ b/tests/test-demandimport.py @@ -31,6 +31,16 @@ l = rsub("'<[a-z]*>'", "''", l) return l +demandimport.disable() +os.environ['HGDEMANDIMPORT'] = 'disable' +# this enable call should not actually enable demandimport! +demandimport.enable() +from mercurial import node +print("node =", f(node)) +# now enable it for real +del os.environ['HGDEMANDIMPORT'] +demandimport.enable() + import os print("os =", f(os)) @@ -97,10 +107,3 @@ print("__import__('contextlib', ..., ['unknownattr']) =", f(contextlibimp)) print("hasattr(contextlibimp, 'unknownattr') =", util.safehasattr(contextlibimp, 'unknownattr')) - -demandimport.disable() -os.environ['HGDEMANDIMPORT'] = 'disable' -# this enable call should not actually enable demandimport! -demandimport.enable() -from mercurial import node -print("node =", f(node)) To: martinvonz, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2289: date: fix parsing months
This revision was automatically updated to reflect the committed changes. Closed by commit rHG4878f45c: date: fix parsing months (authored by quark, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2289?vs=5782=5786 REVISION DETAIL https://phab.mercurial-scm.org/D2289 AFFECTED FILES mercurial/util.py tests/test-parse-date.t CHANGE DETAILS diff --git a/tests/test-parse-date.t b/tests/test-parse-date.t --- a/tests/test-parse-date.t +++ b/tests/test-parse-date.t @@ -286,3 +286,9 @@ $ hg debugdate "2016-07-27 121021Z" internal: 1469621421 0 standard: Wed Jul 27 12:10:21 2016 + + +Test parsing months + + $ for i in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do + > hg log -d "$i 2018" -r null + > done diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -2179,7 +2179,7 @@ try: d["d"] = days return parsedate(date, extendeddateformats, d)[0] -except Abort: +except error.ParseError: pass d["d"] = "28" return parsedate(date, extendeddateformats, d)[0] To: quark, #hg-reviewers, martinvonz Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2287: tests: avoid referring to pvec in demandimport test
durin42 added a comment. +1 on decoupling this from pvec, but per discussion on https://phab.mercurial-scm.org/D2288 revise commit message per pvec's (temporary) stay of execution? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2287 To: martinvonz, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2280: remotenames: port partway to python3 by using collections.MutableMapping
durin42 updated this revision to Diff 5785. durin42 marked an inline comment as done. durin42 retitled this revision from "remotenames: port partway to python3" to "remotenames: port partway to python3 by using collections.MutableMapping". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2280?vs=5768=5785 REVISION DETAIL https://phab.mercurial-scm.org/D2280 AFFECTED FILES hgext/remotenames.py CHANGE DETAILS diff --git a/hgext/remotenames.py b/hgext/remotenames.py --- a/hgext/remotenames.py +++ b/hgext/remotenames.py @@ -22,7 +22,7 @@ from __future__ import absolute_import -import UserDict +import collections from mercurial.i18n import _ @@ -57,7 +57,7 @@ default=True, ) -class lazyremotenamedict(UserDict.DictMixin): +class lazyremotenamedict(collections.MutableMapping): """ Read-only dict-like Class to lazily resolve remotename entries @@ -110,6 +110,18 @@ else: raise KeyError() +def __iter__(self): +return iter(self.potentialentries) + +def __len__(self): +return len(self.potentialentries) + +def __setitem__(self): +raise NotImplementedError + +def __delitem__(self): +raise NotImplementedError + def _fetchandcache(self, key): if key in self.cache: return self.cache[key] To: durin42, #hg-reviewers Cc: dlax, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2280: remotenames: port partway to python3 by using collections.MutableMapping
durin42 added a comment. Updated REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2280 To: durin42, #hg-reviewers Cc: dlax, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2288: pvec: delete module
martinvonz added a comment. In https://phab.mercurial-scm.org/D2288#37819, @durin42 wrote: > SoI actually have an idea involving pvec and obsmarker metadata in `hg export` output. I'll work on fixing any problems in pvec, can we keep it around a little longer? Definitely. It hasn't bothered me at all personally. I just saw it in the list of files and wondered what it was. The first two patches in this series should still make sense. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2288 To: martinvonz, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2279: node: make bin() be a wrapper instead of just an alias
durin42 updated this revision to Diff 5784. durin42 edited the summary of this revision. Herald added a reviewer: indygreg. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2279?vs=5761=5784 REVISION DETAIL https://phab.mercurial-scm.org/D2279 AFFECTED FILES hgext/histedit.py mercurial/node.py mercurial/revlog.py CHANGE DETAILS diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -13,7 +13,6 @@ from __future__ import absolute_import -import binascii import collections import contextlib import errno @@ -1430,7 +1429,7 @@ if maybewdir: raise error.WdirUnsupported return None -except (TypeError, binascii.Error): +except TypeError: pass def lookup(self, id): diff --git a/mercurial/node.py b/mercurial/node.py --- a/mercurial/node.py +++ b/mercurial/node.py @@ -11,7 +11,14 @@ # This ugly style has a noticeable effect in manifest parsing hex = binascii.hexlify -bin = binascii.unhexlify +# Adapt to Python 3 API changes. If this ends up showing up in +# profiles, we can use this version only on Python 3, and forward +# binascii.unhexlify like we used to on Python 2. +def bin(s): +try: +return binascii.unhexlify(s) +except binascii.Error as e: +raise TypeError(e) nullrev = -1 nullid = b"\0" * 20 diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -183,7 +183,6 @@ from __future__ import absolute_import -import binascii import errno import os @@ -426,7 +425,7 @@ rulehash = rule.strip().split(' ', 1)[0] try: rev = node.bin(rulehash) -except (TypeError, binascii.Error): +except TypeError: raise error.ParseError("invalid changeset %s" % rulehash) return cls(state, rev) To: durin42, #hg-reviewers, martinvonz, indygreg Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2279: node: make bin() be a wrapper instead of just an alias
durin42 added a comment. In https://phab.mercurial-scm.org/D2279#37680, @martinvonz wrote: > Also make this commit back out https://phab.mercurial-scm.org/rHG30d0cb279bacf791577e90124b2a94018588f0b8? done REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2279 To: durin42, #hg-reviewers, martinvonz, indygreg Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1808: debugcommands: print out the editor that was searched for (post shlexsplit)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG04e81ae47066: debugcommands: print out the editor that was searched for (post shlexsplit) (authored by spectral, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1808?vs=4714=5783 REVISION DETAIL https://phab.mercurial-scm.org/D1808 AFFECTED FILES mercurial/debugcommands.py tests/test-install.t CHANGE DETAILS diff --git a/tests/test-install.t b/tests/test-install.t --- a/tests/test-install.t +++ b/tests/test-install.t @@ -17,7 +17,7 @@ checking "re2" regexp engine \((available|missing)\) (re) checking templates (*mercurial?templates)... (glob) checking default template (*mercurial?templates?map-cmdline.default) (glob) - checking commit editor... (* -c "import sys; sys.exit(0)") (glob) + checking commit editor... (*) (glob) checking username (test) no problems detected @@ -31,7 +31,7 @@ "defaulttemplate": "*mercurial?templates?map-cmdline.default", (glob) "defaulttemplateerror": null, "defaulttemplatenotfound": "default", -"editor": "* -c \"import sys; sys.exit(0)\"", (glob) +"editor": "*", (glob) "editornotfound": false, "encoding": "ascii", "encodingerror": null, @@ -72,7 +72,7 @@ checking "re2" regexp engine \((available|missing)\) (re) checking templates (*mercurial?templates)... (glob) checking default template (*mercurial?templates?map-cmdline.default) (glob) - checking commit editor... (* -c "import sys; sys.exit(0)") (glob) + checking commit editor... (*) (glob) checking username... no username supplied (specify a username in your configuration file) @@ -120,6 +120,33 @@ checking username (test) no problems detected +print out the binary post-shlexsplit in the error message when commit editor is +not found (this is intentionally using backslashes to mimic a windows usecase). + $ HGEDITOR="c:\foo\bar\baz.exe -y -z" hg debuginstall + checking encoding (ascii)... + checking Python executable (*) (glob) + checking Python version (*) (glob) + checking Python lib (*lib*)... (glob) + checking Python security support (*) (glob) +TLS 1.2 not supported by Python install; network connections lack modern security (?) +SNI not supported by Python install; may have connectivity issues with some servers (?) + checking Mercurial version (*) (glob) + checking Mercurial custom build (*) (glob) + checking module policy (*) (glob) + checking installed modules (*mercurial)... (glob) + checking registered compression engines (*zlib*) (glob) + checking available compression engines (*zlib*) (glob) + checking available compression engines for wire protocol (*zlib*) (glob) + checking "re2" regexp engine \((available|missing)\) (re) + checking templates (*mercurial?templates)... (glob) + checking default template (*mercurial?templates?map-cmdline.default) (glob) + checking commit editor... (c:foobarbaz.exe) + Can't find editor 'c:foobarbaz.exe' in PATH + (specify a commit editor in your configuration file) + checking username (test) + 1 problems detected, please check your install! + [1] + #if test-repo $ . "$TESTDIR/helpers-testrepo.sh" diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -1240,16 +1240,17 @@ # editor editor = ui.geteditor() editor = util.expandpath(editor) -fm.write('editor', _("checking commit editor... (%s)\n"), editor) -cmdpath = util.findexe(pycompat.shlexsplit(editor)[0]) +editorbin = pycompat.shlexsplit(editor)[0] +fm.write('editor', _("checking commit editor... (%s)\n"), editorbin) +cmdpath = util.findexe(editorbin) fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound', _(" No commit editor set and can't find %s in PATH\n" " (specify a commit editor in your configuration" - " file)\n"), not cmdpath and editor == 'vi' and editor) + " file)\n"), not cmdpath and editor == 'vi' and editorbin) fm.condwrite(not cmdpath and editor != 'vi', 'editornotfound', _(" Can't find editor '%s' in PATH\n" " (specify a commit editor in your configuration" - " file)\n"), not cmdpath and editor) + " file)\n"), not cmdpath and editorbin) if not cmdpath and editor != 'vi': problems += 1 To: spectral, #hg-reviewers, krbullock Cc: durin42, krbullock, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2288: pvec: delete module
durin42 added a comment. SoI actually have an idea involving pvec and obsmarker metadata in `hg export` output. I'll work on fixing any problems in pvec, can we keep it around a little longer? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2288 To: martinvonz, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2048: utils: copy util.py as utils/dateutil.py
durin42 added a comment. In https://phab.mercurial-scm.org/D2048#37691, @lothiraldan wrote: > I've resent the series as https://phab.mercurial-scm.org/D2282 as a single changeset. I've included a note for extension authors with a link to the old series to more easily bisect the changeset breaking their extension. > > Do you think it would be hard to update `blame` to work in the current case? I think it's probably a significant amount of work to record sub-file-level copy information. It'd be of value, but I'm deeply skeptical it's worth the amount of time it'd take. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2048 To: lothiraldan, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1919: phabricator: specify API tokens per host, rather than per repo
durin42 added a comment. I generally agree we should support a non-arc option, I'm happy to not have arc on my machines anymore. I'll meditate on this over the long weekend. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1919 To: tom.prince, #hg-reviewers, durin42 Cc: quark, indygreg, durin42, pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2289: date: fix parsing months
martinvonz added a comment. Queuing for stable REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2289 To: quark, #hg-reviewers, martinvonz Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2289: date: fix parsing months
quark created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Thanks nemo for discovering this on #mercurial IRC channel. TEST PLAN Add a test. It fails before this patch: + hg: parse error: invalid date: 'Feb 2018' + hg: parse error: invalid date: 'Apr 2018' + hg: parse error: invalid date: 'Jun 2018' + hg: parse error: invalid date: 'Sep 2018' + hg: parse error: invalid date: 'Nov 2018' REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2289 AFFECTED FILES mercurial/util.py tests/test-parse-date.t CHANGE DETAILS diff --git a/tests/test-parse-date.t b/tests/test-parse-date.t --- a/tests/test-parse-date.t +++ b/tests/test-parse-date.t @@ -286,3 +286,9 @@ $ hg debugdate "2016-07-27 121021Z" internal: 1469621421 0 standard: Wed Jul 27 12:10:21 2016 + + +Test parsing months + + $ for i in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do + > hg log -d "$i 2018" -r null + > done diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -2212,7 +2212,7 @@ try: d["d"] = days return parsedate(date, extendeddateformats, d)[0] -except Abort: +except error.ParseError: pass d["d"] = "28" return parsedate(date, extendeddateformats, d)[0] To: quark, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2287: tests: avoid referring to pvec in demandimport test
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I'm going to delete pvec, so this patch replaces it by the error module in the demandimport test (any module works). However, since the error module had already been loaded at this point in the test (via the util module), I moved it earlier in the test so it's still not loaded (although I'm not sure if that's even relevant to the test). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2287 AFFECTED FILES tests/test-demandimport.py tests/test-demandimport.py.out CHANGE DETAILS diff --git a/tests/test-demandimport.py.out b/tests/test-demandimport.py.out --- a/tests/test-demandimport.py.out +++ b/tests/test-demandimport.py.out @@ -1,4 +1,9 @@ node = +errorproxy = +errorproxy.__doc__ = 'Mercurial exceptions. This ...' +errorproxy.__name__ = 'mercurial.error' +errorproxy.__dict__['__name__'] = 'mercurial.error' +errorproxy = os = os.system = os = @@ -19,11 +24,6 @@ re = re.stderr = ', mode 'w' at 0x?> re = -pvecproxy = -pvecproxy.__doc__ = 'A "pvec" is ...' -pvecproxy.__name__ = 'mercurial.pvec' -pvecproxy.__dict__['__name__'] = 'mercurial.pvec' -pvecproxy = contextlib = contextlib.unknownattr = ImportError: cannot import name unknownattr __import__('contextlib', ..., ['unknownattr']) = diff --git a/tests/test-demandimport.py b/tests/test-demandimport.py --- a/tests/test-demandimport.py +++ b/tests/test-demandimport.py @@ -41,6 +41,17 @@ del os.environ['HGDEMANDIMPORT'] demandimport.enable() +# Test access to special attributes through demandmod proxy +from mercurial import error as errorproxy +print("errorproxy =", f(errorproxy)) +print("errorproxy.__doc__ = %r" + % (' '.join(errorproxy.__doc__.split()[:3]) + ' ...')) +print("errorproxy.__name__ = %r" % errorproxy.__name__) +# __name__ must be accessible via __dict__ so the relative imports can be +# resolved +print("errorproxy.__dict__['__name__'] = %r" % errorproxy.__dict__['__name__']) +print("errorproxy =", f(errorproxy)) + import os print("os =", f(os)) @@ -79,17 +90,6 @@ print("re.stderr =", f(re.stderr)) print("re =", f(re)) -# Test access to special attributes through demandmod proxy -from mercurial import pvec as pvecproxy -print("pvecproxy =", f(pvecproxy)) -print("pvecproxy.__doc__ = %r" - % (' '.join(pvecproxy.__doc__.split()[:3]) + ' ...')) -print("pvecproxy.__name__ = %r" % pvecproxy.__name__) -# __name__ must be accessible via __dict__ so the relative imports can be -# resolved -print("pvecproxy.__dict__['__name__'] = %r" % pvecproxy.__dict__['__name__']) -print("pvecproxy =", f(pvecproxy)) - import contextlib print("contextlib =", f(contextlib)) try: To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2288: pvec: delete module
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The pvec module was introduced in https://phab.mercurial-scm.org/rHG0d175ac527c1d1b51b1de6dff25907ae377b9280 (pvec: introduce pvecs, 2012-03-12), but it seems it was never used. Let's delete it to avoid wasting time cleaning it up in the future. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2288 AFFECTED FILES mercurial/debugcommands.py mercurial/pvec.py tests/test-completion.t tests/test-help.t CHANGE DETAILS diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -953,7 +953,6 @@ debugpickmergetool examine which merge tool is chosen for specified file debugpushkey access the pushkey key/value protocol - debugpvec (no help text available) debugrebuilddirstate rebuild the dirstate as it would look like for the given revision diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -105,7 +105,6 @@ debugpeer debugpickmergetool debugpushkey - debugpvec debugrebuilddirstate debugrebuildfncache debugrename @@ -285,7 +284,6 @@ debugpeer: debugpickmergetool: rev, changedelete, include, exclude, tool debugpushkey: - debugpvec: debugrebuilddirstate: rev, minimal debugrebuildfncache: debugrename: rev diff --git a/mercurial/pvec.py b/mercurial/pvec.py deleted file mode 100644 --- a/mercurial/pvec.py +++ /dev/null @@ -1,214 +0,0 @@ -# pvec.py - probabilistic vector clocks for Mercurial -# -# Copyright 2012 Matt Mackall-# -# This software may be used and distributed according to the terms of the -# GNU General Public License version 2 or any later version. - -''' -A "pvec" is a changeset property based on the theory of vector clocks -that can be compared to discover relatedness without consulting a -graph. This can be useful for tasks like determining how a -disconnected patch relates to a repository. - -Currently a pvec consist of 448 bits, of which 24 are 'depth' and the -remainder are a bit vector. It is represented as a 70-character base85 -string. - -Construction: - -- a root changeset has a depth of 0 and a bit vector based on its hash -- a normal commit has a changeset where depth is increased by one and - one bit vector bit is flipped based on its hash -- a merge changeset pvec is constructed by copying changes from one pvec into - the other to balance its depth - -Properties: - -- for linear changes, difference in depth is always <= hamming distance -- otherwise, changes are probably divergent -- when hamming distance is < 200, we can reliably detect when pvecs are near - -Issues: - -- hamming distance ceases to work over distances of ~ 200 -- detecting divergence is less accurate when the common ancestor is very close - to either revision or total distance is high -- this could probably be improved by modeling the relation between - delta and hdist - -Uses: - -- a patch pvec can be used to locate the nearest available common ancestor for - resolving conflicts -- ordering of patches can be established without a DAG -- two head pvecs can be compared to determine whether push/pull/merge is needed - and approximately how many changesets are involved -- can be used to find a heuristic divergence measure between changesets on - different branches -''' - -from __future__ import absolute_import - -from .node import nullrev -from . import ( -util, -) - -_size = 448 # 70 chars b85-encoded -_bytes = _size / 8 -_depthbits = 24 -_depthbytes = _depthbits / 8 -_vecbytes = _bytes - _depthbytes -_vecbits = _vecbytes * 8 -_radius = (_vecbits - 30) / 2 # high probability vectors are related - -def _bin(bs): -'''convert a bytestring to a long''' -v = 0 -for b in bs: -v = v * 256 + ord(b) -return v - -def _str(v, l): -bs = "" -for p in xrange(l): -bs = chr(v & 255) + bs -v >>= 8 -return bs - -def _split(b): -'''depth and bitvec''' -return _bin(b[:_depthbytes]), _bin(b[_depthbytes:]) - -def _join(depth, bitvec): -return _str(depth, _depthbytes) + _str(bitvec, _vecbytes) - -def _hweight(x): -c = 0 -while x: -if x & 1: -c += 1 -x >>= 1 -return c -_htab = [_hweight(x) for x in xrange(256)] - -def _hamming(a, b): -'''find the hamming distance between two longs''' -d = a ^ b -c = 0 -while d: -c += _htab[d & 0xff] -d >>= 8 -return c - -def _mergevec(x, y, c): -# Ideally, this function would be x ^ y ^ ancestor, but finding -# ancestors is a nuisance. So instead we find the minimal number -# of changes to balance the depth and hamming distance - -d1, v1 = x -d2, v2 = y -if d1 < d2: -d1, d2, v1, v2 = d2, d1, v2, v1 - -hdist
D2286: tests: actually check that HGDEMANDIMPORT=disable disables demandimport
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY At the point in the test where we were checking that the 'node' got eagerly loaded, it had already been loaded (via the pvec module), so our check wasn't doing anything (i.e. the test would pass even if you removed the line that set HGDEMANDIMPORT=disable). Let's move this test earlier so it tests what it was meant to test. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2286 AFFECTED FILES tests/test-demandimport.py tests/test-demandimport.py.out CHANGE DETAILS diff --git a/tests/test-demandimport.py.out b/tests/test-demandimport.py.out --- a/tests/test-demandimport.py.out +++ b/tests/test-demandimport.py.out @@ -1,3 +1,4 @@ +node = os = os.system = os = @@ -27,4 +28,3 @@ contextlib.unknownattr = ImportError: cannot import name unknownattr __import__('contextlib', ..., ['unknownattr']) = hasattr(contextlibimp, 'unknownattr') = False -node = diff --git a/tests/test-demandimport.py b/tests/test-demandimport.py --- a/tests/test-demandimport.py +++ b/tests/test-demandimport.py @@ -31,6 +31,16 @@ l = rsub("'<[a-z]*>'", "''", l) return l +demandimport.disable() +os.environ['HGDEMANDIMPORT'] = 'disable' +# this enable call should not actually enable demandimport! +demandimport.enable() +from mercurial import node +print("node =", f(node)) +# now enable it for real +del os.environ['HGDEMANDIMPORT'] +demandimport.enable() + import os print("os =", f(os)) @@ -97,10 +107,3 @@ print("__import__('contextlib', ..., ['unknownattr']) =", f(contextlibimp)) print("hasattr(contextlibimp, 'unknownattr') =", util.safehasattr(contextlibimp, 'unknownattr')) - -demandimport.disable() -os.environ['HGDEMANDIMPORT'] = 'disable' -# this enable call should not actually enable demandimport! -demandimport.enable() -from mercurial import node -print("node =", f(node)) To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2278: bundle: updates the help text for hg bundle (issue5744) [bugzilla]
khanchi97 updated this revision to Diff 5778. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2278?vs=5760=5778 REVISION DETAIL https://phab.mercurial-scm.org/D2278 AFFECTED FILES mercurial/commands.py CHANGE DETAILS diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1157,11 +1157,13 @@ def bundle(ui, repo, fname, dest=None, **opts): """create a bundle file -Generate a bundle file containing data to be added to a repository. +Generate a bundle file containing data to be transferred to another +repository. To create a bundle containing all changesets, use -a/--all (or --base null). Otherwise, hg assumes the destination will have -all the nodes you specify with --base parameters. Otherwise, hg +all the nodes you specify with --base parameters, where destination is +the repository you provide through [DEST] option. Otherwise, hg will assume the repository has all the nodes in destination, or default-push/default if no destination is specified. To: khanchi97, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2282: util: extract all date-related utils in utils/dateutil module
durin42 added a comment. In https://phab.mercurial-scm.org/D2282#37774, @martinvonz wrote: > In https://phab.mercurial-scm.org/D2282#37758, @lothiraldan wrote: > > > In https://phab.mercurial-scm.org/D2282#37757, @dlax wrote: > > > > > lothiraldan (Boris Feld) wrote: > > > > > > > I have but I'm always very cautious when creating a new package with the > > > > name of an old module. .pyc/.pycache files may still be there both for > > > > Mercurial developers and for Mercurial users using their deb/rpm package. > > > > > > > > I may be wrong, but if we could avoid weird bugs, I would prefer put in > > > > the utils package. > > > > > > Well, this is Python... Most people are aware of this kind of issues, I > > > think. So the argument sounds a bit like FUD :) > > > > > > On the other hand, if we keep going that route, we'll have to live with > > > util/utils "forever" just to have avoided this hypothetical > > > inconvenience, is this more acceptable? > > > > > > I would love to be wrong on this, just remember that Mercurial users are not necessarily Python developers. > > > > @martinvonz @durin42 what d you think about copying `util.py` as `util/__init__.py`? > > > I don't know much about Python. Is it defined whether util.pyc or util/__init__.py will take precedence, and, if so, which is it? I asked Alex Gaynor about this and it's not an immediate answer ("You get a basket of trouble. What python version?") Could we make the package version be utils (note trailing ess) and migrate things to the package as we have time, making util be the legacy forwarding name and nothing more? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2282 To: lothiraldan, #hg-reviewers Cc: durin42, dlax, martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2282: util: extract all date-related utils in utils/dateutil module
martinvonz added a comment. In https://phab.mercurial-scm.org/D2282#37758, @lothiraldan wrote: > In https://phab.mercurial-scm.org/D2282#37757, @dlax wrote: > > > lothiraldan (Boris Feld) wrote: > > > > > I have but I'm always very cautious when creating a new package with the > > > name of an old module. .pyc/.pycache files may still be there both for > > > Mercurial developers and for Mercurial users using their deb/rpm package. > > > > > > I may be wrong, but if we could avoid weird bugs, I would prefer put in > > > the utils package. > > > > Well, this is Python... Most people are aware of this kind of issues, I > > think. So the argument sounds a bit like FUD :) > > > > On the other hand, if we keep going that route, we'll have to live with > > util/utils "forever" just to have avoided this hypothetical > > inconvenience, is this more acceptable? > > > I would love to be wrong on this, just remember that Mercurial users are not necessarily Python developers. > > @martinvonz @durin42 what d you think about copying `util.py` as `util/__init__.py`? I don't know much about Python. Is it defined whether util.pyc or util/__init__.py will take precedence, and, if so, which is it? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2282 To: lothiraldan, #hg-reviewers Cc: durin42, dlax, martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1919: phabricator: specify API tokens per host, rather than per repo
tom.prince added a comment. Personally, I don't have arc installed, so I'd prefer putting the auth information in mercurial rather than arc specific places (this is what is stored in `.arcrc` I think). It would make sense to support `.arcrc` as well, though. It would make sense to read the URL and call-sign from `.arcconfig`, which is a file in the repo, if it is provided. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1919 To: tom.prince, #hg-reviewers, durin42 Cc: quark, indygreg, durin42, pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2013: commit: allow --no-secret to override phases.new-commit setting
martinvonz added a comment. In https://phab.mercurial-scm.org/D2013#34509, @martinvonz wrote: > In https://phab.mercurial-scm.org/D2013#34320, @spectral wrote: > > > In https://phab.mercurial-scm.org/D2013#33867, @martinvonz wrote: > > > > > I wonder if we should instead have a --draft option for this. Reasons: > > > > > > - If we ever add a fourth phase (like Jun's proposed "archived" phase), then --no-secret doesn't clearly indicate "draft", it could just as well be "archived". > > > - Actually, we of course already do have a third phase. One could imagine a "hg commit --public", although that's probably not useful enough to warrant its own option, but it seems to suggest that "--no-secret" doesn't necessarily mean "draft". > > > - I find this tri-state boolean weird. "--secret" kind of defaults to off, but it can be made "more off" with "--no-secret". > > > > > > Yeah, I wasn't sure I liked it when writing it, and I'm fine with changing it, but do we really want a proliferation of flags? Perhaps we want a generic 'phase' flag, so one can specify -s or --secret (BC and it's the "most common" case), and --phasefor more advanced use-cases? This runs into a couple small problems, specifically that there's now "more than one way to do it [specify secret]", it's a lot of typing, and I don't think we should abbreviate it `-p` (it just doesn't feel like it's going to be common enough to warrant any abbreviation, let alone 'p', which could stand for phase, or patch, or path, or a number of other words that we might eventually add to `commit` and be sad about not being able to abbreviate in the obvious fashion) > > > I think "--phase " makes sense, but it is a little long as you said. Since the real goal of this series is to preserve the phase on `hg split`, I'll see if I can do that by adding general support to scmutil.cleanupnodes() instead (Kyle and I already talked about this offline). Here's an update on this work: It turned out to be harder than I expected. The main problem seems to be that interrupted `hg rebase/histedit` does not call cleanupnodes, but they still expect the phase to get set. They also currently don't create obsmarkers. The reason they don't is because obsmarkers can't be undone, which is important for `hg rebase/histedit --abort`. However, these days repair.py will strip obsmarkers, so my plan now is this: 1. Make rebase/histedit add obsmarkers as we go and undo them on abort [1]. This means that the user will see which commits have already been rebased when rebase/histedit is interrupted. I think that's a good thing. 2. Make cleanupnodes() propagate phase to successor (without affecting parent commit, of course, so if parent is secret, then so will the successor be, even if the precursor was draft). This will be some new version of cleanupnodes() that will not strip the precursors in the obsmarker-less case. 3. Remove code for propagating phase from existing commands (e.g. amend) Perhaps I'll find some time to work on this during the sprint, but it does seem a little big to be completed during the sprint. [1] It seems like we should do the same with bookmarks -- move them as we go, but move them back on abort. However, I'm not sure if that's BC. Can we pretend that it was a bug that they didn't? Maybe we don't care much about BC of interrupted rebase/histedit? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2013 To: spectral, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 5794] New: lfs doesn't play well with narrow
https://bz.mercurial-scm.org/show_bug.cgi?id=5794 Bug ID: 5794 Summary: lfs doesn't play well with narrow Product: Mercurial Version: default branch Hardware: PC OS: Linux Status: UNCONFIRMED Severity: feature Priority: wish Component: lfs Assignee: bugzi...@mercurial-scm.org Reporter: idls...@gmail.com CC: mercurial-devel@mercurial-scm.org I've tried to clone a repository with both narrow and lfs enabled, and got a LookupError for a file that was excluded from the clone. The interesting part in the stacktrace is line 230 from lfs/__init__.py: 230: # TODO: is there a way to just walk the files in the commit? 231: if any(ctx[f].islfs() for f in ctx.files() if f in ctx): Here is the full stracktrace: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/mercurial/scmutil.py", line 154, in callcatch return func() File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 314, in _runcatchfunc return _dispatch(req) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 917, in _dispatch cmdpats, cmdoptions) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 674, in runcommand ret = _runcommand(ui, options, cmd, d) File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 925, in _runcommand return cmdfunc() File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 914, in d = lambda: util.checksignature(func)(ui, *args, **strcmdopt) File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 1228, in check return func(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 1228, in check return func(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/hgext/narrow/narrowcommands.py", line 116, in clonenarrowcmd return orig(ui, repo, *args, **pycompat.strkwargs(opts)) File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 1228, in check return func(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 1450, in clone shareopts=opts.get('shareopts')) File "/usr/lib/python2.7/dist-packages/hgext/lfs/wrapper.py", line 227, in hgclone result = orig(ui, opts, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 680, in clone streamclonerequested=stream) File "/usr/lib/python2.7/dist-packages/hgext/narrow/narrowcommands.py", line 111, in pullnarrow return orig(repo, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/exchange.py", line 1364, in pull _pullbundle2(pullop) File "/usr/lib/python2.7/dist-packages/mercurial/exchange.py", line 1541, in _pullbundle2 bundle2.processbundle(pullop.repo, bundle, op=op) File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py", line 454, in processbundle processparts(repo, op, unbundler) File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py", line 461, in processparts _processpart(op, part) File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py", line 528, in _processpart handler(op, part) File "/usr/lib/python2.7/dist-packages/hgext/narrow/narrowbundle2.py", line 491, in wrappedcghandler origcghandler(op, inpart) File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py", line 1734, in handlechangegroup expectedtotal=nbchangesets, **extrakwargs) File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py", line 464, in _processchangegroup ret = cg.apply(op.repo, tr, source, url, **kwargs) File "/usr/lib/python2.7/dist-packages/mercurial/changegroup.py", line 364, in apply throw=True, **pycompat.strkwargs(hookargs)) File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 827, in hook return hook.hook(self.ui, self, name, throw, **args) File "/usr/lib/python2.7/dist-packages/mercurial/hook.py", line 210, in hook res = runhooks(ui, repo, htype, hooks, throw=throw, **args) File "/usr/lib/python2.7/dist-packages/mercurial/hook.py", line 246, in runhooks throw) File "/usr/lib/python2.7/dist-packages/mercurial/hook.py", line 94, in _pythonhook r = obj(ui=ui, repo=repo, hooktype=htype, **pycompat.strkwargs(args)) File "/usr/lib/python2.7/dist-packages/hgext/lfs/__init__.py", line 231, in checkrequireslfs if any(ctx[f].islfs() for f in ctx.files() if f in ctx): File "/usr/lib/python2.7/dist-packages/hgext/lfs/__init__.py", line 231, in if any(ctx[f].islfs() for f in ctx.files() if f in ctx): File "/usr/lib/python2.7/dist-packages/hgext/lfs/wrapper.py", line 179, in filectxislfs return _islfs(self.filelog(), self.filenode()) File "/usr/lib/python2.7/dist-packages/mercurial/context.py", line 774, in filenode return self._filenode File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 966, in __get__ result =
D2277: remotenames: don't use the default value of logfmt for namespaces
pulkit updated this revision to Diff 5777. pulkit edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2277?vs=5756=5777 REVISION DETAIL https://phab.mercurial-scm.org/D2277 AFFECTED FILES hgext/remotenames.py tests/test-logexchange.t CHANGE DETAILS diff --git a/tests/test-logexchange.t b/tests/test-logexchange.t --- a/tests/test-logexchange.t +++ b/tests/test-logexchange.t @@ -127,24 +127,24 @@ @ changeset: 8:3e1487808078 | branch: wat | tag: tip - | remote branch:$TESTTMP/server2/wat - | remote branch:default/wat + | remote branch: $TESTTMP/server2/wat + | remote branch: default/wat | parent: 4:aa98ab95a928 | user:test | date:Thu Jan 01 00:00:00 1970 + | summary: added bar | | o changeset: 7:ec2426147f0e - | | remote branch:$TESTTMP/server2/default - | | remote branch:default/default + | | remote branch: $TESTTMP/server2/default + | | remote branch: default/default | | user:test | | date:Thu Jan 01 00:00:00 1970 + | | summary: Added h | | | o changeset: 6:87d6d6676308 | | bookmark:bar - | | remote bookmark:$TESTTMP/server2/bar - | | remote bookmark:default/bar + | | remote bookmark: $TESTTMP/server2/bar + | | remote bookmark: default/bar | | user:test | | date:Thu Jan 01 00:00:00 1970 + | | summary: Added g @@ -161,8 +161,8 @@ | o changeset: 3:62615734edd5 | bookmark:foo - | remote bookmark:$TESTTMP/server2/foo - | remote bookmark:default/foo + | remote bookmark: $TESTTMP/server2/foo + | remote bookmark: default/foo | user:test | date:Thu Jan 01 00:00:00 1970 + | summary: Added d diff --git a/hgext/remotenames.py b/hgext/remotenames.py --- a/hgext/remotenames.py +++ b/hgext/remotenames.py @@ -192,8 +192,8 @@ remotebookmarkns = ns( 'remotebookmarks', templatename='remotebookmarks', -logname='remote bookmark', colorname='remotebookmark', +logfmt='remote bookmark: %s\n', listnames=lambda repo: repo._remotenames.bmarktonodes().keys(), namemap=lambda repo, name: repo._remotenames.bmarktonodes().get(name, []), @@ -205,8 +205,8 @@ remotebranchns = ns( 'remotebranches', templatename='remotebranches', -logname='remote branch', colorname='remotebranch', +logfmt='remote branch: %s\n', listnames = lambda repo: repo._remotenames.branchtonodes().keys(), namemap = lambda repo, name: repo._remotenames.branchtonodes().get(name, []), To: pulkit, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2278: bundle: updates the help text for hg bundle (issue5744) [bugzilla]
yuja requested changes to this revision. yuja added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > commands.py:1161 > +Generate a bundle file containing data to be added to the > +destination/[DEST] which is probably a repository. > "probably a repository" ? If `--all` given, the generated bundle isn't intended to be added to the DEST repository. > commands.py:1167 > will assume the repository has all the nodes in destination, or > default-push/default if no destination is specified. > Here the destination repository is described. I think we can instead refine this paragraph to clarify what the DEST is. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2278 To: khanchi97, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2277: remotenames: don't use the default value of logfmt for namespaces
yuja requested changes to this revision. yuja added a comment. This revision now requires changes to proceed. Looks good, but perhaps we can delete `logname` superseded by `logfmt`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2277 To: pulkit, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 2] gitweb: make span.age CSS selector more specific
On Thu, 15 Feb 2018 22:38:01 +0800, Anton Shestakov wrote: > # HG changeset patch > # User Anton Shestakov> # Date 1518699931 -28800 > # Thu Feb 15 21:05:31 2018 +0800 > # Node ID e4803e41e488aa52e56280bfd6bce4156dc402a6 > # Parent 7c6900cc30ee801b782086d98fdcea878eba2bab > gitweb: make span.age CSS selector more specific Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2282: util: extract all date-related utils in utils/dateutil module
lothiraldan added a subscriber: durin42. lothiraldan added a comment. In https://phab.mercurial-scm.org/D2282#37757, @dlax wrote: > lothiraldan (Boris Feld) wrote: > > > I have but I'm always very cautious when creating a new package with the > > name of an old module. .pyc/.pycache files may still be there both for > > Mercurial developers and for Mercurial users using their deb/rpm package. > > > > I may be wrong, but if we could avoid weird bugs, I would prefer put in > > the utils package. > > Well, this is Python... Most people are aware of this kind of issues, I > think. So the argument sounds a bit like FUD :) > > On the other hand, if we keep going that route, we'll have to live with > util/utils "forever" just to have avoided this hypothetical > inconvenience, is this more acceptable? I would love to be wrong on this, just remember that Mercurial users are not necessarily Python developers. @martinvonz @durin42 what d you think about copying `util.py` as `util/__init__.py`? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2282 To: lothiraldan, #hg-reviewers Cc: durin42, dlax, martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 5793] New: Fix for #5675 made it impossible to share repositories containing external subrepositories
https://bz.mercurial-scm.org/show_bug.cgi?id=5793 Bug ID: 5793 Summary: Fix for #5675 made it impossible to share repositories containing external subrepositories Product: Mercurial Version: 4.4 Hardware: All OS: All Status: UNCONFIRMED Severity: bug Priority: wish Component: Mercurial Assignee: bugzi...@mercurial-scm.org Reporter: erik.dewee...@luciad.com CC: mercurial-devel@mercurial-scm.org The fix for https://bz.mercurial-scm.org/show_bug.cgi?id=5675, which shares subrepositories instead of cloning them when the parent is also shared, made it impossible to use the ShareExtension when the subrepository is remote. Entries in .hgsub may specify an absolute URL, not necessarily on the same server as the parent repository. Attempting to share such a repository results in $ hg up --clean --rev 2017.1 sharing subrepo native/libecw from https://... abort: can only share local repositories (in subrepository "native/libecw") Although the Subrepository documentation recommends mirroring repositories instead of using absolute URLs, that is often not feasible and cumbersome in production environments. Sharing will also not work if the subrepository is specified as a relative path within the parent and the base clone is at a revision that doesn't contain the subrepository (the null revision for example). While I do understand the reasoning behind the fix, I feel you should be able to turn it off or specify a fallback behavior for non-shareable subrepositories. -- You are receiving this mail because: You are on the CC list for the bug. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2282: util: extract all date-related utils in utils/dateutil module
dlax added a comment. lothiraldan (Boris Feld) wrote: > I have but I'm always very cautious when creating a new package with the > name of an old module. .pyc/.pycache files may still be there both for > Mercurial developers and for Mercurial users using their deb/rpm package. > > I may be wrong, but if we could avoid weird bugs, I would prefer put in > the utils package. Well, this is Python... Most people are aware of this kind of issues, I think. So the argument sounds a bit like FUD :) On the other hand, if we keep going that route, we'll have to live with util/utils "forever" just to have avoided this hypothetical inconvenience, is this more acceptable? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2282 To: lothiraldan, #hg-reviewers Cc: dlax, martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2282: util: extract all date-related utils in utils/dateutil module
lothiraldan added a comment. In https://phab.mercurial-scm.org/D2282#37751, @dlax wrote: > Having both a `util` module and a `utils` package looks weird. > Have you considered moving `util.py` into `util/__init__.py` and then adding new modules under `util` package? I have but I'm always very cautious when creating a new package with the name of an old module. .pyc/.pycache files may still be there both for Mercurial developers and for Mercurial users using their deb/rpm package. I may be wrong, but if we could avoid weird bugs, I would prefer put in the `utils` package. I could have also copy `util.py` as `utils/__init__.py` but then I would have to update basically all Mercurial Python source files. INLINE COMMENTS > martinvonz wrote in dateutil.py:14-19 > What else do you foresee moving into the util/ directory? Perhaps these? I'm thinking maybe: - All net related functions in netutil.py - All paths related functions in pathutil.py - All cache related functions in cacheutil.py REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2282 To: lothiraldan, #hg-reviewers Cc: dlax, martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2280: remotenames: port partway to python3
dlax added inline comments. INLINE COMMENTS > remotenames.py:30 > +import collections > +dictmixin = collections.MutableMapping > `collections.MutableMapping` exists on Python2 as well (from 2.6 apparently), can't we use it? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2280 To: durin42, #hg-reviewers Cc: dlax, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2282: util: extract all date-related utils in utils/dateutil module
dlax added a comment. Having both a `util` module and a `utils` package looks weird. Have you considered moving `util.py` into `util/__init__.py` and then adding new modules under `util` package? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2282 To: lothiraldan, #hg-reviewers Cc: dlax, martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel