Re: [PATCH V3] extdiff: add --per-file and --confirm options
On Sat, 19 Jan 2019 05:12:36 -0800, Ludovic Chabant wrote: > # HG changeset patch > # User Ludovic Chabant > # Date 1547180577 28800 > # Thu Jan 10 20:22:57 2019 -0800 > # Node ID 5686d56d5a2cebaa504383b270e359156352090f > # Parent ef0e2f7224358c32b0f62b13e83e89ba2399c8cf > extdiff: add --per-file and --confirm options > +def _checktool(ui, tool): > +if not procutil.gui(): > +needsgui = (ui.config('diff-tools', tool+'.gui') or > +ui.config('merge-tools', tool+'.gui')) > +if needsgui: > +ui.warn(_("tool %s requires a GUI\n") % tool) > +return False > +return True Can you split this to a separate patch? It'll need a bit more churn, and we wouldn't want to make it a blocker of the --per-file/--confirm feature. What I pointed out last time was that we shouldn't spawn non-GUI tools asynchronously. You can see the problem by the following command on Unix. $ hg --config extdiff.vimdiff= vimdiff -c. --per-file > def __call__(self, ui, repo, *pats, **opts): > +if not _checktool(ui, self._cmd): > +return 2 Nit: just raise error.Abort(). And perhaps, it's too late to compare ui.config value based on self._cmd here. If self._cmd is the key of [diff-tools] for example, we shouldn't look for [merge-tools]. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH RFC] lfs: clean up a variety of strings/bytes issues
On Sat, 26 Jan 2019 01:22:01 -0500, Matt Harbison wrote: On Sat, 26 Jan 2019 01:00:03 -0500, Matt Harbison wrote: On Fri, 25 Jan 2019 17:33:54 -0500, Augie Fackler wrote: # HG changeset patch # User Augie Fackler # Date 1548455589 18000 # Fri Jan 25 17:33:09 2019 -0500 # Node ID d59571aba933f16db8e58ec9b61365ea4db0e2fa # Parent ffdac0067a147f878ac45dc2c4b3b3e490865252 lfs: clean up a variety of strings/bytes issues Mostly these are around json encoding/decoding, which is a hassle for us. After this change there are fewer tracebacks in the lfs tests on Python 3, but I'm very confused by the remaining failures: it looks very much like destrepo.ui.setconfig() in mercurial.hg.clone() isn't working: I can see a repo object with a stable repr() (which includes the object's id) that appears to _lose_ the setconfig()ed paths.default by the time we get into the lfs blobstore setup. I don't think it is losing `paths.default`. There's a typo in the followup hacks patch, such that it is looking up 'path.default' (not plural). I adjusted that, and it prints the path fine in the prompt assertion. The blobstore is selected during reposetup(), and cached. A local copy is recreated in the exchange.push() and prefetch() wrappers, which is happening here. Therefore, the `if not store.has(oid)` in readfromstore() must be busted somehow. Looking more closely at the debug output, the prefetch request is asking to download an empty list of objects. You can see it if you add `--debug` to `hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone` around test-lfs-serve.t:236. Therefore prefetch is doing nothing, so then it wants to call out individually using the original blobstore as the filelogs are accessed. It seems like some wires got crossed with r'' vs not: diff --git a/hgext/lfs/wireprotolfsserver.py b/hgext/lfs/wireprotolfsserver.py --- a/hgext/lfs/wireprotolfsserver.py +++ b/hgext/lfs/wireprotolfsserver.py @@ -133,7 +133,7 @@ def _processbatchrequest(repo, req, res) lfsreq = json.loads(req.bodyfh.read()) # If no transfer handlers are explicitly requested, 'basic' is assumed. -if 'basic' not in lfsreq.get('transfers', ['basic']): +if r'basic' not in lfsreq.get(r'transfers', [r'basic']): _sethttperror(res, HTTP_BAD_REQUEST, b'Only the basic LFS transfer handler is supported') return True @@ -149,7 +149,7 @@ def _processbatchrequest(repo, req, res) localstore = repo.svfs.lfslocalblobstore -objects = [p for p in _batchresponseobjects(req, lfsreq.get('objects', []), +objects = [p for p in _batchresponseobjects(req, lfsreq.get(r'objects', []), operation, localstore)] rsp = { @@ -263,9 +263,9 @@ def _batchresponseobjects(req, objects, r'Accept': r'application/vnd.git-lfs' } -auth = req.headers.get(r'Authorization', r'') -if auth.startswith(r'Basic '): -hdr[r'Authorization'] = auth +auth = req.headers.get(b'Authorization', b'') +if auth.startswith(b'Basic '): +hdr[b'Authorization'] = auth return hdr That fails close to the same spot in test-lfs-serve.t#lfsremote-on, but seems to be trying to upload/download blobs now. The 500 reason is "TypeError: Object of type bytes is not JSON serializable" now, but it's way too late to debug any further. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5290: branchmap: rename partial -> bcache
This revision was automatically updated to reflect the committed changes. Closed by commit rHG3461814417f3: branchmap: rename partial - bcache (authored by mjpieters, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5290?vs=13329=13490 REVISION DETAIL https://phab.mercurial-scm.org/D5290 AFFECTED FILES mercurial/branchmap.py CHANGE DETAILS diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -48,9 +48,9 @@ filteredhash = None if len(cachekey) > 2: filteredhash = bin(cachekey[2]) -partial = branchcache(tipnode=last, tiprev=lrev, +bcache = branchcache(tipnode=last, tiprev=lrev, filteredhash=filteredhash) -if not partial.validfor(repo): +if not bcache.validfor(repo): # invalidate the cache raise ValueError(r'tip differs') cl = repo.changelog @@ -66,9 +66,9 @@ if not cl.hasnode(node): raise ValueError( r'node %s does not exist' % pycompat.sysstr(hex(node))) -partial.setdefault(label, []).append(node) +bcache.setdefault(label, []).append(node) if state == 'c': -partial._closednodes.add(node) +bcache._closednodes.add(node) except (IOError, OSError): return None @@ -80,13 +80,13 @@ msg += ' (%s)' % repo.filtername msg += ': %s\n' repo.ui.debug(msg % pycompat.bytestr(inst)) -partial = None +bcache = None finally: if f: f.close() -return partial +return bcache ### Nearest subset relation # Nearest subset of filter X is a filter Y so that: @@ -103,27 +103,27 @@ def updatecache(repo): cl = repo.changelog filtername = repo.filtername -partial = repo._branchcaches.get(filtername) +bcache = repo._branchcaches.get(filtername) revs = [] -if partial is None or not partial.validfor(repo): -partial = read(repo) -if partial is None: +if bcache is None or not bcache.validfor(repo): +bcache = read(repo) +if bcache is None: subsetname = subsettable.get(filtername) if subsetname is None: -partial = branchcache() +bcache = branchcache() else: subset = repo.filtered(subsetname) -partial = subset.branchmap().copy() +bcache = subset.branchmap().copy() extrarevs = subset.changelog.filteredrevs - cl.filteredrevs -revs.extend(r for r in extrarevs if r <= partial.tiprev) -revs.extend(cl.revs(start=partial.tiprev + 1)) +revs.extend(r for r in extrarevs if r <= bcache.tiprev) +revs.extend(cl.revs(start=bcache.tiprev + 1)) if revs: -partial.update(repo, revs) -partial.write(repo) +bcache.update(repo, revs) +bcache.write(repo) -assert partial.validfor(repo), filtername -repo._branchcaches[repo.filtername] = partial +assert bcache.validfor(repo), filtername +repo._branchcaches[repo.filtername] = bcache def replacecache(repo, bm): """Replace the branchmap cache for a repo with a branch mapping. To: mjpieters, #hg-reviewers, martinvonz Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5639: context: delete mistaken comment about return value of renamed()
This revision was automatically updated to reflect the committed changes. Closed by commit rHG9087513df412: context: delete mistaken comment about return value of renamed() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5639?vs=13335=13489 REVISION DETAIL https://phab.mercurial-scm.org/D5639 AFFECTED FILES mercurial/context.py CHANGE DETAILS diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2178,8 +2178,6 @@ """ def getfilectx(repo, memctx, path): fctx = ctx[path] -# this is weird but apparently we only keep track of one parent -# (why not only store that instead of a tuple?) copied = fctx.renamed() if copied: copied = copied[0] 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
D5596: copies: get working copy parents from wctx, not dirstate, to make in-mem work
This revision was automatically updated to reflect the committed changes. Closed by commit rHG75e753a26806: copies: get working copy parents from wctx, not dirstate, to make in-mem work (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5596?vs=13436=13488 REVISION DETAIL https://phab.mercurial-scm.org/D5596 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -45,11 +45,15 @@ # - quit when interesting revs is zero cl = repo.changelog +wdirparents = None a = ctxa.rev() b = ctxb.rev() if a is None: +wdirparents = (ctxa.p1(), ctxa.p2()) a = node.wdirrev if b is None: +assert not wdirparents +wdirparents = (ctxb.p1(), ctxb.p2()) b = node.wdirrev side = {a: -1, b: 1} @@ -61,7 +65,7 @@ while interesting: r = -heapq.heappop(visit) if r == node.wdirrev: -parents = [cl.rev(p) for p in repo.dirstate.parents()] +parents = [pctx.rev() for pctx in wdirparents] else: parents = cl.parentrevs(r) if parents[1] == node.nullrev: 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
D5595: copies: pass contexts into _findlimit()
This revision was automatically updated to reflect the committed changes. Closed by commit rHGdc50121126ae: copies: pass contexts into _findlimit() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5595?vs=13435=13487 REVISION DETAIL https://phab.mercurial-scm.org/D5595 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -24,7 +24,7 @@ stringutil, ) -def _findlimit(repo, a, b): +def _findlimit(repo, ctxa, ctxb): """ Find the last revision that needs to be checked to ensure that a full transitive closure for file copies can be properly calculated. @@ -45,6 +45,8 @@ # - quit when interesting revs is zero cl = repo.changelog +a = ctxa.rev() +b = ctxb.rev() if a is None: a = node.wdirrev if b is None: @@ -162,7 +164,7 @@ if debug: dbg('debug.copies:looking into rename from %s to %s\n' % (a, b)) -limit = _findlimit(repo, a.rev(), b.rev()) +limit = _findlimit(repo, a, b) if debug: dbg('debug.copies: search limit: %d\n' % limit) am = a.manifest() @@ -456,7 +458,7 @@ if graft: tca = _c1.ancestor(_c2) -limit = _findlimit(repo, c1.rev(), c2.rev()) +limit = _findlimit(repo, c1, c2) repo.ui.debug(" searching for copies back to rev %d\n" % limit) m1 = c1.manifest() 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
D5695: unshare: use context manager for locks
This revision was automatically updated to reflect the committed changes. Closed by commit rHGbc843e251134: unshare: use context manager for locks (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5695?vs=13464=13485 REVISION DETAIL https://phab.mercurial-scm.org/D5695 AFFECTED FILES mercurial/hg.py CHANGE DETAILS diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -282,25 +282,20 @@ called. """ -destlock = None -lock = repo.lock() -try: +with repo.lock(): # we use locks here because if we race with commit, we # can end up with extra data in the cloned revlogs that's # not pointed to by changesets, thus causing verify to # fail - destlock = copystore(ui, repo, repo.path) - -sharefile = repo.vfs.join('sharedpath') -util.rename(sharefile, sharefile + '.old') +with destlock or util.nullcontextmanager(): -repo.requirements.discard('shared') -repo.requirements.discard('relshared') -repo._writerequirements() -finally: -destlock and destlock.release() -lock and lock.release() +sharefile = repo.vfs.join('sharedpath') +util.rename(sharefile, sharefile + '.old') + +repo.requirements.discard('shared') +repo.requirements.discard('relshared') +repo._writerequirements() # Removing share changes some fundamental properties of the repo instance. # So we instantiate a new repo object and operate on it rather than 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
D5594: copies: consider nullrev a common ancestor
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb80af0707066: copies: consider nullrev a common ancestor (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5594?vs=13434=13486 REVISION DETAIL https://phab.mercurial-scm.org/D5594 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -31,7 +31,6 @@ Generally, this means finding the earliest revision number that's an ancestor of a or b but not both, except when a or b is a direct descendent of the other, in which case we can return the minimum revnum of a and b. -None if no such revision exists. """ # basic idea: @@ -55,18 +54,17 @@ visit = [-a, -b] heapq.heapify(visit) interesting = len(visit) -hascommonancestor = False limit = node.wdirrev while interesting: r = -heapq.heappop(visit) if r == node.wdirrev: parents = [cl.rev(p) for p in repo.dirstate.parents()] else: parents = cl.parentrevs(r) +if parents[1] == node.nullrev: +parents = parents[:1] for p in parents: -if p < 0: -continue if p not in side: # first time we see p; add it to visit side[p] = side[r] @@ -77,14 +75,10 @@ # p was interesting but now we know better side[p] = 0 interesting -= 1 -hascommonancestor = True if side[r]: limit = r # lowest rev visited interesting -= 1 -if not hascommonancestor: -return None - # Consider the following flow (see test-commit-amend.t under issue4405): # 1/ File 'a0' committed # 2/ File renamed from 'a0' to 'a1' in a new commit (call it 'a1') @@ -169,8 +163,6 @@ dbg('debug.copies:looking into rename from %s to %s\n' % (a, b)) limit = _findlimit(repo, a.rev(), b.rev()) -if limit is None: -limit = node.nullrev if debug: dbg('debug.copies: search limit: %d\n' % limit) am = a.manifest() @@ -465,9 +457,6 @@ tca = _c1.ancestor(_c2) limit = _findlimit(repo, c1.rev(), c2.rev()) -if limit is None: -# no common ancestor, no copies -return {}, {}, {}, {}, {} repo.ui.debug(" searching for copies back to rev %d\n" % limit) m1 = c1.manifest() To: martinvonz, #hg-reviewers Cc: lothiraldan, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5705: py3: new tests from the ratchet
This revision was automatically updated to reflect the committed changes. Closed by commit rHG91ec3d9a97f2: py3: new tests from the ratchet (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5705?vs=13483=13484 REVISION DETAIL https://phab.mercurial-scm.org/D5705 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 @@ -295,6 +295,7 @@ test-http-bundle1.t test-http-clone-r.t test-http-permissions.t +test-http-protocol.t test-http.t test-hybridencode.py test-i18n.t @@ -396,6 +397,7 @@ test-minifileset.py test-minirst.py test-missing-capability.t +test-mq-eol.t test-mq-git.t test-mq-guards.t test-mq-header-date.t @@ -708,17 +710,22 @@ test-walkrepo.py test-websub.t test-win32text.t +test-wireproto-caching.t test-wireproto-clientreactor.py test-wireproto-command-branchmap.t +test-wireproto-command-capabilities.t test-wireproto-command-changesetdata.t test-wireproto-command-filedata.t test-wireproto-command-filesdata.t test-wireproto-command-heads.t +test-wireproto-command-known.t test-wireproto-command-listkeys.t test-wireproto-command-lookup.t test-wireproto-command-manifestdata.t test-wireproto-command-pushkey.t test-wireproto-command-rawstorefiledata.t +test-wireproto-content-redirects.t +test-wireproto-exchangev2.t test-wireproto-framing.py test-wireproto-serverreactor.py test-wireproto.py 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
D5620: grep: don't look up copy info unless --follow is given
yuja added a comment. > diff --git a/mercurial/commands.py b/mercurial/commands.py > --- a/mercurial/commands.py > +++ b/mercurial/commands.py > @@ -2955,7 +2955,8 @@ def grep(ui, repo, pattern, *pats, **opt >copies.setdefault(rev, {})[fn] = copy >if fn in skip: >skip[copy] = True > -continue > +if fn in skip: > +continue >files.append(fn) Applied this, thanks. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5620 To: martinvonz, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5698: wireprotov2peer: rewrite character traversal to use slices
yuja added a comment. > + mercurial/wireprotov2peer.py:307: > + > self._ui.debug(_('received %r\n') % frame) > + don't mark debug messages for translation > + mercurial/wireprotov2peer.py:513: > + > return [True if raw[i:i+1] == b'1' else False for i in range(len(raw))] > + missing whitespace in expression Fixed these as I had to rebase the changesets. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5698 To: indygreg, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5698: wireprotov2peer: rewrite character traversal to use slices
> + mercurial/wireprotov2peer.py:307: > + > self._ui.debug(_('received %r\n') % frame) > + don't mark debug messages for translation > + mercurial/wireprotov2peer.py:513: > + > return [True if raw[i:i+1] == b'1' else False for i in > range(len(raw))] > + missing whitespace in expression Fixed these as I had to rebase the changesets. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5620: grep: don't look up copy info unless --follow is given
> diff --git a/mercurial/commands.py b/mercurial/commands.py > --- a/mercurial/commands.py > +++ b/mercurial/commands.py > @@ -2955,7 +2955,8 @@ def grep(ui, repo, pattern, *pats, **opt > copies.setdefault(rev, {})[fn] = copy > if fn in skip: > skip[copy] = True > -continue > +if fn in skip: > +continue > files.append(fn) Applied this, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5628: diffstat: make --git work properly on renames (issue6025)
navaneeth.suresh added a comment. > One nit: better to not use `.split()` since a filename may include whitespace. Nice catch! I will send a follow-up on this. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5628 To: navaneeth.suresh, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5620: grep: don't look up copy info unless --follow is given
martinvonz added a comment. In https://phab.mercurial-scm.org/D5620#83924, @yuja wrote: > > - if fn in skip: +copy = None +if follow: + try: +copied = flog.renamed(fnode) + except error.WdirUnsupported: +copied = ctx[fn].renamed() +copy = copied and copied[0] if copy: > > - skip[copy] = True > > - continue +copies.setdefault(rev, {})[fn] = copy + if fn in skip: +skip[copy] = True + continue files.append(fn) > > Did you intentionally move `if fn in skip: continue` under `if follow`? > The skip dict has wider scope. Oops, nope, that wasn't on purpose. Thanks for catching that! Feel free to amend the following to the queued commit if it looks good to you: diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2955,7 +2955,8 @@ def grep(ui, repo, pattern, *pats, **opt copies.setdefault(rev, {})[fn] = copy if fn in skip: skip[copy] = True -continue +if fn in skip: +continue files.append(fn) if fn not in matches[rev]: REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5620 To: martinvonz, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH RFC] lfs: clean up a variety of strings/bytes issues
On Sat, 26 Jan 2019 01:00:03 -0500, Matt Harbison wrote: On Fri, 25 Jan 2019 17:33:54 -0500, Augie Fackler wrote: # HG changeset patch # User Augie Fackler # Date 1548455589 18000 # Fri Jan 25 17:33:09 2019 -0500 # Node ID d59571aba933f16db8e58ec9b61365ea4db0e2fa # Parent ffdac0067a147f878ac45dc2c4b3b3e490865252 lfs: clean up a variety of strings/bytes issues Mostly these are around json encoding/decoding, which is a hassle for us. After this change there are fewer tracebacks in the lfs tests on Python 3, but I'm very confused by the remaining failures: it looks very much like destrepo.ui.setconfig() in mercurial.hg.clone() isn't working: I can see a repo object with a stable repr() (which includes the object's id) that appears to _lose_ the setconfig()ed paths.default by the time we get into the lfs blobstore setup. I don't think it is losing `paths.default`. There's a typo in the followup hacks patch, such that it is looking up 'path.default' (not plural). I adjusted that, and it prints the path fine in the prompt assertion. The blobstore is selected during reposetup(), and cached. A local copy is recreated in the exchange.push() and prefetch() wrappers, which is happening here. Therefore, the `if not store.has(oid)` in readfromstore() must be busted somehow. Looking more closely at the debug output, the prefetch request is asking to download an empty list of objects. You can see it if you add `--debug` to `hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone` around test-lfs-serve.t:236. Therefore prefetch is doing nothing, so then it wants to call out individually using the original blobstore as the filelogs are accessed. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH RFC] lfs: clean up a variety of strings/bytes issues
On Fri, 25 Jan 2019 17:33:54 -0500, Augie Fackler wrote: # HG changeset patch # User Augie Fackler # Date 1548455589 18000 # Fri Jan 25 17:33:09 2019 -0500 # Node ID d59571aba933f16db8e58ec9b61365ea4db0e2fa # Parent ffdac0067a147f878ac45dc2c4b3b3e490865252 lfs: clean up a variety of strings/bytes issues Mostly these are around json encoding/decoding, which is a hassle for us. After this change there are fewer tracebacks in the lfs tests on Python 3, but I'm very confused by the remaining failures: it looks very much like destrepo.ui.setconfig() in mercurial.hg.clone() isn't working: I can see a repo object with a stable repr() (which includes the object's id) that appears to _lose_ the setconfig()ed paths.default by the time we get into the lfs blobstore setup. I don't think it is losing `paths.default`. There's a typo in the followup hacks patch, such that it is looking up 'path.default' (not plural). I adjusted that, and it prints the path fine in the prompt assertion. The blobstore is selected during reposetup(), and cached. A local copy is recreated in the exchange.push() and prefetch() wrappers, which is happening here. Therefore, the `if not store.has(oid)` in readfromstore() must be busted somehow. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 3 follow-up] test-revset: check that #generations[1:-1] doesn't result in any errors
On Sat, 26 Jan 2019 12:58:19 +0800, Anton Shestakov wrote: > # HG changeset patch > # User Anton Shestakov > # Date 1548476405 -28800 > # Sat Jan 26 12:20:05 2019 +0800 > # Node ID b57f637ff71ae812fe78722666fec025cbf8b75e > # Parent 431cf2c8c83969a68d132d6ba92af1998e147927 > test-revset: check that #generations[1:-1] doesn't result in any errors Queued the series, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5628: diffstat: make --git work properly on renames (issue6025)
yuja added a comment. > @@ -2808,6 +2808,10 @@ > > elif (line.startswith('GIT binary patch') or > line.startswith('Binary file')): > isbinary = True > > +elif line.startswith('rename from'): > +filename = line.split()[-1] > +elif line.startswith('rename to'): > +filename += ' => %s' % line.split()[-1] Nice. One nit: better to not use `.split()` since a filename may include whitespace. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5628 To: navaneeth.suresh, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5628: diffstat: make --git work properly on renames (issue6025)
> @@ -2808,6 +2808,10 @@ > elif (line.startswith('GIT binary patch') or >line.startswith('Binary file')): > isbinary = True > +elif line.startswith('rename from'): > +filename = line.split()[-1] > +elif line.startswith('rename to'): > +filename += ' => %s' % line.split()[-1] Nice. One nit: better to not use `.split()` since a filename may include whitespace. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@41366: 7 new changesets
7 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/784ab13b340f changeset: 41360:784ab13b340f user:Martin von Zweigbergk date:Thu Jan 17 22:07:58 2019 -0800 summary: remotefilelog: remove pointless return statement from constructor https://www.mercurial-scm.org/repo/hg/rev/092c5d05ba01 changeset: 41361:092c5d05ba01 user:Martin von Zweigbergk date:Wed Jan 16 17:46:39 2019 -0800 summary: commit: print "commit message saved in" message also if bookmark update fails https://www.mercurial-scm.org/repo/hg/rev/57c462db87fd changeset: 41362:57c462db87fd user:Martin von Zweigbergk date:Wed Jan 16 17:33:47 2019 -0800 summary: localrepo: use context manager for transaction in commit() https://www.mercurial-scm.org/repo/hg/rev/b87a009d1b3b changeset: 41363:b87a009d1b3b user:Martin von Zweigbergk date:Wed Jan 16 17:34:59 2019 -0800 summary: localrepo: use context manager for locks in commit() https://www.mercurial-scm.org/repo/hg/rev/0132221c25cd changeset: 41364:0132221c25cd user:Martin von Zweigbergk date:Mon Sep 24 14:46:37 2018 -0700 summary: localrepo: use context manager for lock and transaction in commitctx() https://www.mercurial-scm.org/repo/hg/rev/876494fd967d changeset: 41365:876494fd967d user:Martin von Zweigbergk date:Thu Jan 17 09:17:12 2019 -0800 summary: cleanup: delete lots of unused local variables https://www.mercurial-scm.org/repo/hg/rev/fabb0224a599 changeset: 41366:fabb0224a599 bookmark:@ tag: tip user:Martin von Zweigbergk date:Thu Jan 17 09:24:30 2019 -0800 summary: hghave: let OSError with ENOENT through like any other -- 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
Re: [PATCH V7] revset: support ranges in #generations relation
On Fri, 25 Jan 2019 21:50:19 +0900 Yuya Nishihara wrote: > Can you send a follow up? Done. It's a series of 3 patches, and the third one can be skipped if you think it's unnecessary. I'm fine with collapsing the series too. Thanks! ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5620: grep: don't look up copy info unless --follow is given
> -if fn in skip: > +copy = None > +if follow: > +try: > +copied = flog.renamed(fnode) > +except error.WdirUnsupported: > +copied = ctx[fn].renamed() > +copy = copied and copied[0] > if copy: > -skip[copy] = True > -continue > +copies.setdefault(rev, {})[fn] = copy > +if fn in skip: > +skip[copy] = True > +continue > files.append(fn) Did you intentionally move `if fn in skip: continue` under `if follow`? The skip dict has wider scope. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5620: grep: don't look up copy info unless --follow is given
yuja added a comment. > - if fn in skip: +copy = None +if follow: + try: +copied = flog.renamed(fnode) + except error.WdirUnsupported: +copied = ctx[fn].renamed() + copy = copied and copied[0] if copy: > - skip[copy] = True > - continue +copies.setdefault(rev, {})[fn] = copy + if fn in skip: +skip[copy] = True + continue files.append(fn) Did you intentionally move `if fn in skip: continue` under `if follow`? The skip dict has wider scope. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5620 To: martinvonz, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 3 follow-up] revset: move dagop.maxlogdepth usage to generationsrel()
# HG changeset patch # User Anton Shestakov # Date 1548476480 -28800 # Sat Jan 26 12:21:20 2019 +0800 # Node ID 88aef4c81971a828462c22f24e18246116c6715b # Parent b57f637ff71ae812fe78722666fec025cbf8b75e revset: move dagop.maxlogdepth usage to generationsrel() Not all subscript operations would want (maxlogdepth - 1) in place of None. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -258,6 +258,11 @@ def _splitrange(a, b): def generationsrel(repo, subset, x, rel, a, b, order): # TODO: rewrite tests, and drop startdepth argument from ancestors() and # descendants() predicates +if a is None: +a = -(dagop.maxlogdepth - 1) +if b is None: +b = +(dagop.maxlogdepth - 1) + (ancstart, ancstop), (descstart, descstop) = _splitrange(a, b) if ancstart is None and descstart is None: @@ -294,10 +299,6 @@ def relsubscriptset(repo, subset, x, y, msg = _("relation subscript bounds must be integers") return getinteger(i, msg) a, b = [getbound(i) for i in (a, b)] -if a is None: -a = -(dagop.maxlogdepth - 1) -if b is None: -b = +(dagop.maxlogdepth - 1) if rel in subscriptrelations: return subscriptrelations[rel](repo, subset, x, rel, a, b, order) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 3 of 3 follow-up] dagop: check if stopdepth is greater than or equal to maxlogdepth
# HG changeset patch # User Anton Shestakov # Date 1548476644 -28800 # Sat Jan 26 12:24:04 2019 +0800 # Node ID 60b30874fef7ed43891e667119035ccc3250 # Parent 88aef4c81971a828462c22f24e18246116c6715b dagop: check if stopdepth is greater than or equal to maxlogdepth Might prevent off-by-one errors. diff --git a/mercurial/dagop.py b/mercurial/dagop.py --- a/mercurial/dagop.py +++ b/mercurial/dagop.py @@ -221,7 +221,7 @@ def revdescendants(repo, revs, followfir Scan ends at the stopdepth (exlusive) if specified. Revisions found earlier than the startdepth are omitted. """ -if startdepth is None and (stopdepth is None or stopdepth == maxlogdepth): +if startdepth is None and (stopdepth is None or stopdepth >= maxlogdepth): gen = _genrevdescendants(repo, revs, followfirst) else: gen = _genrevdescendantsofdepth(repo, revs, followfirst, ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 3 follow-up] test-revset: check that #generations[1:-1] doesn't result in any errors
# HG changeset patch # User Anton Shestakov # Date 1548476405 -28800 # Sat Jan 26 12:20:05 2019 +0800 # Node ID b57f637ff71ae812fe78722666fec025cbf8b75e # Parent 431cf2c8c83969a68d132d6ba92af1998e147927 test-revset: check that #generations[1:-1] doesn't result in any errors diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -1300,6 +1300,7 @@ test ancestors/descendants relation subs 5 6 7 + $ log 'tip#generations[1:-1]' $ hg debugrevspec -p parsed 'roots(:)#g[2]' * parsed: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5698: wireprotov2peer: rewrite character traversal to use slices
yuja added a comment. + mercurial/wireprotov2peer.py:307: + > self._ui.debug(_('received %r\n') % frame) + don't mark debug messages for translation + mercurial/wireprotov2peer.py:513: + > return [True if raw[i:i+1] == b'1' else False for i in range(len(raw))] + missing whitespace in expression REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5698 To: indygreg, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5698: wireprotov2peer: rewrite character traversal to use slices
+ mercurial/wireprotov2peer.py:307: + > self._ui.debug(_('received %r\n') % frame) + don't mark debug messages for translation + mercurial/wireprotov2peer.py:513: + > return [True if raw[i:i+1] == b'1' else False for i in range(len(raw))] + missing whitespace in expression ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] py3: fix a bytes/str mingling in test-install.t
On Fri, 25 Jan 2019 22:45:01 -0500, Matt Harbison wrote: > # HG changeset patch > # User Matt Harbison > # Date 1548473565 18000 > # Fri Jan 25 22:32:45 2019 -0500 > # Node ID 8b3b641e51f786a056c7478f45560e67356bb35b > # Parent ffdac0067a147f878ac45dc2c4b3b3e490865252 > py3: fix a bytes/str mingling in test-install.t Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] tests: conditionalize Windows difference in test-dispatch.t
On Fri, 25 Jan 2019 21:21:01 -0500, Matt Harbison wrote: > # HG changeset patch > # User Matt Harbison > # Date 1548469191 18000 > # Fri Jan 25 21:19:51 2019 -0500 > # Node ID c5f97f739ec669749ea0c3bd1e17ac7facc51706 > # Parent d59571aba933f16db8e58ec9b61365ea4db0e2fa > tests: conditionalize Windows difference in test-dispatch.t Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] py3: fix a bytes/str mingling in test-install.t
# HG changeset patch # User Matt Harbison # Date 1548473565 18000 # Fri Jan 25 22:32:45 2019 -0500 # Node ID 8b3b641e51f786a056c7478f45560e67356bb35b # Parent ffdac0067a147f878ac45dc2c4b3b3e490865252 py3: fix a bytes/str mingling in test-install.t diff --git a/tests/test-install.t b/tests/test-install.t --- a/tests/test-install.t +++ b/tests/test-install.t @@ -188,10 +188,9 @@ not found (this is intentionally using b > stderr=subprocess.PIPE) > output = proc.communicate()[0] > - > slash = '/' > for line in output.splitlines(): > if os.name == 'nt': - > yield line.replace(os.sep, slash) + > yield line.replace(pycompat.sysbytes(os.sep), b'/') > else: > yield line > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5628: diffstat: make --git work properly on renames (issue6025)
navaneeth.suresh added a comment. Thanks for queuing this! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5628 To: navaneeth.suresh, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] tests: conditionalize Windows difference in test-dispatch.t
# HG changeset patch # User Matt Harbison # Date 1548469191 18000 # Fri Jan 25 21:19:51 2019 -0500 # Node ID c5f97f739ec669749ea0c3bd1e17ac7facc51706 # Parent d59571aba933f16db8e58ec9b61365ea4db0e2fa tests: conditionalize Windows difference in test-dispatch.t The output matches the comment added 6 years ago in ef60083b5536, so I'm assuming that difference was the reason for the over-globbing removed in 93a7539a546e. There's still a bit of py3 instability here, but I assume those are just more Windows issues: @@ -95,7 +95,7 @@ [255] $ hg log -b --cwd=inexistent default - abort: $ENOENT$: 'inexistent' + abort: $ENOENT$: inexistent [255] $ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback' @@ -189,7 +189,7 @@ $ hg -R a archive '' abort: $ENOENT$: '' (no-windows !) - abort: $ENOTDIR$: '' (windows !) + abort: $ENOTDIR$ [255] #if no-outer-repo diff --git a/tests/test-dispatch.t b/tests/test-dispatch.t --- a/tests/test-dispatch.t +++ b/tests/test-dispatch.t @@ -188,7 +188,8 @@ OSError "No such file or directory" / "T specified" should include filename even when it is empty $ hg -R a archive '' - abort: $ENOENT$: '' + abort: $ENOENT$: '' (no-windows !) + abort: $ENOTDIR$: '' (windows !) [255] #if no-outer-repo ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5705: py3: new tests from the ratchet
durin42 created this revision. Herald added a reviewer: pulkit. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Thanks to indygreg for doing the work on these! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5705 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 @@ -295,6 +295,7 @@ test-http-bundle1.t test-http-clone-r.t test-http-permissions.t +test-http-protocol.t test-http.t test-hybridencode.py test-i18n.t @@ -396,6 +397,7 @@ test-minifileset.py test-minirst.py test-missing-capability.t +test-mq-eol.t test-mq-git.t test-mq-guards.t test-mq-header-date.t @@ -708,17 +710,22 @@ test-walkrepo.py test-websub.t test-win32text.t +test-wireproto-caching.t test-wireproto-clientreactor.py test-wireproto-command-branchmap.t +test-wireproto-command-capabilities.t test-wireproto-command-changesetdata.t test-wireproto-command-filedata.t test-wireproto-command-filesdata.t test-wireproto-command-heads.t +test-wireproto-command-known.t test-wireproto-command-listkeys.t test-wireproto-command-lookup.t test-wireproto-command-manifestdata.t test-wireproto-command-pushkey.t test-wireproto-command-rawstorefiledata.t +test-wireproto-content-redirects.t +test-wireproto-exchangev2.t test-wireproto-framing.py test-wireproto-serverreactor.py test-wireproto.py 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
D5702: commands: check for modheads being None
This revision was automatically updated to reflect the committed changes. Closed by commit rHGe6451db43b35: commands: check for modheads being None (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5702?vs=13471=13480 REVISION DETAIL https://phab.mercurial-scm.org/D5702 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 @@ -4361,7 +4361,7 @@ msg = _("not updating: %s") % stringutil.forcebytestr(inst) hint = inst.hint raise error.UpdateAbort(msg, hint=hint) -if modheads > 1: +if modheads is not None and modheads > 1: currentbranchheads = len(repo.branchheads()) if currentbranchheads == modheads: ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n")) To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5704: util: cast memoryview to bytes
This revision was automatically updated to reflect the committed changes. Closed by commit rHG435e8884fc2f: util: cast memoryview to bytes (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5704?vs=13473=13482 REVISION DETAIL https://phab.mercurial-scm.org/D5704 AFFECTED FILES mercurial/util.py CHANGE DETAILS diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -789,6 +789,12 @@ res)) data = dest[0:res] if res is not None else b'' + +# _writedata() uses "in" operator and is confused by memoryview because +# characters are ints on Python 3. +if isinstance(data, memoryview): +data = data.tobytes() + self._writedata(data) def write(self, res, data): To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5700: wireprotov2peer: make "received frame(...)" messages debug level
This revision was automatically updated to reflect the committed changes. Closed by commit rHG62be6a147185: wireprotov2peer: make received frame(...) messages debug level (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5700?vs=13469=13478 REVISION DETAIL https://phab.mercurial-scm.org/D5700 AFFECTED FILES mercurial/wireprotov2peer.py tests/test-http-api-httpv2.t tests/test-http-protocol.t tests/test-wireproto-command-capabilities.t tests/test-wireproto-content-redirects.t CHANGE DETAILS diff --git a/tests/test-wireproto-content-redirects.t b/tests/test-wireproto-content-redirects.t --- a/tests/test-wireproto-content-redirects.t +++ b/tests/test-wireproto-content-redirects.t @@ -95,23 +95,19 @@ s> \t\x00\x00\x01\x00\x02\x01\x92 s> Hidentity s> \r\n - received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos) s> 13\r\n s> \x0b\x00\x00\x01\x00\x02\x041 s> \xa1FstatusBok s> \r\n - received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation) s> 6de\r\n s> \xd6\x06\x00\x01\x00\x02\x041 s> \xa5Hcommands\xacIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa2Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84IbookmarksGparentsEphaseHrevisionIrevisions\xa2Hrequired\xf5DtypeDlistKpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x83HlinknodeGparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDpath\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullIfilesdata\xa3Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84NfirstchangesetHlinknodeGparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolJpathfilter\xa3Gdefault\xf6Hrequired\xf4DtypeDdictIrevisions\xa2Hrequired\xf5DtypeDlistKpermissions\x81DpullTrecommendedbatchsize\x19\xc3PEheads\xa2Dargs\xa1Jpubliconly\xa3Gdefault\xf4Hrequired\xf4DtypeDboolKpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\xa3Gdefault\x80Hrequired\xf4DtypeDlistKpermissions\x81DpullHlistkeys\xa2Dargs\xa1Inamespace\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullFlookup\xa2Dargs\xa1Ckey\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullLmanifestdata\xa3Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDtree\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullTrecommendedbatchsize\x1a\x00\x01\x86\xa0Gpushkey\xa2Dargs\xa4Ckey\xa2Hrequired\xf5DtypeEbytesInamespace\xa2Hrequired\xf5DtypeEbytesCnew\xa2Hrequired\xf5DtypeEbytesCold\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpushPrawstorefiledata\xa2Dargs\xa2Efiles\xa2Hrequired\xf5DtypeDlistJpathfilter\xa3Gdefault\xf6Hrequired\xf4DtypeDlistKpermissions\x81DpullQframingmediatypes\x81X/mercurial-exp-framing-0006Rpathfilterprefixes\xd9\x01\x02\x82Epath:Lrootfilesin:Nrawrepoformats\x83LgeneraldeltaHrevlogv1LsparserevlogHredirect\xa2Fhashes\x82Fsha256Dsha1Gtargets\x81\xa5DnameHtarget-aHprotocolDhttpKsnirequired\xf4Ktlsversions\x82C1.2C1.3Duris\x81Shttp://example.com/ s> \r\n - received frame(size=1750; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation) s> 8\r\n s> \x00\x00\x00\x01\x00\x02\x002 s> \r\n s> 0\r\n s> \r\n - received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos) response: gen[ { b'commands': { @@ -427,23 +423,19 @@ s> \t\x00\x00\x01\x00\x02\x01\x92 s> Hidentity s> \r\n - received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos) s> 13\r\n s> \x0b\x00\x00\x01\x00\x02\x041 s> \xa1FstatusBok s> \r\n - received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation) s> 6f9\r\n s> \xf1\x06\x00\x01\x00\x02\x041 s>
D5699: tests: add optional setsockopt() output on Python 3
This revision was automatically updated to reflect the committed changes. Closed by commit rHG93ad183a2323: tests: add optional setsockopt() output on Python 3 (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5699?vs=13468=13476 REVISION DETAIL https://phab.mercurial-scm.org/D5699 AFFECTED FILES tests/test-http-protocol.t tests/test-wireproto-command-capabilities.t tests/test-wireproto-content-redirects.t CHANGE DETAILS diff --git a/tests/test-wireproto-content-redirects.t b/tests/test-wireproto-content-redirects.t --- a/tests/test-wireproto-content-redirects.t +++ b/tests/test-wireproto-content-redirects.t @@ -51,6 +51,7 @@ > command capabilities > EOF creating http peer for wire protocol version 2 + s> setsockopt(6, 1, 1) -> None (py3 !) s> GET /?cmd=capabilities HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> vary: X-HgProto-1,X-HgUpgrade-1\r\n @@ -71,6 +72,7 @@ (remote redirect target target-a is compatible) (tls1.2 !) (remote redirect target target-a requires unsupported TLS versions: 1.2, 1.3) (no-tls1.2 !) sending capabilities command + s> setsockopt(6, 1, 1) -> None (py3 !) s> POST /api/exp-http-v2-0003/ro/capabilities HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> accept: application/mercurial-exp-framing-0006\r\n @@ -383,6 +385,7 @@ > command capabilities > EOF creating http peer for wire protocol version 2 + s> setsockopt(6, 1, 1) -> None (py3 !) s> GET /?cmd=capabilities HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> vary: X-HgProto-1,X-HgUpgrade-1\r\n @@ -403,6 +406,7 @@ (remote redirect target target-a is compatible) (remote redirect target target-b uses unsupported protocol: unknown) sending capabilities command + s> setsockopt(6, 1, 1) -> None (py3 !) s> POST /api/exp-http-v2-0003/ro/capabilities HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> accept: application/mercurial-exp-framing-0006\r\n @@ -720,6 +724,7 @@ > command capabilities > EOF creating http peer for wire protocol version 2 + s> setsockopt(6, 1, 1) -> None (py3 !) s> GET /?cmd=capabilities HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> vary: X-HgProto-1,X-HgUpgrade-1\r\n @@ -739,6 +744,7 @@ s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0003\xa5Hcommands\xacIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa2Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84IbookmarksGparentsEphaseHrevisionIrevisions\xa2Hrequired\xf5DtypeDlistKpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x83HlinknodeGparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDpath\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullIfilesdata\xa3Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84NfirstchangesetHlinknodeGparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolJpathfilter\xa3Gdefault\xf6Hrequired\xf4DtypeDdictIrevisions\xa2Hrequired\xf5DtypeDlistKpermissions\x81DpullTrecommendedbatchsize\x19\xc3PEheads\xa2Dargs\xa1Jpubliconly\xa3Gdefault\xf4Hrequired\xf4DtypeDboolKpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\xa3Gdefault\x80Hrequired\xf4DtypeDlistKpermissions\x81DpullHlistkeys\xa2Dargs\xa1Inamespace\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullFlookup\xa2Dargs\xa1Ckey\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullLmanifestdata\xa3Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDtree\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullTrecommendedbatchsize\x1a\x00\x01\x86\xa0Gpushkey\xa2Dargs\xa4Ckey\xa2Hrequired\xf5DtypeEbytesInamespace\xa2Hrequired\xf5DtypeEbytesCnew\xa2Hrequired\xf5DtypeEbytesCold\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpushPrawstorefiledata\xa2Dargs\xa2Efiles\xa2Hrequired\xf5DtypeDlistJpathfilter\xa3Gdefault\xf6Hrequired\xf4DtypeDlistKpermissions\x81DpullQframingmediatypes\x81X/mercurial-exp-framing-0006Rpathfilterprefixes\xd9\x01\x02\x82Epath:Lrootfilesin:Nrawrepoformats\x83LgeneraldeltaHrevlogv1LsparserevlogHredirect\xa2Fhashes\x82Fsha256Dsha1Gtargets\x81\xa4DnameNtarget-bad-tlsHprotocolEhttpsKsnirequired\xf5Duris\x81Thttps://example.com/Nv1capabilitiesY\x01\xe0batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (redirect target target-bad-tls requires SNI, which is unsupported) sending capabilities command + s> setsockopt(6, 1, 1) -> None
D5703: tests: add b'' prefixes to ui.configbool() call
This revision was automatically updated to reflect the committed changes. Closed by commit rHG414dbed467f6: tests: add b prefixes to ui.configbool() call (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5703?vs=13472=13481 REVISION DETAIL https://phab.mercurial-scm.org/D5703 AFFECTED FILES tests/test-http-protocol.t CHANGE DETAILS diff --git a/tests/test-http-protocol.t b/tests/test-http-protocol.t --- a/tests/test-http-protocol.t +++ b/tests/test-http-protocol.t @@ -389,7 +389,7 @@ > relpath = path[len(b'/redirector'):] > res.status = b'301 Redirect' > newurl = b'%s/redirected%s' % (req.baseurl, relpath) - > if not repo.ui.configbool('testing', 'redirectqs', True) and b'?' in newurl: + > if not repo.ui.configbool(b'testing', b'redirectqs', True) and b'?' in newurl: > newurl = newurl[0:newurl.index(b'?')] > res.headers[b'Location'] = newurl > res.headers[b'Content-Type'] = b'text/plain' To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5701: tests: add b'' when testing for tls1.2
This revision was automatically updated to reflect the committed changes. Closed by commit rHGd33419330c79: tests: add b when testing for tls1.2 (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5701?vs=13470=13479 REVISION DETAIL https://phab.mercurial-scm.org/D5701 AFFECTED FILES tests/hghave.py CHANGE DETAILS diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -543,7 +543,7 @@ @check("tls1.2", "TLS 1.2 protocol support") def has_tls1_2(): from mercurial import sslutil -return 'tls1.2' in sslutil.supportedprotocols +return b'tls1.2' in sslutil.supportedprotocols @check("windows", "Windows") def has_windows(): To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5698: wireprotov2peer: rewrite character traversal to use slices
This revision was automatically updated to reflect the committed changes. Closed by commit rHGe269ae40b551: wireprotov2peer: rewrite character traversal to use slices (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5698?vs=13467=13477 REVISION DETAIL https://phab.mercurial-scm.org/D5698 AFFECTED FILES mercurial/wireprotov2peer.py CHANGE DETAILS diff --git a/mercurial/wireprotov2peer.py b/mercurial/wireprotov2peer.py --- a/mercurial/wireprotov2peer.py +++ b/mercurial/wireprotov2peer.py @@ -510,7 +510,7 @@ # Bytestring where each byte is a 0 or 1. raw = next(objs) -return [True if c == '1' else False for c in raw] +return [True if raw[i:i+1] == b'1' else False for i in range(len(raw))] def decodelistkeys(objs): # Map with bytestring keys and values. To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5697: wireprotov2server: don't attempt to cast command name
This revision was automatically updated to reflect the committed changes. Closed by commit rHGc780c9c7118c: wireprotov2server: dont attempt to cast command name (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5697?vs=13466=13475 REVISION DETAIL https://phab.mercurial-scm.org/D5697 AFFECTED FILES mercurial/wireprotov2server.py CHANGE DETAILS diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py --- a/mercurial/wireprotov2server.py +++ b/mercurial/wireprotov2server.py @@ -745,7 +745,7 @@ # More granular cache key invalidation. b'localversion': localversion, # Cache keys are segmented by command. -b'command': pycompat.sysbytes(command), +b'command': command, # Throw in the media type and API version strings so changes # to exchange semantics invalid cache. b'mediatype': FRAMINGTYPE, To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5696: wireprotov2server: use pycompat.strkwargs when calling cachekeyfn
This revision was automatically updated to reflect the committed changes. Closed by commit rHG0823cc2c598f: wireprotov2server: use pycompat.strkwargs when calling cachekeyfn (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5696?vs=13465=13474 REVISION DETAIL https://phab.mercurial-scm.org/D5696 AFFECTED FILES mercurial/wireprotov2server.py CHANGE DETAILS diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py --- a/mercurial/wireprotov2server.py +++ b/mercurial/wireprotov2server.py @@ -390,7 +390,8 @@ return with cacher: -cachekey = entry.cachekeyfn(repo, proto, cacher, **args) +cachekey = entry.cachekeyfn(repo, proto, cacher, +**pycompat.strkwargs(args)) # No cache key or the cacher doesn't like it. Do default handling. if cachekey is None or not cacher.setcachekey(cachekey): To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5702: commands: check for modheads being None
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Python 2 allows the > operator to be used with a None and an int. Python 3 does not. So we need to ensure the value isn't None before comparing with >. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5702 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 @@ -4361,7 +4361,7 @@ msg = _("not updating: %s") % stringutil.forcebytestr(inst) hint = inst.hint raise error.UpdateAbort(msg, hint=hint) -if modheads > 1: +if modheads is not None and modheads > 1: currentbranchheads = len(repo.branchheads()) if currentbranchheads == modheads: ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n")) To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5704: util: cast memoryview to bytes
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Python 3 uses readinto() instead of read() in places. And taking a slice of the buffer passed to readinto() will produce a memoryview. _writedata() then gets confused when testing for `b'\n' in data` because memoryview is an iterable over ints instead of 1 character bytes. We work around by casting a memoryview to bytes. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5704 AFFECTED FILES mercurial/util.py CHANGE DETAILS diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -789,6 +789,12 @@ res)) data = dest[0:res] if res is not None else b'' + +# _writedata() uses "in" operator and is confused by memoryview because +# characters are ints on Python 3. +if isinstance(data, memoryview): +data = data.tobytes() + self._writedata(data) def write(self, res, data): To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5700: wireprotov2peer: make "received frame(...)" messages debug level
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We don't need to show these during --verbose, it's more of a debugging thing. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5700 AFFECTED FILES mercurial/wireprotov2peer.py tests/test-http-api-httpv2.t tests/test-http-protocol.t tests/test-wireproto-command-capabilities.t tests/test-wireproto-content-redirects.t CHANGE DETAILS diff --git a/tests/test-wireproto-content-redirects.t b/tests/test-wireproto-content-redirects.t --- a/tests/test-wireproto-content-redirects.t +++ b/tests/test-wireproto-content-redirects.t @@ -95,23 +95,19 @@ s> \t\x00\x00\x01\x00\x02\x01\x92 s> Hidentity s> \r\n - received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos) s> 13\r\n s> \x0b\x00\x00\x01\x00\x02\x041 s> \xa1FstatusBok s> \r\n - received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation) s> 6de\r\n s> \xd6\x06\x00\x01\x00\x02\x041 s> \xa5Hcommands\xacIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa2Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84IbookmarksGparentsEphaseHrevisionIrevisions\xa2Hrequired\xf5DtypeDlistKpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x83HlinknodeGparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDpath\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullIfilesdata\xa3Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84NfirstchangesetHlinknodeGparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolJpathfilter\xa3Gdefault\xf6Hrequired\xf4DtypeDdictIrevisions\xa2Hrequired\xf5DtypeDlistKpermissions\x81DpullTrecommendedbatchsize\x19\xc3PEheads\xa2Dargs\xa1Jpubliconly\xa3Gdefault\xf4Hrequired\xf4DtypeDboolKpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\xa3Gdefault\x80Hrequired\xf4DtypeDlistKpermissions\x81DpullHlistkeys\xa2Dargs\xa1Inamespace\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullFlookup\xa2Dargs\xa1Ckey\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullLmanifestdata\xa3Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDtree\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullTrecommendedbatchsize\x1a\x00\x01\x86\xa0Gpushkey\xa2Dargs\xa4Ckey\xa2Hrequired\xf5DtypeEbytesInamespace\xa2Hrequired\xf5DtypeEbytesCnew\xa2Hrequired\xf5DtypeEbytesCold\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpushPrawstorefiledata\xa2Dargs\xa2Efiles\xa2Hrequired\xf5DtypeDlistJpathfilter\xa3Gdefault\xf6Hrequired\xf4DtypeDlistKpermissions\x81DpullQframingmediatypes\x81X/mercurial-exp-framing-0006Rpathfilterprefixes\xd9\x01\x02\x82Epath:Lrootfilesin:Nrawrepoformats\x83LgeneraldeltaHrevlogv1LsparserevlogHredirect\xa2Fhashes\x82Fsha256Dsha1Gtargets\x81\xa5DnameHtarget-aHprotocolDhttpKsnirequired\xf4Ktlsversions\x82C1.2C1.3Duris\x81Shttp://example.com/ s> \r\n - received frame(size=1750; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation) s> 8\r\n s> \x00\x00\x00\x01\x00\x02\x002 s> \r\n s> 0\r\n s> \r\n - received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos) response: gen[ { b'commands': { @@ -427,23 +423,19 @@ s> \t\x00\x00\x01\x00\x02\x01\x92 s> Hidentity s> \r\n - received frame(size=9; request=1; stream=2; streamflags=stream-begin; type=stream-settings; flags=eos) s> 13\r\n s> \x0b\x00\x00\x01\x00\x02\x041 s> \xa1FstatusBok s> \r\n - received frame(size=11; request=1; stream=2; streamflags=encoded; type=command-response; flags=continuation) s> 6f9\r\n s> \xf1\x06\x00\x01\x00\x02\x041 s>
D5699: tests: add optional setsockopt() output on Python 3
indygreg created this revision. Herald added subscribers: mercurial-devel, mjpieters. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Tests still don't pass. But this gets us a little closer. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5699 AFFECTED FILES tests/test-http-protocol.t tests/test-wireproto-command-capabilities.t tests/test-wireproto-content-redirects.t CHANGE DETAILS diff --git a/tests/test-wireproto-content-redirects.t b/tests/test-wireproto-content-redirects.t --- a/tests/test-wireproto-content-redirects.t +++ b/tests/test-wireproto-content-redirects.t @@ -51,6 +51,7 @@ > command capabilities > EOF creating http peer for wire protocol version 2 + s> setsockopt(6, 1, 1) -> None (py3 !) s> GET /?cmd=capabilities HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> vary: X-HgProto-1,X-HgUpgrade-1\r\n @@ -71,6 +72,7 @@ (remote redirect target target-a is compatible) (tls1.2 !) (remote redirect target target-a requires unsupported TLS versions: 1.2, 1.3) (no-tls1.2 !) sending capabilities command + s> setsockopt(6, 1, 1) -> None (py3 !) s> POST /api/exp-http-v2-0003/ro/capabilities HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> accept: application/mercurial-exp-framing-0006\r\n @@ -383,6 +385,7 @@ > command capabilities > EOF creating http peer for wire protocol version 2 + s> setsockopt(6, 1, 1) -> None (py3 !) s> GET /?cmd=capabilities HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> vary: X-HgProto-1,X-HgUpgrade-1\r\n @@ -403,6 +406,7 @@ (remote redirect target target-a is compatible) (remote redirect target target-b uses unsupported protocol: unknown) sending capabilities command + s> setsockopt(6, 1, 1) -> None (py3 !) s> POST /api/exp-http-v2-0003/ro/capabilities HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> accept: application/mercurial-exp-framing-0006\r\n @@ -720,6 +724,7 @@ > command capabilities > EOF creating http peer for wire protocol version 2 + s> setsockopt(6, 1, 1) -> None (py3 !) s> GET /?cmd=capabilities HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> vary: X-HgProto-1,X-HgUpgrade-1\r\n @@ -739,6 +744,7 @@ s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0003\xa5Hcommands\xacIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa2Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84IbookmarksGparentsEphaseHrevisionIrevisions\xa2Hrequired\xf5DtypeDlistKpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x83HlinknodeGparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDpath\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullIfilesdata\xa3Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84NfirstchangesetHlinknodeGparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolJpathfilter\xa3Gdefault\xf6Hrequired\xf4DtypeDdictIrevisions\xa2Hrequired\xf5DtypeDlistKpermissions\x81DpullTrecommendedbatchsize\x19\xc3PEheads\xa2Dargs\xa1Jpubliconly\xa3Gdefault\xf4Hrequired\xf4DtypeDboolKpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\xa3Gdefault\x80Hrequired\xf4DtypeDlistKpermissions\x81DpullHlistkeys\xa2Dargs\xa1Inamespace\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullFlookup\xa2Dargs\xa1Ckey\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullLmanifestdata\xa3Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDtree\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullTrecommendedbatchsize\x1a\x00\x01\x86\xa0Gpushkey\xa2Dargs\xa4Ckey\xa2Hrequired\xf5DtypeEbytesInamespace\xa2Hrequired\xf5DtypeEbytesCnew\xa2Hrequired\xf5DtypeEbytesCold\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpushPrawstorefiledata\xa2Dargs\xa2Efiles\xa2Hrequired\xf5DtypeDlistJpathfilter\xa3Gdefault\xf6Hrequired\xf4DtypeDlistKpermissions\x81DpullQframingmediatypes\x81X/mercurial-exp-framing-0006Rpathfilterprefixes\xd9\x01\x02\x82Epath:Lrootfilesin:Nrawrepoformats\x83LgeneraldeltaHrevlogv1LsparserevlogHredirect\xa2Fhashes\x82Fsha256Dsha1Gtargets\x81\xa4DnameNtarget-bad-tlsHprotocolEhttpsKsnirequired\xf5Duris\x81Thttps://example.com/Nv1capabilitiesY\x01\xe0batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (redirect target target-bad-tls requires SNI, which is unsupported) sending capabilities command + s> setsockopt(6, 1, 1) -> None (py3 !) s> POST /api/exp-http-v2-0003/ro/capabilities HTTP/1.1\r\n
D5703: tests: add b'' prefixes to ui.configbool() call
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Otherwise the call fails due to using str on Python 3. 1. skip-blame: just b'' prefixes REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5703 AFFECTED FILES tests/test-http-protocol.t CHANGE DETAILS diff --git a/tests/test-http-protocol.t b/tests/test-http-protocol.t --- a/tests/test-http-protocol.t +++ b/tests/test-http-protocol.t @@ -389,7 +389,7 @@ > relpath = path[len(b'/redirector'):] > res.status = b'301 Redirect' > newurl = b'%s/redirected%s' % (req.baseurl, relpath) - > if not repo.ui.configbool('testing', 'redirectqs', True) and b'?' in newurl: + > if not repo.ui.configbool(b'testing', b'redirectqs', True) and b'?' in newurl: > newurl = newurl[0:newurl.index(b'?')] > res.headers[b'Location'] = newurl > res.headers[b'Content-Type'] = b'text/plain' To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5701: tests: add b'' when testing for tls1.2
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The dict keys are bytes. The test was always failing due to looking for a str key. skip-blame: just b'' prefix REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5701 AFFECTED FILES tests/hghave.py CHANGE DETAILS diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -543,7 +543,7 @@ @check("tls1.2", "TLS 1.2 protocol support") def has_tls1_2(): from mercurial import sslutil -return 'tls1.2' in sslutil.supportedprotocols +return b'tls1.2' in sslutil.supportedprotocols @check("windows", "Windows") def has_windows(): To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5697: wireprotov2server: don't attempt to cast command name
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I'm not sure why this was added. The command name should already be bytes. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5697 AFFECTED FILES mercurial/wireprotov2server.py CHANGE DETAILS diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py --- a/mercurial/wireprotov2server.py +++ b/mercurial/wireprotov2server.py @@ -745,7 +745,7 @@ # More granular cache key invalidation. b'localversion': localversion, # Cache keys are segmented by command. -b'command': pycompat.sysbytes(command), +b'command': command, # Throw in the media type and API version strings so changes # to exchange semantics invalid cache. b'mediatype': FRAMINGTYPE, To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5698: wireprotov2peer: rewrite character traversal to use slices
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Otherwise on Python 3 we iterate over integers instead of a bytes instance and the comparison fails. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5698 AFFECTED FILES mercurial/wireprotov2peer.py CHANGE DETAILS diff --git a/mercurial/wireprotov2peer.py b/mercurial/wireprotov2peer.py --- a/mercurial/wireprotov2peer.py +++ b/mercurial/wireprotov2peer.py @@ -510,7 +510,7 @@ # Bytestring where each byte is a 0 or 1. raw = next(objs) -return [True if c == '1' else False for c in raw] +return [True if raw[i:i+1] == b'1' else False for i in range(len(raw))] def decodelistkeys(objs): # Map with bytestring keys and values. To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5696: wireprotov2server: use pycompat.strkwargs when calling cachekeyfn
indygreg 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/D5696 AFFECTED FILES mercurial/wireprotov2server.py CHANGE DETAILS diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py --- a/mercurial/wireprotov2server.py +++ b/mercurial/wireprotov2server.py @@ -390,7 +390,8 @@ return with cacher: -cachekey = entry.cachekeyfn(repo, proto, cacher, **args) +cachekey = entry.cachekeyfn(repo, proto, cacher, +**pycompat.strkwargs(args)) # No cache key or the cacher doesn't like it. Do default handling. if cachekey is None or not cacher.setcachekey(cachekey): To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH RFC] lfs: clean up a variety of strings/bytes issues
> On Jan 25, 2019, at 17:33, Augie Fackler wrote: > > # HG changeset patch > # User Augie Fackler > # Date 1548455589 18000 > # Fri Jan 25 17:33:09 2019 -0500 > # Node ID d59571aba933f16db8e58ec9b61365ea4db0e2fa > # Parent ffdac0067a147f878ac45dc2c4b3b3e490865252 > lfs: clean up a variety of strings/bytes issues Here's my gross hacks to try and force tracebacks and extract debug info, in case that's useful to anyone: diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py --- a/hgext/lfs/blobstore.py +++ b/hgext/lfs/blobstore.py @@ -568,7 +568,7 @@ class _promptremote(object): """Prompt user to set lfs.url when accessed.""" def __init__(self, repo, url): -pass +self._repo = repo def writebatch(self, pointers, fromstore, ui=None): self._prompt() @@ -577,6 +577,7 @@ class _promptremote(object): self._prompt() def _prompt(self): +assert False, u'%r %r' % (self._repo, self._repo.ui.configitems('path')) raise error.Abort(_('lfs.url needs to be configured')) _storemap = { @@ -638,6 +639,11 @@ def remote(repo, remote=None): repo.ui.note(_('lfs: assuming remote store: %s\n') % url) scheme = url.scheme +if repo.ui.debugflag and scheme is None: +repo.ui.warn((u'%r %r %r %r %r %r\n' % ( +scheme, [x for x in dir(repo) if u'subto' in x], path, defaulturl, url, +repo.ui.configitems('paths'))).encode('utf-8')) +repo.ui.flush() if scheme not in _storemap: raise error.Abort(_('lfs: unknown url scheme: %s') % scheme) return _storemap[scheme](repo, url) diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -777,7 +777,13 @@ def clone(ui, peeropts, source, dest=Non u.passwd = None defaulturl = bytes(u) destrepo.vfs.write('hgrc', util.tonativeeol(template % defaulturl)) -destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone') +if destrepo.ui.debugflag: +ui.warn('wat(raf) clone url settting is %s\n' % defaulturl) +destrepo.unfiltered().ui.setconfig('paths', 'default', defaulturl, 'clone') +if destrepo.ui.debugflag: +ui.warn('wat(raf) debug info: %s %s\n' % ( +repr(destrepo).encode('utf8'), +repr(destrepo.ui.configitems('paths')).encode('utf8'))) if ui.configbool('experimental', 'remotenames'): logexchange.pullremotenames(destrepo, srcpeer) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH RFC] lfs: clean up a variety of strings/bytes issues
# HG changeset patch # User Augie Fackler # Date 1548455589 18000 # Fri Jan 25 17:33:09 2019 -0500 # Node ID d59571aba933f16db8e58ec9b61365ea4db0e2fa # Parent ffdac0067a147f878ac45dc2c4b3b3e490865252 lfs: clean up a variety of strings/bytes issues Mostly these are around json encoding/decoding, which is a hassle for us. After this change there are fewer tracebacks in the lfs tests on Python 3, but I'm very confused by the remaining failures: it looks very much like destrepo.ui.setconfig() in mercurial.hg.clone() isn't working: I can see a repo object with a stable repr() (which includes the object's id) that appears to _lose_ the setconfig()ed paths.default by the time we get into the lfs blobstore setup. I'm not sure where to debug from here, but I _suspect_ this code is reasonable (or at least partially so) as a starting place to try and get the remaining lfs tests working on Python 3. diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py --- a/hgext/lfs/blobstore.py +++ b/hgext/lfs/blobstore.py @@ -79,7 +79,8 @@ class nullvfs(lfsvfs): # self.vfs. Raise the same error as a normal vfs when asked to read a # file that doesn't exist. The only difference is the full file path # isn't available in the error. -raise IOError(errno.ENOENT, '%s: No such file or directory' % oid) +raise IOError(errno.ENOENT, + pycompat.sysstr('%s: No such file or directory' % oid)) def walk(self, path=None, onerror=None): return ('', [], []) @@ -289,15 +290,16 @@ class _gitlfsremote(object): Return decoded JSON object like {'objects': [{'oid': '', 'size': 1}]} See https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md """ -objects = [{'oid': p.oid(), 'size': p.size()} for p in pointers] -requestdata = json.dumps({ -'objects': objects, -'operation': action, -}) -url = '%s/objects/batch' % self.baseurl +objects = [{r'oid': pycompat.strurl(p.oid()), +r'size': p.size()} for p in pointers] +requestdata = pycompat.bytesurl(json.dumps({ +r'objects': objects, +r'operation': pycompat.strurl(action), +})) +url = pycompat.strurl('%s/objects/batch' % self.baseurl) batchreq = util.urlreq.request(url, data=requestdata) -batchreq.add_header('Accept', 'application/vnd.git-lfs+json') -batchreq.add_header('Content-Type', 'application/vnd.git-lfs+json') +batchreq.add_header(r'Accept', r'application/vnd.git-lfs+json') +batchreq.add_header(r'Content-Type', r'application/vnd.git-lfs+json') try: with contextlib.closing(self.urlopener.open(batchreq)) as rsp: rawjson = rsp.read() @@ -308,8 +310,10 @@ class _gitlfsremote(object): 404: _('the "lfs.url" config may be used to override %s') % self.baseurl, } -hint = hints.get(ex.code, _('api=%s, action=%s') % (url, action)) -raise LfsRemoteError(_('LFS HTTP error: %s') % ex, hint=hint) +hint = hints.get(ex.code, _('api=%s, action=%s') % ( +pycompat.bytesurl(url), action)) +raise LfsRemoteError( +_('LFS HTTP error: %s') % pycompat.bytestr(ex), hint=hint) except util.urlerr.urlerror as ex: hint = (_('the "lfs.url" config may be used to override %s') % self.baseurl) @@ -325,14 +329,17 @@ class _gitlfsremote(object): self.ui.debug('Status: %d\n' % rsp.status) # lfs-test-server and hg serve return headers in different order self.ui.debug('%s\n' - % '\n'.join(sorted(str(rsp.info()).splitlines( + % '\n'.join(sorted( + pycompat.bytestr(rsp.info()).splitlines( if 'objects' in response: response['objects'] = sorted(response['objects'], key=lambda p: p['oid']) self.ui.debug('%s\n' - % json.dumps(response, indent=2, - separators=('', ': '), sort_keys=True)) + % pycompat.bytesurl( + json.dumps(response, indent=2, + separators=(r'', r': '), + sort_keys=True))) return response diff --git a/hgext/lfs/wireprotolfsserver.py b/hgext/lfs/wireprotolfsserver.py --- a/hgext/lfs/wireprotolfsserver.py +++ b/hgext/lfs/wireprotolfsserver.py @@ -138,11 +138,14 @@ def _processbatchrequest(repo, req, res) b'Only the basic LFS transfer handler is supported') return True -operation = lfsreq.get('operation') -if operation not in ('upload', 'download'): -
D5638: branchmap: encapsulate cache updating in the map itself
martinvonz added inline comments. INLINE COMMENTS > perf.py:2299 > else: > -view._branchcaches.pop(filtername, None) > +view._branchcaches._per_filter.pop(filtername, None) > view.branchmap() Same here: I think this needs to be made compatible with both versions (before and after this patch) > localrepo.py:2077 > self.ui.debug('updating the branch cache\n') > -branchmap.updatecache(self.filtered('served')) > +self.filtered('served').branchmap() > Hmm, it's much less clear now that this updates the cache. At the very least, it deserves a comment. Is the `updatecache()` call from `__getitem__()` necessary for your later patches? Sorry, I didn't quite follow. > streamclone.py:16 > from . import ( > branchmap, > cacheutil, `test-check-pyflakes.t` says that this is now unused REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5638 To: mjpieters, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5636: branchmap: updating triggers a write
martinvonz added inline comments. INLINE COMMENTS > discovery.py:242-243 > +newmap = branchmap.remotebranchcache((branch, heads[1]) > for branch, heads in headssum.iteritems() > if heads[0] is not None) > newmap.update(repo, (ctx.rev() for ctx in missingctx)) Indentation seems bad (seemed bad before too) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5636 To: mjpieters, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5635: branchmap: make branchcache responsible for reading
martinvonz added inline comments. INLINE COMMENTS > perf.py:2326 > > -branchcacheread = safeattrsetter(branchmap, b'read') > +branchcacheread = safeattrsetter(branchmap.branchcache, b'fromfile') > branchcachewrite = safeattrsetter(branchmap.branchcache, b'write') As I was recently reminded by Yuya, the perf commands are supposed to be compatible with older versions of hg too, and this doesn't seem to be compatible with the `branchmap.read()` version. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5635 To: mjpieters, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@41359: 12 new changesets (3 on stable)
12 new changesets (3 on stable) in mercurial: https://www.mercurial-scm.org/repo/hg/rev/2f54f31c41aa changeset: 41348:2f54f31c41aa branch: stable parent: 41308:26ee61c33dee user:Georges Racinet date:Wed Jan 23 07:39:27 2019 -0500 summary: rust: working directory revision number constant https://www.mercurial-scm.org/repo/hg/rev/ee943a920606 changeset: 41349:ee943a920606 branch: stable user:Georges Racinet date:Wed Jan 23 07:47:04 2019 -0500 summary: rust: error for WdirUnsupported with cpython conversion as exception https://www.mercurial-scm.org/repo/hg/rev/ab0d762d89ef changeset: 41350:ab0d762d89ef branch: stable user:Georges Racinet date:Wed Jan 23 07:49:36 2019 -0500 summary: rust-cpython: raising error.WdirUnsupported https://www.mercurial-scm.org/repo/hg/rev/0ae3ddb4fbed changeset: 41351:0ae3ddb4fbed parent: 41347:40787a96fda7 parent: 41350:ab0d762d89ef user:Yuya Nishihara date:Fri Jan 25 18:55:23 2019 +0900 summary: merge with stable https://www.mercurial-scm.org/repo/hg/rev/73ccba60aaa1 changeset: 41352:73ccba60aaa1 user:Augie Fackler date:Thu Jan 24 15:04:30 2019 -0500 summary: py3: almost fix test-trusted.py https://www.mercurial-scm.org/repo/hg/rev/07ade2dc41db changeset: 41353:07ade2dc41db user:Augie Fackler date:Thu Jan 24 15:23:20 2019 -0500 summary: py3: port test-parseindex.t to Python 3 https://www.mercurial-scm.org/repo/hg/rev/93a7539a546e changeset: 41354:93a7539a546e user:Augie Fackler date:Thu Jan 24 15:52:59 2019 -0500 summary: tests: remove some over-globbing in test-dispatch.t https://www.mercurial-scm.org/repo/hg/rev/77763dc5b07b changeset: 41355:77763dc5b07b user:Pulkit Goyal date:Thu Jan 24 18:09:34 2019 +0300 summary: py3: add b'' prefixes in doc/check-seclevel.py https://www.mercurial-scm.org/repo/hg/rev/23c80ce166f1 changeset: 41356:23c80ce166f1 user:Pulkit Goyal date:Fri Jan 18 19:26:28 2019 +0530 summary: py3: add b'' prefixes in tests/test-lfs-serve.t https://www.mercurial-scm.org/repo/hg/rev/dafd13c7237b changeset: 41357:dafd13c7237b user:Pulkit Goyal date:Fri Jan 18 19:28:31 2019 +0530 summary: py3: use dict.items() instead of dict.iteritems() in tests/test-lfs-server.t https://www.mercurial-scm.org/repo/hg/rev/0a0927f7549d changeset: 41358:0a0927f7549d user:Pulkit Goyal date:Thu Jan 24 18:14:39 2019 +0300 summary: tests: fix module-import warnings in test-update-atomic.t https://www.mercurial-scm.org/repo/hg/rev/431cf2c8c839 changeset: 41359:431cf2c8c839 bookmark:@ tag: tip user:Anton Shestakov date:Tue Jan 15 22:57:09 2019 +0800 summary: revset: support ranges in #generations relation -- 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
D5695: unshare: use context manager for locks
martinvonz 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/D5695 AFFECTED FILES mercurial/hg.py CHANGE DETAILS diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -282,25 +282,20 @@ called. """ -destlock = None -lock = repo.lock() -try: +with repo.lock(): # we use locks here because if we race with commit, we # can end up with extra data in the cloned revlogs that's # not pointed to by changesets, thus causing verify to # fail - destlock = copystore(ui, repo, repo.path) - -sharefile = repo.vfs.join('sharedpath') -util.rename(sharefile, sharefile + '.old') +with destlock or util.nullcontextmanager(): -repo.requirements.discard('shared') -repo.requirements.discard('relshared') -repo._writerequirements() -finally: -destlock and destlock.release() -lock and lock.release() +sharefile = repo.vfs.join('sharedpath') +util.rename(sharefile, sharefile + '.old') + +repo.requirements.discard('shared') +repo.requirements.discard('relshared') +repo._writerequirements() # Removing share changes some fundamental properties of the repo instance. # So we instantiate a new repo object and operate on it rather than 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
D5628: diffstat: make --git work properly on renames (issue6025)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGffdac0067a14: diffstat: make --git work properly on renames (issue6025) (authored by navaneeth.suresh, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5628?vs=13314=13463 REVISION DETAIL https://phab.mercurial-scm.org/D5628 AFFECTED FILES mercurial/patch.py tests/test-diffstat.t CHANGE DETAILS diff --git a/tests/test-diffstat.t b/tests/test-diffstat.t --- a/tests/test-diffstat.t +++ b/tests/test-diffstat.t @@ -236,3 +236,22 @@ $ hg diff --root . --stat file | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) + +When a file is renamed, --git shouldn't loss the info about old file + $ hg init issue6025 + $ cd issue6025 + $ echo > a + $ hg ci -Am 'add a' + adding a + $ hg mv a b + $ hg diff --git + diff --git a/a b/b + rename from a + rename to b + $ hg diff --stat + a | 1 - + b | 1 + + 2 files changed, 1 insertions(+), 1 deletions(-) + $ hg diff --stat --git + a => b | 0 + 1 files changed, 0 insertions(+), 0 deletions(-) diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -2805,6 +2805,10 @@ elif (line.startswith('GIT binary patch') or line.startswith('Binary file')): isbinary = True +elif line.startswith('rename from'): +filename = line.split()[-1] +elif line.startswith('rename to'): +filename += ' => %s' % line.split()[-1] addresult() return results To: navaneeth.suresh, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5629: cleanup: delete lots of unused local variables
This revision was automatically updated to reflect the committed changes. Closed by commit rHG876494fd967d: cleanup: delete lots of unused local variables (authored by martinvonz, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D5629?vs=13320=13454#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5629?vs=13320=13454 REVISION DETAIL https://phab.mercurial-scm.org/D5629 AFFECTED FILES contrib/bdiff-torture.py contrib/check-code.py contrib/perf.py contrib/synthrepo.py hgext/absorb.py hgext/blackbox.py hgext/convert/cvs.py hgext/convert/hg.py hgext/convert/monotone.py hgext/convert/subversion.py hgext/fastannotate/protocol.py hgext/fastannotate/support.py hgext/fsmonitor/__init__.py hgext/fsmonitor/pywatchman/capabilities.py hgext/fsmonitor/pywatchman/pybser.py hgext/githelp.py hgext/journal.py hgext/largefiles/overrides.py hgext/largefiles/storefactory.py hgext/phabricator.py hgext/rebase.py hgext/remotefilelog/basepack.py hgext/remotefilelog/datapack.py hgext/remotefilelog/debugcommands.py hgext/remotefilelog/historypack.py hgext/remotefilelog/remotefilelog.py hgext/remotefilelog/repack.py hgext/zeroconf/Zeroconf.py mercurial/bookmarks.py mercurial/changegroup.py mercurial/cmdutil.py mercurial/color.py mercurial/commands.py mercurial/debugcommands.py mercurial/exchange.py mercurial/filemerge.py mercurial/hg.py mercurial/hgweb/hgwebdir_mod.py mercurial/localrepo.py mercurial/logexchange.py mercurial/manifest.py mercurial/merge.py mercurial/minirst.py mercurial/patch.py mercurial/statprof.py mercurial/subrepoutil.py mercurial/transaction.py mercurial/ui.py mercurial/wireprotov1server.py tests/run-tests.py tests/test-ancestor.py tests/test-linelog.py tests/test-remotefilelog-histpack.py tests/test-revlog-raw.py CHANGE DETAILS diff --git a/tests/test-revlog-raw.py b/tests/test-revlog-raw.py --- a/tests/test-revlog-raw.py +++ b/tests/test-revlog-raw.py @@ -417,7 +417,6 @@ print(' got: %s' % result15) def maintest(): -expected = rl = None with newtransaction() as tr: rl = newrevlog(recreate=True) expected = writecases(rl, tr) diff --git a/tests/test-remotefilelog-histpack.py b/tests/test-remotefilelog-histpack.py --- a/tests/test-remotefilelog-histpack.py +++ b/tests/test-remotefilelog-histpack.py @@ -161,7 +161,7 @@ pack = self.createPack(revisions) # Verify the pack contents -for (filename, node), (p1, p2, lastnode) in allentries.items(): +for (filename, node) in allentries: ancestors = pack.getancestors(filename, node) self.assertEqual(ancestorcounts[(filename, node)], len(ancestors)) diff --git a/tests/test-linelog.py b/tests/test-linelog.py --- a/tests/test-linelog.py +++ b/tests/test-linelog.py @@ -15,7 +15,6 @@ def _genedits(seed, endrev): lines = [] random.seed(seed) -rev = 0 for rev in range(0, endrev): n = len(lines) a1 = random.randint(0, n) diff --git a/tests/test-ancestor.py b/tests/test-ancestor.py --- a/tests/test-ancestor.py +++ b/tests/test-ancestor.py @@ -123,7 +123,6 @@ # reference slow algorithm naiveinc = naiveincrementalmissingancestors(ancs, bases) seq = [] -revs = [] for _ in xrange(inccount): if rng.random() < 0.2: newbases = samplerevs(graphnodes) diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1225,7 +1225,6 @@ killdaemons(env['DAEMON_PIDS']) return ret -output = b'' proc.tochild.close() try: diff --git a/mercurial/wireprotov1server.py b/mercurial/wireprotov1server.py --- a/mercurial/wireprotov1server.py +++ b/mercurial/wireprotov1server.py @@ -424,8 +424,6 @@ raise error.Abort(bundle2requiredmain, hint=bundle2requiredhint) -prefercompressed = True - try: clheads = set(repo.changelog.heads()) heads = set(opts.get('heads', set())) @@ -578,7 +576,6 @@ repo.ui.debug('redirecting incoming bundle to %s\n' % tempname) fp = os.fdopen(fd, pycompat.sysstr('wb+')) -r = 0 for p in payload: fp.write(p) fp.seek(0) diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -566,8 +566,6 @@ candidate = self._data(untrusted).get(s, n, None) if candidate is not None: value = candidate -section = s -name = n break if self.debugflag and not untrusted and self._reportuntrusted:
D5693: mq: slightly simplify check for patched working copy
This revision was automatically updated to reflect the committed changes. Closed by commit rHG3cd34838927a: mq: slightly simplify check for patched working copy (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5693?vs=13439=13461 REVISION DETAIL https://phab.mercurial-scm.org/D5693 AFFECTED FILES hgext/mq.py CHANGE DETAILS diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -3521,7 +3521,7 @@ if self.mq.applied and self.mq.checkapplied and not force: parents = self.dirstate.parents() patches = [s.node for s in self.mq.applied] -if parents[0] in patches or parents[1] in patches: +if any(p in patches for p in parents): raise error.Abort(errmsg) def commit(self, text="", user=None, date=None, match=None, 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
D5694: cmdutil: drop obsolete comment about updating to '.'
This revision was automatically updated to reflect the committed changes. Closed by commit rHG9ce454a50a21: cmdutil: drop obsolete comment about updating to . (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5694?vs=13447=13462 REVISION DETAIL https://phab.mercurial-scm.org/D5694 AFFECTED FILES mercurial/cmdutil.py CHANGE DETAILS diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -607,11 +607,9 @@ return _helpmessage('hg unshelve --continue', 'hg unshelve --abort') def _graftmsg(): -# tweakdefaults requires `update` to have a rev hence the `.` return _helpmessage('hg graft --continue', 'hg graft --abort') def _mergemsg(): -# tweakdefaults requires `update` to have a rev hence the `.` return _helpmessage('hg commit', 'hg merge --abort') def _bisectmsg(): 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
D5692: localrepo: slightly simplify check for removed parents in _rollback()
This revision was automatically updated to reflect the committed changes. Closed by commit rHGf1086a154d15: localrepo: slightly simplify check for removed parents in _rollback() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5692?vs=13438=13460 REVISION DETAIL https://phab.mercurial-scm.org/D5692 AFFECTED FILES mercurial/localrepo.py CHANGE DETAILS diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2011,8 +2011,7 @@ self.svfs.rename('undo.phaseroots', 'phaseroots', checkambig=True) self.invalidate() -parentgone = (parents[0] not in self.changelog.nodemap or - parents[1] not in self.changelog.nodemap) +parentgone = any(p not in self.changelog.nodemap for p in parents) if parentgone: # prevent dirstateguard from overwriting already restored one dsguard.close() 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
D5691: transplant: use bailifchanged() instead of reimplementing it
This revision was automatically updated to reflect the committed changes. Closed by commit rHG767ea93cdd5e: transplant: use bailifchanged() instead of reimplementing it (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5691?vs=13437=13459 REVISION DETAIL https://phab.mercurial-scm.org/D5691 AFFECTED FILES hgext/transplant.py tests/test-transplant.t CHANGE DETAILS diff --git a/tests/test-transplant.t b/tests/test-transplant.t --- a/tests/test-transplant.t +++ b/tests/test-transplant.t @@ -39,12 +39,12 @@ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg transplant 1 - abort: outstanding uncommitted merges + abort: outstanding uncommitted merge [255] $ hg up -qC tip $ echo b0 > b1 $ hg transplant 1 - abort: outstanding local changes + abort: uncommitted changes [255] $ hg up -qC tip $ echo b2 > b2 diff --git a/hgext/transplant.py b/hgext/transplant.py --- a/hgext/transplant.py +++ b/hgext/transplant.py @@ -676,11 +676,7 @@ raise error.Abort(_('no transplant to continue')) else: cmdutil.checkunfinished(repo) -if p2 != revlog.nullid: -raise error.Abort(_('outstanding uncommitted merges')) -m, a, r, d = repo.status()[:4] -if m or a or r or d: -raise error.Abort(_('outstanding local changes')) +cmdutil.bailifchanged(repo) sourcerepo = opts.get('source') if sourcerepo: 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
D5688: revpair: clarify check for empty revset
This revision was automatically updated to reflect the committed changes. Closed by commit rHGd055f89c8b5b: revpair: clarify check for empty revset (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5688?vs=13430=13458 REVISION DETAIL https://phab.mercurial-scm.org/D5688 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 @@ -672,11 +672,12 @@ l = revrange(repo, revs) +if not l: +raise error.Abort(_('empty revision range')) + first = l.first() second = l.last() -if first is None: -raise error.Abort(_('empty revision range')) if (first == second and len(revs) >= 2 and not all(revrange(repo, [r]) for r in revs)): raise error.Abort(_('empty revision on one side of range')) 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
D5633: grep: use set instead of dict with dummy value
This revision was automatically updated to reflect the committed changes. Closed by commit rHG64bd6611e18e: grep: use set instead of dict with dummy value (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5633?vs=13326=13456 REVISION DETAIL https://phab.mercurial-scm.org/D5633 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 @@ -2925,7 +2925,7 @@ fm.data(matched=False) fm.end() -skip = {} +skip = set() revfiles = {} match = scmutil.match(repo[None], pats, opts) found = False @@ -2954,7 +2954,7 @@ if copy: copies.setdefault(rev, {})[fn] = copy if fn in skip: -skip[copy] = True +skip.add(copy) continue files.append(fn) @@ -2983,16 +2983,16 @@ copy = copies.get(rev, {}).get(fn) if fn in skip: if copy: -skip[copy] = True +skip.add(copy) continue pstates = matches.get(parent, {}).get(copy or fn, []) if pstates or states: r = display(fm, fn, ctx, pstates, states) found = found or r if r and not diff and not all_files: -skip[fn] = True +skip.add(fn) if copy: -skip[copy] = True +skip.add(copy) del revfiles[rev] # We will keep the matches dict for the duration of the window # clear the matches dict once the window is over To: martinvonz, #hg-reviewers Cc: lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5620: grep: don't look up copy info unless --follow is given
This revision was automatically updated to reflect the committed changes. Closed by commit rHGbdb5fef5cff4: grep: dont look up copy info unless --follow is given (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5620?vs=13325=13455 REVISION DETAIL https://phab.mercurial-scm.org/D5620 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 @@ -2944,17 +2944,18 @@ fnode = ctx.filenode(fn) except error.LookupError: continue -try: -copied = flog.renamed(fnode) -except error.WdirUnsupported: -copied = ctx[fn].renamed() -copy = follow and copied and copied[0] -if copy: -copies.setdefault(rev, {})[fn] = copy -if fn in skip: +copy = None +if follow: +try: +copied = flog.renamed(fnode) +except error.WdirUnsupported: +copied = ctx[fn].renamed() +copy = copied and copied[0] if copy: -skip[copy] = True -continue +copies.setdefault(rev, {})[fn] = copy +if fn in skip: +skip[copy] = True +continue files.append(fn) if fn not in matches[rev]: 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
D5687: revpair: simplify revpair by always relying on smartset.first/last
This revision was automatically updated to reflect the committed changes. Closed by commit rHG90636f6a2022: revpair: simplify revpair by always relying on smartset.first/last (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5687?vs=13429=13457 REVISION DETAIL https://phab.mercurial-scm.org/D5687 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 @@ -672,17 +672,8 @@ l = revrange(repo, revs) -if not l: -first = second = None -elif l.isascending(): -first = l.min() -second = l.max() -elif l.isdescending(): -first = l.max() -second = l.min() -else: -first = l.first() -second = l.last() +first = l.first() +second = l.last() if first is None: raise error.Abort(_('empty revision range')) 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
D5622: localrepo: use context manager for transaction in commit()
This revision was automatically updated to reflect the committed changes. Closed by commit rHG57c462db87fd: localrepo: use context manager for transaction in commit() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5622?vs=13305=13450 REVISION DETAIL https://phab.mercurial-scm.org/D5622 AFFECTED FILES mercurial/localrepo.py tests/test-histedit-edit.t tests/test-mq-qnew.t tests/test-rollback.t tests/test-tag.t CHANGE DETAILS diff --git a/tests/test-tag.t b/tests/test-tag.t --- a/tests/test-tag.t +++ b/tests/test-tag.t @@ -320,9 +320,9 @@ HG: branch 'tag-and-branch-same-name' HG: changed .hgtags - note: commit message saved in .hg/last-message.txt transaction abort! rollback completed + note: commit message saved in .hg/last-message.txt abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ cat .hg/last-message.txt diff --git a/tests/test-rollback.t b/tests/test-rollback.t --- a/tests/test-rollback.t +++ b/tests/test-rollback.t @@ -113,9 +113,9 @@ > echo "another precious commit message" > "$1" > __EOF__ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg --config hooks.pretxncommit=false commit 2>&1 - note: commit message saved in .hg/last-message.txt transaction abort! rollback completed + note: commit message saved in .hg/last-message.txt abort: pretxncommit hook exited with status * (glob) [255] $ cat .hg/last-message.txt diff --git a/tests/test-mq-qnew.t b/tests/test-mq-qnew.t --- a/tests/test-mq-qnew.t +++ b/tests/test-mq-qnew.t @@ -305,9 +305,9 @@ HG: branch 'default' HG: no files changed - note: commit message saved in .hg/last-message.txt transaction abort! rollback completed + note: commit message saved in .hg/last-message.txt abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ cat .hg/last-message.txt diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t +++ b/tests/test-histedit-edit.t @@ -370,9 +370,9 @@ HG: branch 'default' HG: added f - note: commit message saved in .hg/last-message.txt transaction abort! rollback completed + note: commit message saved in .hg/last-message.txt abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ cat .hg/last-message.txt @@ -394,9 +394,9 @@ HG: user: test HG: branch 'default' HG: added f - note: commit message saved in .hg/last-message.txt transaction abort! rollback completed + note: commit message saved in .hg/last-message.txt abort: pretxncommit.unexpectedabort hook exited with status 1 [255] diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2409,7 +2409,7 @@ match.explicitdir = vdirs.append match.bad = fail -wlock = lock = tr = None +wlock = lock = None try: wlock = self.wlock() lock = self.lock() # for recent changelog (see issue4368) @@ -2473,21 +2473,20 @@ try: self.hook("precommit", throw=True, parent1=hookp1, parent2=hookp2) -tr = self.transaction('commit') -ret = self.commitctx(cctx, True) -# update bookmarks, dirstate and mergestate -bookmarks.update(self, [p1, p2], ret) -cctx.markcommitted(ret) -ms.reset() -tr.close() +with self.transaction('commit'): +ret = self.commitctx(cctx, True) +# update bookmarks, dirstate and mergestate +bookmarks.update(self, [p1, p2], ret) +cctx.markcommitted(ret) +ms.reset() except: # re-raises if edited: self.ui.write( _('note: commit message saved in %s\n') % msgfn) raise finally: -lockmod.release(tr, lock, wlock) +lockmod.release(lock, wlock) def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2): # hack for command that use a temporary commit (eg: histedit) To: martinvonz, durin42, #hg-reviewers, lothiraldan Cc: lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5631: hghave: let OSError with ENOENT through like any other
This revision was automatically updated to reflect the committed changes. Closed by commit rHGfabb0224a599: hghave: let OSError with ENOENT through like any other (authored by martinvonz, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D5631?vs=13321=13453#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5631?vs=13321=13453 REVISION DETAIL https://phab.mercurial-scm.org/D5631 AFFECTED FILES tests/hghave.py CHANGE DETAILS diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -1,6 +1,5 @@ from __future__ import absolute_import -import errno import os import re import socket @@ -118,13 +117,8 @@ is matched by the supplied regular expression. """ r = re.compile(regexp) -try: -p = subprocess.Popen( -cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) -except OSError as e: -if e.errno != errno.ENOENT: -raise -ret = -1 +p = subprocess.Popen( +cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) s = p.communicate()[0] ret = p.returncode return (ignorestatus or not ret) and r.search(s) 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
D5623: localrepo: use context manager for locks in commit()
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb87a009d1b3b: localrepo: use context manager for locks in commit() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5623?vs=13306=13451 REVISION DETAIL https://phab.mercurial-scm.org/D5623 AFFECTED FILES mercurial/localrepo.py CHANGE DETAILS diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2409,11 +2409,8 @@ match.explicitdir = vdirs.append match.bad = fail -wlock = lock = None -try: -wlock = self.wlock() -lock = self.lock() # for recent changelog (see issue4368) - +# lock() for recent changelog (see issue4368) +with self.wlock(), self.lock(): wctx = self[None] merge = len(wctx.parents()) > 1 @@ -2485,9 +2482,6 @@ _('note: commit message saved in %s\n') % msgfn) raise -finally: -lockmod.release(lock, wlock) - def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2): # hack for command that use a temporary commit (eg: histedit) # temporary commit got stripped before hook release 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
D5624: localrepo: use context manager for lock and transaction in commitctx()
This revision was automatically updated to reflect the committed changes. Closed by commit rHG0132221c25cd: localrepo: use context manager for lock and transaction in commitctx() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5624?vs=13307=13452 REVISION DETAIL https://phab.mercurial-scm.org/D5624 AFFECTED FILES mercurial/localrepo.py CHANGE DETAILS diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2502,13 +2502,10 @@ from p1 or p2 are excluded from the committed ctx.files(). """ -tr = None p1, p2 = ctx.p1(), ctx.p2() user = ctx.user() -lock = self.lock() -try: -tr = self.transaction("commit") +with self.lock(), self.transaction("commit") as tr: trp = weakref.proxy(tr) if ctx.manifestnode(): @@ -2605,12 +2602,7 @@ # # if minimal phase was 0 we don't need to retract anything phases.registernew(self, tr, targetphase, [n]) -tr.close() return n -finally: -if tr: -tr.release() -lock.release() @unfilteredmethod def destroying(self): 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
D5621: commit: print "commit message saved in" message also if bookmark update fails
This revision was automatically updated to reflect the committed changes. Closed by commit rHG092c5d05ba01: commit: print commit message saved in message also if bookmark update fails (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5621?vs=13304=13449 REVISION DETAIL https://phab.mercurial-scm.org/D5621 AFFECTED FILES mercurial/localrepo.py CHANGE DETAILS diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2475,16 +2475,16 @@ parent2=hookp2) tr = self.transaction('commit') ret = self.commitctx(cctx, True) +# update bookmarks, dirstate and mergestate +bookmarks.update(self, [p1, p2], ret) +cctx.markcommitted(ret) +ms.reset() +tr.close() except: # re-raises if edited: self.ui.write( _('note: commit message saved in %s\n') % msgfn) raise -# update bookmarks, dirstate and mergestate -bookmarks.update(self, [p1, p2], ret) -cctx.markcommitted(ret) -ms.reset() -tr.close() finally: lockmod.release(tr, lock, wlock) 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
[PATCH STABLE] revlog: make sure we never use sparserevlog without general delta (issue6056)
# HG changeset patch # User Boris Feld # Date 1548372167 18000 # Thu Jan 24 18:22:47 2019 -0500 # Branch stable # Node ID c7661fdcaeac457aa5b8ae6b6a10b259713934b9 # Parent 26ee61c33dee366576a0f7266fea9834985e78ec # EXP-Topic issue6056 # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r c7661fdcaeac revlog: make sure we never use sparserevlog without general delta (issue6056) We are getting user report where the delta code tries to use `sparse-revlog` logic on repository where `generaldelta` is disabled. This can't work so we ensure the two booleans have a consistent value. Creating this kind of repository is not expected to be possible and we weren't able to create one for testing purpose. But if users run into this, we better put stronger protection. diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -497,6 +497,9 @@ class revlog(object): else: raise error.RevlogError(_('unknown version (%d) in revlog %s') % (fmt, self.indexfile)) +# sparse-revlog can't be on without general-delta (issue6056) +if not self._generaldelta: +self._sparserevlog = False self._storedeltachains = True ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5630: remotefilelog: remove pointless return statement from constructor
This revision was automatically updated to reflect the committed changes. Closed by commit rHG784ab13b340f: remotefilelog: remove pointless return statement from constructor (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5630?vs=13319=13448 REVISION DETAIL https://phab.mercurial-scm.org/D5630 AFFECTED FILES hgext/remotefilelog/remotefilectx.py CHANGE DETAILS diff --git a/hgext/remotefilelog/remotefilectx.py b/hgext/remotefilelog/remotefilectx.py --- a/hgext/remotefilelog/remotefilectx.py +++ b/hgext/remotefilelog/remotefilectx.py @@ -452,8 +452,8 @@ class remoteworkingfilectx(context.workingfilectx, remotefilectx): def __init__(self, repo, path, filelog=None, workingctx=None): self._ancestormap = None -return super(remoteworkingfilectx, self).__init__(repo, path, -filelog, workingctx) +super(remoteworkingfilectx, self).__init__(repo, path, filelog, + workingctx) def parents(self): return remotefilectx.parents(self) 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
D5632: setdiscovery: pass srvheads into partialdiscovery constructor
martinvonz planned changes to this revision. martinvonz added a comment. This needs updating since it conflicts with changes made on the stable branch. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5632 To: martinvonz, #hg-reviewers, lothiraldan Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5694: cmdutil: drop obsolete comment about updating to '.'
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Obsolete since https://phab.mercurial-scm.org/rHGcf68e2649e0ae0fce4bdb091a202d580a96a8233 (status: advertise --abort instead of 'update -C .' to abort a merge, 2018-08-09) and https://phab.mercurial-scm.org/rHG5b04b620493197503c020740ef48c93c49b26b69 (status: advertise --abort instead of 'update -C .' to abort graft, 2018-08-09). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5694 AFFECTED FILES mercurial/cmdutil.py CHANGE DETAILS diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -607,11 +607,9 @@ return _helpmessage('hg unshelve --continue', 'hg unshelve --abort') def _graftmsg(): -# tweakdefaults requires `update` to have a rev hence the `.` return _helpmessage('hg graft --continue', 'hg graft --abort') def _mergemsg(): -# tweakdefaults requires `update` to have a rev hence the `.` return _helpmessage('hg commit', 'hg merge --abort') def _bisectmsg(): 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
Re: [PATCH 4 of 4] revset: no longer silently filter out invalid revision in _intlist (API) (BC)
On Fri, 18 Jan 2019 16:53:19 +0100, Boris Feld wrote: > # HG changeset patch > # User Boris Feld > # Date 1547826690 -3600 > # Fri Jan 18 16:51:30 2019 +0100 > # Node ID 43543a826aab4e6495694f84e9197b903a7cbf10 > # Parent aa032edd96aeb34f8d220b11fbdbd08a9497cbc9 > # EXP-Topic intlist > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > 43543a826aab > revset: no longer silently filter out invalid revision in _intlist (API) (BC) > > This change makes the fastpath (fullrepo case) evaluated first, so invalid > revision in the _intlist() entries will be simply forwarded to the lower layer > in this case. This is similar to what 'rawsmartet' does in the case where > "%ld" did not get serialized. > > Further processing of the resulting smartset is likely to raise an error > because of the filtering. Well, I think it could lead to crash because revlog may raise IndexError for example. Unlike the fastpath smartset, users can pass in any integers to %ld, so the situation is different. > It would be possible to strictly check for any invalid entry in the input > revs, but we have not decided on doing this yet. > > This series focuses on having a consistent behavior for %d and %ld in all > cases. > > diff --git a/mercurial/revset.py b/mercurial/revset.py > --- a/mercurial/revset.py > +++ b/mercurial/revset.py > @@ -2179,7 +2179,7 @@ def _orderedlist(repo, subset, x): > for r in revs: > if r in seen: > continue > -if (r in subset or full and (r == nullrev or r == wdirrev)): > +if (full and (r == nullrev or r == wdirrev)) or r in subset: Maybe you wanted to remove 'and (r == nullrev or r == wdirrev)'? Anyway, this is the function for '%ls'. You'll need to update the _intlist() function. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 3 of 4] revset: add wdir support to _intlist
On Fri, 18 Jan 2019 16:53:18 +0100, Boris Feld wrote: > # HG changeset patch > # User Boris Feld > # Date 1547826678 -3600 > # Fri Jan 18 16:51:18 2019 +0100 > # Node ID aa032edd96aeb34f8d220b11fbdbd08a9497cbc9 > # Parent 35c9dec1849f6a41f87fdc130798387376bb8345 > # EXP-Topic intlist > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > aa032edd96ae > revset: add wdir support to _intlist > > The previous changeset made it clear that we did not supported the wdirrev in > _intlist. So we fix it. > > diff --git a/mercurial/revset.py b/mercurial/revset.py > --- a/mercurial/revset.py > +++ b/mercurial/revset.py > @@ -2174,11 +2174,12 @@ def _orderedlist(repo, subset, x): > > full = isinstance(subset, fullreposet) > nullrev = node.nullrev > +wdirrev = node.wdirrev > > for r in revs: > if r in seen: > continue > -if (r in subset or full and r == nullrev): > +if (r in subset or full and (r == nullrev or r == wdirrev)): So this is the _list() function used for '%ls' or 'x + y + ...' expression, where wdir revision will never appear since it can't be a valid symbol/string as of now. It's somewhat consistent how stringset() ignores wdirrev/node. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH V7] revset: support ranges in #generations relation
On Thu, 24 Jan 2019 15:22:41 +0800, Anton Shestakov wrote: > # HG changeset patch > # User Anton Shestakov > # Date 1547564229 -28800 > # Tue Jan 15 22:57:09 2019 +0800 > # Node ID 91c4c66050f0b6acba6fe90e1d759165ddffd0d0 > # Parent 8aca89a694d4bd7d25877b3652fb83e187ea1802 > revset: support ranges in #generations relation Queued this version, thanks. > +def _splitrange(a, b): > +""" Split range with bounds a and b into two ranges at 0 and return two > +lists of numbers for use as startdepth and stopdepth arguments of > +_ancestors and _descendants. Updated the docstring accordingly. > def relsubscriptset(repo, subset, x, y, z, order): > # this is pretty basic implementation of 'x#y[z]' operator, still > # experimental so undocumented. see the wiki for further ideas. > # https://www.mercurial-scm.org/wiki/RevsetOperatorPlan > rel = getsymbol(y) > -n = getinteger(z, _("relation subscript must be an integer")) > +try: > +a, b = getrange(z, '') > +except error.ParseError: > +a = getinteger(z, _("relation subscript must be an integer")) > +b = a > +else: > +def getbound(i): > +if i is None: > +return None > +msg = _("relation subscript bounds must be integers") > +return getinteger(i, msg) > +a, b = [getbound(i) for i in (a, b)] > +if a is None: > +a = -(dagop.maxlogdepth - 1) > +if b is None: > +b = +(dagop.maxlogdepth - 1) I think this should belong to generationsrel() since not all subscript operations would want (maxlogdepth - 1) in place of None. Can you send a follow up? > + $ log '6#generations[0:1]' > + 6 > + 7 > + $ log '6#generations[-1:1]' > + 4 > + 5 > + 6 > + 7 > + $ log '6#generations[0:]' > + 6 > + 7 > + $ log '5#generations[:0]' > + 0 > + 1 > + 3 > + 5 > + $ log '3#generations[:]' > + 0 > + 1 > + 3 > + 5 > + 6 > + 7 Better to test [1:-1] here because we have "if" to avoid UnboundLocal error. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5674: tests: fix module-import warnings in test-update-atomic.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHG0a0927f7549d: tests: fix module-import warnings in test-update-atomic.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5674?vs=13392=13446 REVISION DETAIL https://phab.mercurial-scm.org/D5674 AFFECTED FILES tests/test-update-atomic.t CHANGE DETAILS diff --git a/tests/test-update-atomic.t b/tests/test-update-atomic.t --- a/tests/test-update-atomic.t +++ b/tests/test-update-atomic.t @@ -4,9 +4,10 @@ $ cat > $TESTTMP/show_mode.py < from __future__ import print_function + > import os + > import stat > import sys - > import os - > from stat import ST_MODE + > ST_MODE = stat.ST_MODE > > for file_path in sys.argv[1:]: > file_stat = os.stat(file_path) To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5673: py3: use dict.items() instead of dict.iteritems() in tests/test-lfs-server.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHGdafd13c7237b: py3: use dict.items() instead of dict.iteritems() in tests/test-lfs-server.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5673?vs=13391=13445 REVISION DETAIL https://phab.mercurial-scm.org/D5673 AFFECTED FILES tests/test-lfs-serve.t CHANGE DETAILS diff --git a/tests/test-lfs-serve.t b/tests/test-lfs-serve.t --- a/tests/test-lfs-serve.t +++ b/tests/test-lfs-serve.t @@ -51,7 +51,7 @@ > opts[b'manifest'] = False > opts[b'dir'] = False > rl = cmdutil.openrevlog(repo, b'debugprocessors', file_, opts) - > for flag, proc in rl._flagprocessors.iteritems(): + > for flag, proc in rl._flagprocessors.items(): > ui.status(b"registered processor '%#x'\n" % (flag)) > EOF To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5672: py3: add b'' prefixes in tests/test-lfs-serve.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHG23c80ce166f1: py3: add b prefixes in tests/test-lfs-serve.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5672?vs=13390=13444 REVISION DETAIL https://phab.mercurial-scm.org/D5672 AFFECTED FILES tests/test-lfs-serve.t CHANGE DETAILS diff --git a/tests/test-lfs-serve.t b/tests/test-lfs-serve.t --- a/tests/test-lfs-serve.t +++ b/tests/test-lfs-serve.t @@ -110,14 +110,14 @@ ... def diff(server): ... readchannel(server) ... # run an arbitrary command in the repo with the extension loaded - ... runcommand(server, ['id', '-R', '../cmdservelfs']) + ... runcommand(server, [b'id', b'-R', b'../cmdservelfs']) ... # now run a command in a repo without the extension to ensure that ... # files are added safely.. - ... runcommand(server, ['ci', '-Aqm', 'non-lfs']) + ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs']) ... # .. and that scmutil.prefetchfiles() safely no-ops.. - ... runcommand(server, ['diff', '-r', '.~1']) + ... runcommand(server, [b'diff', b'-r', b'.~1']) ... # .. and that debugupgraderepo safely no-ops. - ... runcommand(server, ['debugupgraderepo', '-q', '--run']) + ... runcommand(server, [b'debugupgraderepo', b'-q', b'--run']) *** runcommand id -R ../cmdservelfs tip *** runcommand ci -Aqm non-lfs @@ -257,12 +257,12 @@ ... def addrequirement(server): ... readchannel(server) ... # change the repo in a way that adds the lfs requirement - ... runcommand(server, ['pull', '-qu']) + ... runcommand(server, [b'pull', b'-qu']) ... # Now cause the requirement adding hook to fire again, without going ... # through reposetup() again. ... with open('file.txt', 'wb') as fp: - ... fp.write('data') - ... runcommand(server, ['ci', '-Aqm', 'non-lfs']) + ... fp.write(b'data') + ... runcommand(server, [b'ci', b'-Aqm', b'non-lfs']) *** runcommand pull -qu *** runcommand ci -Aqm non-lfs @@ -365,16 +365,16 @@ ... readchannel(server) ... print('') ... print('# LFS required- both lfs and non-lfs revlogs have 0x2000 flag') - ... runcommand(server, ['debugprocessors', 'lfs.bin', '-R', - ...'../server']) - ... runcommand(server, ['debugprocessors', 'nonlfs2.txt', '-R', - ...'../server']) - ... runcommand(server, ['config', 'extensions', '--cwd', - ...'../server']) + ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R', + ...b'../server']) + ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R', + ...b'../server']) + ... runcommand(server, [b'config', b'extensions', b'--cwd', + ...b'../server']) ... ... print("\n# LFS not enabled- revlogs don't have 0x2000 flag") - ... runcommand(server, ['debugprocessors', 'nonlfs3.txt']) - ... runcommand(server, ['config', 'extensions']) + ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt']) + ... runcommand(server, [b'config', b'extensions']) # LFS required- both lfs and non-lfs revlogs have 0x2000 flag *** runcommand debugprocessors lfs.bin -R ../server @@ -409,16 +409,16 @@ ... readchannel(server) ... print('') ... print('# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag') - ... runcommand(server, ['debugprocessors', 'lfs.bin', '-R', - ...'../server']) - ... runcommand(server, ['debugprocessors', 'nonlfs2.txt', '-R', - ...'../server']) - ... runcommand(server, ['config', 'extensions', '--cwd', - ...'../server']) + ... runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R', + ...b'../server']) + ... runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R', + ...b'../server']) + ... runcommand(server, [b'config', b'extensions', b'--cwd', + ...b'../server']) ... ... print('\n# LFS enabled without requirement- revlogs have 0x2000 flag') - ... runcommand(server, ['debugprocessors', 'nonlfs3.txt']) - ... runcommand(server, ['config', 'extensions']) + ... runcommand(server, [b'debugprocessors', b'nonlfs3.txt']) + ... runcommand(server, [b'config', b'extensions']) ... ... print("\n# LFS disabled locally- revlogs don't have 0x2000 flag") ... runcommand(server, ['debugprocessors', 'nonlfs.txt', '-R', To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5689: tests: remove some over-globbing in test-dispatch.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHG93a7539a546e: tests: remove some over-globbing in test-dispatch.t (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5689?vs=13431=13442 REVISION DETAIL https://phab.mercurial-scm.org/D5689 AFFECTED FILES tests/test-dispatch.t CHANGE DETAILS diff --git a/tests/test-dispatch.t b/tests/test-dispatch.t --- a/tests/test-dispatch.t +++ b/tests/test-dispatch.t @@ -188,7 +188,7 @@ specified" should include filename even when it is empty $ hg -R a archive '' - abort: *: '' (glob) + abort: $ENOENT$: '' [255] #if no-outer-repo 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
D5670: py3: add b'' prefixes in doc/check-seclevel.py
This revision was automatically updated to reflect the committed changes. Closed by commit rHG77763dc5b07b: py3: add b prefixes in doc/check-seclevel.py (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5670?vs=13388=13443 REVISION DETAIL https://phab.mercurial-scm.org/D5670 AFFECTED FILES doc/check-seclevel.py CHANGE DETAILS diff --git a/doc/check-seclevel.py b/doc/check-seclevel.py --- a/doc/check-seclevel.py +++ b/doc/check-seclevel.py @@ -163,8 +163,8 @@ (options, args) = optparser.parse_args() ui = uimod.ui.load() -ui.setconfig('ui', 'verbose', options.verbose, '--verbose') -ui.setconfig('ui', 'debug', options.debug, '--debug') +ui.setconfig(b'ui', b'verbose', options.verbose, b'--verbose') +ui.setconfig(b'ui', b'debug', options.debug, b'--debug') if options.file: if checkfile(ui, options.file, options.initlevel): To: 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@41347: 39 new changesets
39 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/afc33a5705b9 changeset: 41309:afc33a5705b9 parent: 41302:a322dbee4eda user:Augie Fackler date:Tue Jan 22 11:18:05 2019 -0500 summary: fuzz: don't allow enormous revlog inputs either https://www.mercurial-scm.org/repo/hg/rev/ebe51a2e75be changeset: 41310:ebe51a2e75be user:Augie Fackler date:Tue Jan 22 11:02:10 2019 -0500 summary: fuzz: exercise more of the revlog API https://www.mercurial-scm.org/repo/hg/rev/44cd432aed9f changeset: 41311:44cd432aed9f user:Augie Fackler date:Tue Jan 22 11:41:09 2019 -0500 summary: fuzz: restrict manifest input size https://www.mercurial-scm.org/repo/hg/rev/d60bd5c71cbb changeset: 41312:d60bd5c71cbb user:Augie Fackler date:Tue Jan 22 11:41:22 2019 -0500 summary: fuzz: exercise more of the lazymanifest code https://www.mercurial-scm.org/repo/hg/rev/d3cc9a8df63a changeset: 41313:d3cc9a8df63a user:Gregory Szorc date:Tue Jan 22 16:53:24 2019 -0800 summary: tests: add b'' to test-missing-capability.t https://www.mercurial-scm.org/repo/hg/rev/15fd3069caa6 changeset: 41314:15fd3069caa6 user:Gregory Szorc date:Tue Jan 22 16:54:56 2019 -0800 summary: tests: add b'' to notcapable https://www.mercurial-scm.org/repo/hg/rev/a9b609fbe39c changeset: 41315:a9b609fbe39c user:Gregory Szorc date:Tue Jan 22 16:58:48 2019 -0800 summary: httppeer: use %s for formatting https://www.mercurial-scm.org/repo/hg/rev/8df3471931cc changeset: 41316:8df3471931cc user:Gregory Szorc date:Tue Jan 22 17:02:40 2019 -0800 summary: tests: add size and hash for Python 3 https://www.mercurial-scm.org/repo/hg/rev/4ad002b2584d changeset: 41317:4ad002b2584d user:Gregory Szorc date:Tue Jan 22 17:08:53 2019 -0800 summary: config: reject str sections and keys on Python 3 https://www.mercurial-scm.org/repo/hg/rev/6e54caaed08d changeset: 41318:6e54caaed08d user:Gregory Szorc date:Tue Jan 22 17:50:52 2019 -0800 summary: tests: normalize to bytes in test-install.t https://www.mercurial-scm.org/repo/hg/rev/46781c1b5049 changeset: 41319:46781c1b5049 user:Gregory Szorc date:Tue Jan 22 18:07:51 2019 -0800 summary: hgweb: don't use raw string for session vars https://www.mercurial-scm.org/repo/hg/rev/f790a4e78e97 changeset: 41320:f790a4e78e97 user:Gregory Szorc date:Tue Jan 22 18:11:34 2019 -0800 summary: tests: add setsockopt() output on Python 3 https://www.mercurial-scm.org/repo/hg/rev/724b4606528e changeset: 41321:724b4606528e user:Gregory Szorc date:Tue Jan 22 18:16:53 2019 -0800 summary: tests: use assertEqual() https://www.mercurial-scm.org/repo/hg/rev/4ef28d7e22ae changeset: 41322:4ef28d7e22ae user:Gregory Szorc date:Tue Jan 22 18:23:47 2019 -0800 summary: tests: make filenames bytes for Python 3 https://www.mercurial-scm.org/repo/hg/rev/abac73eedd4d changeset: 41323:abac73eedd4d user:Gregory Szorc date:Tue Jan 22 18:24:52 2019 -0800 summary: tests: use bytes for file I/O https://www.mercurial-scm.org/repo/hg/rev/3d685ddf6b64 changeset: 41324:3d685ddf6b64 user:Gregory Szorc date:Tue Jan 22 18:25:34 2019 -0800 summary: remotefilelog: use %d to format an int https://www.mercurial-scm.org/repo/hg/rev/eff0a7d3229c changeset: 41325:eff0a7d3229c user:Gregory Szorc date:Wed Jan 23 17:26:00 2019 -0800 summary: hgweb: ensure template mapping keys are bytes https://www.mercurial-scm.org/repo/hg/rev/7c54357be2ae changeset: 41326:7c54357be2ae user:Gregory Szorc date:Wed Jan 23 16:22:54 2019 -0800 summary: tests: normalize XML values to bytes https://www.mercurial-scm.org/repo/hg/rev/1281b2265ff5 changeset: 41327:1281b2265ff5 user:Gregory Szorc date:Wed Jan 23 16:21:36 2019 -0800 summary: convert: use raw strings for XML strings https://www.mercurial-scm.org/repo/hg/rev/13ccb03f2145 changeset: 41328:13ccb03f2145 user:Gregory Szorc date:Wed Jan 23 17:41:46 2019 -0800 summary: tests: handle string escaping/encoding on Python 3 https://www.mercurial-scm.org/repo/hg/rev/84707d9e77a0 changeset: 41329:84707d9e77a0 user:Gregory Szorc date:Wed Jan 23 17:45:11 2019 -0800 summary: tests: write directly to stdout to avoid b'' prefixes https://www.mercurial-scm.org/repo/hg/rev/d5c58d679ed9 changeset: 41330:d5c58d679ed9 user:Gregory Szorc date:Wed Jan 23 17:57:43 2019 -0800 summary: tests: support URL quoting on Python 3 https://www.mercurial-scm.org/repo/hg/rev/56a0de3d581c changeset: 41331:56a0de3d581c user:Martin von Zweigbergk date:Wed Jan 16 17:04:50 2019 -0800 summary: tests: drop a duplicate definition of a constant
D5690: py3: use regular expression to deal with ENOENT formatting change
yuja added a comment. > $ hg log -b --cwd=inexistent default > > - abort: $ENOENT$: 'inexistent' + abort: \$ENOENT\$: ('inexistent'|inexistent) (re) That's our fault. The exception is caught as IOError on Python 3, and our formatting of IOError and OSError are slightly different! Maybe we should unify them. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5690 To: durin42, #hg-reviewers, pulkit Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 2 of 3 STABLE] rust: error for WdirUnsupported with cpython conversion as exception
On Wed, 23 Jan 2019 23:23:52 -0500, Georges Racinet wrote: > # HG changeset patch > # User Georges Racinet > # Date 1548247624 18000 > # Wed Jan 23 07:47:04 2019 -0500 > # Branch stable > # Node ID a35cfd592a90ae325b452c56fe8bff86cac097dd > # Parent 56b74abf5ee6df48ec2debf1f004725cfcc93854 > # EXP-Topic rust-wdirunsupported > rust: error for WdirUnsupported with cpython conversion as exception > @@ -22,6 +24,15 @@ > hg::GraphError::ParentOutOfRange(r) => { > GraphError::new(py, ("ParentOutOfRange", r)) > } > +hg::GraphError::WorkingDirectoryUnsupported => { > +match py > +.import("mercurial.error") > +.and_then(|m| m.get(py, "WdirUnsupported")) > +{ > +Err(e) => e, > +Ok(cls) => PyErr::from_instance(py, cls), > +} Can be spelled as .map(|cls| ...).unwrap_or_else(|e| e) if you prefer method chain. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel