Re: D5961: copies: add test that makes both the merging csets dirty and run w/o error
That's totally fine, reviews it when you have time. Thanks :) On Thu 28 Feb, 2019, 6:08 AM martinvonz (Martin von Zweigbergk) < phabrica...@mercurial-scm.org wrote: > martinvonz added a comment. > > > In https://phab.mercurial-scm.org/D5961#87961, @khanchi97 wrote: > > > @martinvonz I have moved the tests in `test-copies.t` > > > Thanks. https://phab.mercurial-scm.org/D5963 seems more complicated, so > I'll review this series when I can find a larger chunk of time (this week > has been extremely busy). > > REPOSITORY > rHG Mercurial > > REVISION DETAIL > https://phab.mercurial-scm.org/D5961 > > To: khanchi97, #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-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6033: py3: convert return values of inspect.getabsfile() to bytes
This revision was automatically updated to reflect the committed changes. Closed by commit rHG78027e7bc544: py3: convert return values of inspect.getabsfile() to bytes (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6033?vs=14260=14269 REVISION DETAIL https://phab.mercurial-scm.org/D6033 AFFECTED FILES mercurial/chgserver.py CHANGE DETAILS diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py --- a/mercurial/chgserver.py +++ b/mercurial/chgserver.py @@ -140,7 +140,7 @@ files = [pycompat.sysexecutable] for m in modules: try: -files.append(inspect.getabsfile(m)) +files.append(pycompat.fsencode(inspect.getabsfile(m))) except TypeError: pass return sorted(set(files)) 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
D6032: py3: add two new passing tests found by buildbot
This revision was automatically updated to reflect the committed changes. Closed by commit rHGc7fc463b8e8e: py3: add two new passing tests found by buildbot (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6032?vs=14258=14268 REVISION DETAIL https://phab.mercurial-scm.org/D6032 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 @@ -127,6 +127,7 @@ test-convert-svn-sink.t test-convert-tagsbranch-topology.t test-convert.t +test-copies.t test-copy-move-merge.t test-copy.t test-copytrace-heuristics.t @@ -512,6 +513,7 @@ test-pathencode.py test-pending.t test-permissions.t +test-phase-archived.t test-phases-exchange.t test-phases.t test-profile.t 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
D6036: absorb: let scmutil.cleanupnodes() take care of setting phase
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb38c7304974f: absorb: let scmutil.cleanupnodes() take care of setting phase (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6036?vs=14263=14266 REVISION DETAIL https://phab.mercurial-scm.org/D6036 AFFECTED FILES hgext/absorb.py CHANGE DETAILS diff --git a/hgext/absorb.py b/hgext/absorb.py --- a/hgext/absorb.py +++ b/hgext/absorb.py @@ -848,10 +848,7 @@ if self._useobsolete and self.ui.configbool('absorb', 'add-noise'): extra['absorb_source'] = ctx.hex() mctx = overlaycontext(memworkingcopy, ctx, parents, extra=extra) -# preserve phase -with mctx.repo().ui.configoverride({ -('phases', 'new-commit'): ctx.phase()}): -return mctx.commit() +return mctx.commit() @util.propertycache def _useobsolete(self): @@ -862,7 +859,8 @@ replacements = {k: ([v] if v is not None else []) for k, v in self.replacemap.iteritems()} if replacements: -scmutil.cleanupnodes(self.repo, replacements, operation='absorb') +scmutil.cleanupnodes(self.repo, replacements, operation='absorb', + fixphase=True) def _parsechunk(hunk): """(crecord.uihunk or patch.recordhunk) -> (path, (a1, a2, [bline]))""" 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
D6035: absorb: use scmutil.cleanupnodes() also when obsmarkers are disabled
This revision was automatically updated to reflect the committed changes. Closed by commit rHGc91321e86071: absorb: use scmutil.cleanupnodes() also when obsmarkers are disabled (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6035?vs=14262=14265 REVISION DETAIL https://phab.mercurial-scm.org/D6035 AFFECTED FILES hgext/absorb.py tests/test-absorb-strip.t CHANGE DETAILS diff --git a/tests/test-absorb-strip.t b/tests/test-absorb-strip.t --- a/tests/test-absorb-strip.t +++ b/tests/test-absorb-strip.t @@ -23,6 +23,7 @@ $ echo 1 >> B $ echo 2 >> D $ hg absorb -a + warning: orphaned descendants detected, not stripping 112478962961, 26805aba1e60 saved backup bundle to * (glob) 2 of 2 chunk(s) applied diff --git a/hgext/absorb.py b/hgext/absorb.py --- a/hgext/absorb.py +++ b/hgext/absorb.py @@ -50,7 +50,6 @@ phases, pycompat, registrar, -repair, scmutil, util, ) @@ -690,9 +689,9 @@ if self.repo['.'].node() in self.replacemap: self._moveworkingdirectoryparent() if self._useobsolete: -self._obsoleteoldcommits() +self._cleanupoldcommits() if not self._useobsolete: # strip must be outside transactions -self._stripoldcommits() +self._cleanupoldcommits() return self.finalnode def printchunkstats(self): @@ -859,22 +858,12 @@ """() -> bool""" return obsolete.isenabled(self.repo, obsolete.createmarkersopt) -def _obsoleteoldcommits(self): +def _cleanupoldcommits(self): replacements = {k: ([v] if v is not None else []) for k, v in self.replacemap.iteritems()} if replacements: scmutil.cleanupnodes(self.repo, replacements, operation='absorb') -def _stripoldcommits(self): -nodelist = self.replacemap.keys() -# make sure we don't strip innocent children -revs = self.repo.revs('%ln - (::(heads(%ln::)-%ln))', nodelist, - nodelist, nodelist) -tonode = self.repo.changelog.node -nodelist = [tonode(r) for r in revs] -if nodelist: -repair.strip(self.repo.ui, self.repo, nodelist) - def _parsechunk(hunk): """(crecord.uihunk or patch.recordhunk) -> (path, (a1, a2, [bline]))""" if type(hunk) not in (crecord.uihunk, patch.recordhunk): 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
D6031: py3: make contrib/debugshell.py work with Python 3
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb10bbbe995eb: py3: make contrib/debugshell.py work with Python 3 (authored by pulkit, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D6031?vs=14257=14267#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6031?vs=14257=14267 REVISION DETAIL https://phab.mercurial-scm.org/D6031 AFFECTED FILES contrib/debugshell.py CHANGE DETAILS diff --git a/contrib/debugshell.py b/contrib/debugshell.py --- a/contrib/debugshell.py +++ b/contrib/debugshell.py @@ -7,6 +7,7 @@ import sys from mercurial import ( demandimport, +pycompat, registrar, ) @@ -32,28 +33,30 @@ IPython.embed() -@command('debugshell|dbsh', []) +@command(b'debugshell|dbsh', []) def debugshell(ui, repo, **opts): bannermsg = ("loaded repo : %s\n" - "using source: %s" % (repo.root, + "using source: %s" % (pycompat.sysstr(repo.root), mercurial.__path__[0])) pdbmap = { 'pdb' : 'code', 'ipdb' : 'IPython' } -debugger = ui.config("ui", "debugger") +debugger = ui.config(b"ui", b"debugger") if not debugger: debugger = 'pdb' +else: +debugger = pycompat.sysstr(debugger) # if IPython doesn't exist, fallback to code.interact try: with demandimport.deactivated(): __import__(pdbmap[debugger]) except ImportError: -ui.warn(("%s debugger specified but %s module was not found\n") +ui.warn((b"%s debugger specified but %s module was not found\n") % (debugger, pdbmap[debugger])) -debugger = 'pdb' +debugger = b'pdb' getattr(sys.modules[__name__], debugger)(ui, repo, bannermsg, **opts) 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
D6034: absorb: use scmutil.cleanupnodes() so operation gets set
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa008e0af892e: absorb: use scmutil.cleanupnodes() so operation gets set (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6034?vs=14261=14264 REVISION DETAIL https://phab.mercurial-scm.org/D6034 AFFECTED FILES hgext/absorb.py CHANGE DETAILS diff --git a/hgext/absorb.py b/hgext/absorb.py --- a/hgext/absorb.py +++ b/hgext/absorb.py @@ -860,10 +860,10 @@ return obsolete.isenabled(self.repo, obsolete.createmarkersopt) def _obsoleteoldcommits(self): -relations = [(self.repo[k], v and (self.repo[v],) or ()) - for k, v in self.replacemap.iteritems()] -if relations: -obsolete.createmarkers(self.repo, relations) +replacements = {k: ([v] if v is not None else []) +for k, v in self.replacemap.iteritems()} +if replacements: +scmutil.cleanupnodes(self.repo, replacements, operation='absorb') def _stripoldcommits(self): nodelist = self.replacemap.keys() 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
D5296: store: don't read the whole fncache in memory
yuja added a comment. > - self.entries = set(decodedir(fp.read()).splitlines()) + + self.entries = [] +totalsize = self.vfs.stat('fncache').st_size I don't think `totalsize` has to be stat()ed. We can just loop over until `fp.read()` reaches to EOF. It's unreliable to assume that the stat('fncache') see the identical file to the `fp` open()ed before. > +chunksize = (10 ** 6) # 1 MB > +chunk = b'' > +chunksize = min(totalsize, chunksize) Do we have any test covering `totalsize > chunksize` case? > +totalsize -= chunksize > +while chunksize: > +chunk += fp.read(chunksize) > +try: > +p = chunk.rindex(b'\n') > +self.entries.extend(decodedir(chunk[:p + 1]).splitlines()) Any reason to not build a `set` directly? > +chunk = chunk[p + 1:] > +except ValueError: > +# substring '\n' not found, maybe the entry is bigger than the > +# chunksize, so let's keep iterating > +pass > +chunksize = min(totalsize, chunksize) > +totalsize -= chunksize > + > +self.entries = set(self.entries) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5296 To: pulkit, #hg-reviewers Cc: indygreg, yuja, mjpieters, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5296: store: don't read the whole fncache in memory
> -self.entries = set(decodedir(fp.read()).splitlines()) > + > +self.entries = [] > +totalsize = self.vfs.stat('fncache').st_size I don't think `totalsize` has to be stat()ed. We can just loop over until `fp.read()` reaches to EOF. It's unreliable to assume that the stat('fncache') see the identical file to the `fp` open()ed before. > +chunksize = (10 ** 6) # 1 MB > +chunk = b'' > +chunksize = min(totalsize, chunksize) Do we have any test covering `totalsize > chunksize` case? > +totalsize -= chunksize > +while chunksize: > +chunk += fp.read(chunksize) > +try: > +p = chunk.rindex(b'\n') > +self.entries.extend(decodedir(chunk[:p + 1]).splitlines()) Any reason to not build a `set` directly? > +chunk = chunk[p + 1:] > +except ValueError: > +# substring '\n' not found, maybe the entry is bigger than > the > +# chunksize, so let's keep iterating > +pass > +chunksize = min(totalsize, chunksize) > +totalsize -= chunksize > + > +self.entries = set(self.entries) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH FOLLOW-UP] test: follow-up on 1c4d6ab2ecb8, stabilize test-remotefilelog-bgprefetch.t
On Mon, 25 Feb 2019 09:08:51 +0100, Boris Feld wrote: > # HG changeset patch > # User Boris Feld > # Date 1551081749 -3600 > # lun. févr. 25 09:02:29 2019 +0100 > # Node ID f611bf911c863d35aced20dfb2546725c911a722 > # Parent 1c1c4ef8b72e39f5ed1c62dc4e31e02e9e08b652 > # EXP-Topic stabilize-test-remotefilelog-bgprefetch.t > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > f611bf911c86 > test: follow-up on 1c4d6ab2ecb8, stabilize test-remotefilelog-bgprefetch.t Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] tests: add more wildcards to test-extdiff.t
On Mon, 25 Feb 2019 21:21:41 -0500, Matt Harbison wrote: > # HG changeset patch > # User Matt Harbison > # Date 1551147016 18000 > # Mon Feb 25 21:10:16 2019 -0500 > # Node ID 6ec63ae7b61f0bf5e14c208667c484a4f589c991 > # Parent 68bbcc70e27476fbfa3cc6aada1a99ce39c1306b > tests: add more wildcards to test-extdiff.t Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6036: absorb: let scmutil.cleanupnodes() take care of setting phase
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/D6036 AFFECTED FILES hgext/absorb.py CHANGE DETAILS diff --git a/hgext/absorb.py b/hgext/absorb.py --- a/hgext/absorb.py +++ b/hgext/absorb.py @@ -848,10 +848,7 @@ if self._useobsolete and self.ui.configbool('absorb', 'add-noise'): extra['absorb_source'] = ctx.hex() mctx = overlaycontext(memworkingcopy, ctx, parents, extra=extra) -# preserve phase -with mctx.repo().ui.configoverride({ -('phases', 'new-commit'): ctx.phase()}): -return mctx.commit() +return mctx.commit() @util.propertycache def _useobsolete(self): @@ -862,7 +859,8 @@ replacements = {k: ([v] if v is not None else []) for k, v in self.replacemap.iteritems()} if replacements: -scmutil.cleanupnodes(self.repo, replacements, operation='absorb') +scmutil.cleanupnodes(self.repo, replacements, operation='absorb', + fixphase=True) def _parsechunk(hunk): """(crecord.uihunk or patch.recordhunk) -> (path, (a1, a2, [bline]))""" 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
D6035: absorb: use scmutil.cleanupnodes() also when obsmarkers are disabled
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY A side-effect of this is the new warning in the test case, but the warning is valid, so I don't think that's a problem. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6035 AFFECTED FILES hgext/absorb.py tests/test-absorb-strip.t CHANGE DETAILS diff --git a/tests/test-absorb-strip.t b/tests/test-absorb-strip.t --- a/tests/test-absorb-strip.t +++ b/tests/test-absorb-strip.t @@ -23,6 +23,7 @@ $ echo 1 >> B $ echo 2 >> D $ hg absorb -a + warning: orphaned descendants detected, not stripping 112478962961, 26805aba1e60 saved backup bundle to * (glob) 2 of 2 chunk(s) applied diff --git a/hgext/absorb.py b/hgext/absorb.py --- a/hgext/absorb.py +++ b/hgext/absorb.py @@ -50,7 +50,6 @@ phases, pycompat, registrar, -repair, scmutil, util, ) @@ -690,9 +689,9 @@ if self.repo['.'].node() in self.replacemap: self._moveworkingdirectoryparent() if self._useobsolete: -self._obsoleteoldcommits() +self._cleanupoldcommits() if not self._useobsolete: # strip must be outside transactions -self._stripoldcommits() +self._cleanupoldcommits() return self.finalnode def printchunkstats(self): @@ -859,22 +858,12 @@ """() -> bool""" return obsolete.isenabled(self.repo, obsolete.createmarkersopt) -def _obsoleteoldcommits(self): +def _cleanupoldcommits(self): replacements = {k: ([v] if v is not None else []) for k, v in self.replacemap.iteritems()} if replacements: scmutil.cleanupnodes(self.repo, replacements, operation='absorb') -def _stripoldcommits(self): -nodelist = self.replacemap.keys() -# make sure we don't strip innocent children -revs = self.repo.revs('%ln - (::(heads(%ln::)-%ln))', nodelist, - nodelist, nodelist) -tonode = self.repo.changelog.node -nodelist = [tonode(r) for r in revs] -if nodelist: -repair.strip(self.repo.ui, self.repo, nodelist) - def _parsechunk(hunk): """(crecord.uihunk or patch.recordhunk) -> (path, (a1, a2, [bline]))""" if type(hunk) not in (crecord.uihunk, patch.recordhunk): 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
D5961: copies: add test that makes both the merging csets dirty and run w/o error
martinvonz added a comment. In https://phab.mercurial-scm.org/D5961#87961, @khanchi97 wrote: > @martinvonz I have moved the tests in `test-copies.t` Thanks. https://phab.mercurial-scm.org/D5963 seems more complicated, so I'll review this series when I can find a larger chunk of time (this week has been extremely busy). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5961 To: khanchi97, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6034: absorb: use scmutil.cleanupnodes() so operation gets set
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The operation is useful for e.g. `hg obslog` output. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6034 AFFECTED FILES hgext/absorb.py CHANGE DETAILS diff --git a/hgext/absorb.py b/hgext/absorb.py --- a/hgext/absorb.py +++ b/hgext/absorb.py @@ -860,10 +860,10 @@ return obsolete.isenabled(self.repo, obsolete.createmarkersopt) def _obsoleteoldcommits(self): -relations = [(self.repo[k], v and (self.repo[v],) or ()) - for k, v in self.replacemap.iteritems()] -if relations: -obsolete.createmarkers(self.repo, relations) +replacements = {k: ([v] if v is not None else []) +for k, v in self.replacemap.iteritems()} +if replacements: +scmutil.cleanupnodes(self.repo, replacements, operation='absorb') def _stripoldcommits(self): nodelist = self.replacemap.keys() 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
D6033: py3: convert return values of inspect.getabsfile() to bytes
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It's weird that python docs for inspect does not mention getabsfile(). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6033 AFFECTED FILES mercurial/chgserver.py CHANGE DETAILS diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py --- a/mercurial/chgserver.py +++ b/mercurial/chgserver.py @@ -140,7 +140,7 @@ files = [pycompat.sysexecutable] for m in modules: try: -files.append(inspect.getabsfile(m)) +files.append(pycompat.fsencode(inspect.getabsfile(m))) except TypeError: pass return sorted(set(files)) 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
D6032: py3: add two new passing tests found by buildbot
pulkit 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/D6032 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 @@ -127,6 +127,7 @@ test-convert-svn-sink.t test-convert-tagsbranch-topology.t test-convert.t +test-copies.t test-copy-move-merge.t test-copy.t test-copytrace-heuristics.t @@ -512,6 +513,7 @@ test-pathencode.py test-pending.t test-permissions.t +test-phase-archived.t test-phases-exchange.t test-phases.t test-profile.t 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
D6031: py3: make contrib/debugshell.py work with Python 3
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I changed default mercurial installation of my personal laptop to one installed with python 3.7. debugshell is one of the extension which I have enabled and it was failing. This patch makes debugshell works with Python 3. I found that chg does not work with python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6031 AFFECTED FILES contrib/debugshell.py CHANGE DETAILS diff --git a/contrib/debugshell.py b/contrib/debugshell.py --- a/contrib/debugshell.py +++ b/contrib/debugshell.py @@ -7,6 +7,7 @@ import sys from mercurial import ( demandimport, +pycompat, registrar, ) @@ -32,28 +33,30 @@ IPython.embed() -@command('debugshell|dbsh', []) +@command(b'debugshell|dbsh', []) def debugshell(ui, repo, **opts): bannermsg = ("loaded repo : %s\n" - "using source: %s" % (repo.root, - mercurial.__path__[0])) + "using source: %s" % (pycompat.sysstr(repo.root), +mercurial.__path__[0])) pdbmap = { 'pdb' : 'code', 'ipdb' : 'IPython' } -debugger = ui.config("ui", "debugger") +debugger = ui.config(b"ui", b"debugger") if not debugger: debugger = 'pdb' +else: +debugger = pycompat.sysstr(debugger) # if IPython doesn't exist, fallback to code.interact try: with demandimport.deactivated(): __import__(pdbmap[debugger]) except ImportError: -ui.warn(("%s debugger specified but %s module was not found\n") +ui.warn((b"%s debugger specified but %s module was not found\n") % (debugger, pdbmap[debugger])) -debugger = 'pdb' +debugger = b'pdb' getattr(sys.modules[__name__], debugger)(ui, repo, bannermsg, **opts) 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
D5296: store: don't read the whole fncache in memory
pulkit updated this revision to Diff 14256. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5296?vs=14255=14256 REVISION DETAIL https://phab.mercurial-scm.org/D5296 AFFECTED FILES mercurial/store.py CHANGE DETAILS diff --git a/mercurial/store.py b/mercurial/store.py --- a/mercurial/store.py +++ b/mercurial/store.py @@ -463,7 +463,27 @@ # skip nonexistent file self.entries = set() return -self.entries = set(decodedir(fp.read()).splitlines()) + +self.entries = [] +totalsize = self.vfs.stat('fncache').st_size +chunksize = (10 ** 6) # 1 MB +chunk = b'' +chunksize = min(totalsize, chunksize) +totalsize -= chunksize +while chunksize: +chunk += fp.read(chunksize) +try: +p = chunk.rindex(b'\n') +self.entries.extend(decodedir(chunk[:p + 1]).splitlines()) +chunk = chunk[p + 1:] +except ValueError: +# substring '\n' not found, maybe the entry is bigger than the +# chunksize, so let's keep iterating +pass +chunksize = min(totalsize, chunksize) +totalsize -= chunksize + +self.entries = set(self.entries) self._checkentries(fp) fp.close() To: pulkit, #hg-reviewers Cc: indygreg, yuja, mjpieters, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5296: store: don't read the whole fncache in memory
pulkit added a comment. In https://phab.mercurial-scm.org/D5296#87890, @indygreg wrote: > I suspect https://phab.mercurial-scm.org/rHG9fca5b056c0a2f673aefa64f7ec7488bd9188d9d made things faster because the code before was using 1 I/O operation for every entry. I would also not be surprised if CPython from that era did something very inefficient with regards to line reading. > > The current code is pretty bad because it buffers the entire file content in memory! I agree we should change it. > > I like this patch as written. If profiling shows it to be slow, I think there is room to optimize `util.iterfile()` or even to teach the vfs layer how to efficiently open files for line-based I/O. This is something I could help optimize if needed. > > While I'm here, the fncache file being a newline delimited list of full file paths is kinda ridiculous. We could do much better by using compression and/or a more complicated data structure. It is kinda silly that we have to load this decoded data structure into memory. So if your file on disk is ~100MB, you are going to have a Python set that also consumes ~100MB. That's really not great. I agree. We should either use compression or use a much complicated data structure here. Right now there is no way to check whether an entry exists or not without parsing the whole fncache. It does not affect much on small repositories but on large repositories such as mozilla, the difference of parsing the whole fncache is noticable. We have perffncacheload taking ~4 seconds :/ REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5296 To: pulkit, #hg-reviewers Cc: indygreg, yuja, mjpieters, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5296: store: don't read the whole fncache in memory
pulkit added a comment. In https://phab.mercurial-scm.org/D5296#87892, @yuja wrote: > (resend without the "On ... wrote:" line) > > > Seeing the performance benefit it brings on our repo, I want to try other ways we can do this. Do we like having a conditional which checks the size of fncache and choose one of the approaches depending on how large it is? > > > > If size(fncache) < 50M, use the current approach > > else, use the approach described in this patch > > Suppose the current code is fast because it avoids running Python in loop, > I think it can be extended to not use too much memory. > > chunk = b'' > while True: > chunk += fp.read(chunk_size) # maybe ~10MB? > p = chunk.rindex(b'\n') # need to handle error > decodedir(chunk[:p + 1])... > chunk = chunk[p + 1:] > > > Just an idea. Not profiled. I implemented this idea. It saves ~1 sec on perffncacheload for us when chunksize is taken 1 MB. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5296 To: pulkit, #hg-reviewers Cc: indygreg, yuja, mjpieters, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5962: copies: add test that makes both the merging csets dirty and fails
@martinvonz updated this one too. On Mon, Feb 25, 2019 at 11:01 PM martinvonz (Martin von Zweigbergk) < phabrica...@mercurial-scm.org> wrote: > martinvonz added inline comments. > > INLINE COMMENTS > > > test-copytrace-heuristics.t:931-980 > > + $ hg graft -r 6 --base c9241b0f2d5b --hidden > > + grafting 6:99802e4f1e46 "added willconflict and d" (tip) > > + ** unknown exception encountered, please report by visiting > > + ** https://mercurial-scm.org/wiki/BugTracker > > + ** Python 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609] > > + ** Mercurial Distributed SCM (version 4.8.1+539-b6c610bf567e+20181221) > > + ** Extensions loaded: rebase, shelve > > nit: we usually redirect stderr and grep for the error (`AssertionError` > here) to make it a bit shorter. (besides, the test here with > `/home/khanchi/` paths is clearly not going to pass on most people's > machines) > > REPOSITORY > rHG Mercurial > > REVISION DETAIL > https://phab.mercurial-scm.org/D5962 > > To: khanchi97, #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-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5961: copies: add test that makes both the merging csets dirty and run w/o error
@martinvonz I have moved the tests in `test-copies.t` On Mon, Feb 25, 2019 at 10:58 PM martinvonz (Martin von Zweigbergk) < phabrica...@mercurial-scm.org> wrote: > martinvonz added inline comments. > > INLINE COMMENTS > > > test-copytrace-heuristics.t:724-728 > > + $ cat >> $HGRCPATH << EOF > > + > [experimental] > > + > evolution.createmarkers=True > > + > evolution.allowunstable=True > > + > EOF > > Since this does not seem to set `experimental.copytrace = heuristics` > (right?), this is probably not the right file for the test case. I recently > added `test-copies.t`, which may be a better place for this. That file > doesn't yet have any tests for `mergecopies()` (only for `pathcopies()`), > but I was probably going to add that later anyway. Depending on how many > tests I would add, I might have put all `mergecopies()` tests in a separate > file, but since there isn't much at this point (only these few that you're > adding), it probably makes sense for them to live in `test-copies.t`. > > REPOSITORY > rHG Mercurial > > REVISION DETAIL > https://phab.mercurial-scm.org/D5961 > > To: khanchi97, #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-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5296: store: don't read the whole fncache in memory
pulkit updated this revision to Diff 14255. pulkit edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5296?vs=12583=14255 REVISION DETAIL https://phab.mercurial-scm.org/D5296 AFFECTED FILES mercurial/store.py CHANGE DETAILS diff --git a/mercurial/store.py b/mercurial/store.py --- a/mercurial/store.py +++ b/mercurial/store.py @@ -463,7 +463,30 @@ # skip nonexistent file self.entries = set() return -self.entries = set(decodedir(fp.read()).splitlines()) + +self.entries = [] +#import pdb; pdb.set_trace() +totalsize = self.vfs.stat('fncache').st_size +chunksize = (10 ** 6) # 10 Megabytes +chunk = b'' +chunksize = min(totalsize, chunksize) +totalsize -= chunksize +while chunksize: +chunk += fp.read(chunksize) +try: +p = chunk.rindex(b'\n') +self.entries.extend(decodedir(chunk[:p + 1]).splitlines()) +chunk = chunk[p + 1:] +except ValueError: +# substring '\n' not found +pass +chunksize = min(totalsize, chunksize) +totalsize -= chunksize + +if chunk: +self.entries.extend(decodedir(chunk[:p + 1]).splitlines()) + +self.entries = set(self.entries) self._checkentries(fp) fp.close() To: pulkit, #hg-reviewers Cc: indygreg, yuja, mjpieters, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6030: store: move logic to check for invalid entry in fncache to own function
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This helps separate the original reading logic from the one which finds for an invalid entry. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6030 AFFECTED FILES mercurial/store.py CHANGE DETAILS diff --git a/mercurial/store.py b/mercurial/store.py --- a/mercurial/store.py +++ b/mercurial/store.py @@ -464,13 +464,17 @@ self.entries = set() return self.entries = set(decodedir(fp.read()).splitlines()) +self._checkentries(fp) +fp.close() + +def _checkentries(self, fp): +""" make sure there is no empty string in entries """ if '' in self.entries: fp.seek(0) for n, line in enumerate(util.iterfile(fp)): if not line.rstrip('\n'): t = _('invalid entry in fncache, line %d') % (n + 1) raise error.Abort(t) -fp.close() def write(self, tr): if self._dirty: 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
[PATCH 2 of 2 "] storage: introduce a `revlog.reuse-external-delta` config
# HG changeset patch # User Pierre-Yves David # Date 1551267618 -3600 # Wed Feb 27 12:40:18 2019 +0100 # Node ID d1df36a5e877119ca96134b0ee2e886c32f40c38 # Parent ed7aebbee814840433cf40ce02aecde83d6129c1 # EXP-Topic delta-control # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r d1df36a5e877 storage: introduce a `revlog.reuse-external-delta` config This option goes a bit further and provides a way to get the same behavior as the `re-delta-all` optimisation from `hg debugupgraderepo`. The effect of the option is a bit hard to test as we do not have multiple diff algorithm at hand. However, we at least make sure the code path run. diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -983,6 +983,9 @@ coreconfigitem('storage', 'revlog.optimi default=True, alias=[('format', 'aggressivemergedeltas')], ) +coreconfigitem('storage', 'revlog.reuse-external-delta', +default=True, +) coreconfigitem('storage', 'revlog.reuse-external-delta-parent', default=None, ) diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt --- a/mercurial/help/config.txt +++ b/mercurial/help/config.txt @@ -1865,6 +1865,22 @@ category impact performance and reposito considered. Even when disabled, the existing delta from the source will be reused if the same delta parent is selected. +``revlog.reuse-external-delta`` +Control the reuse of delta from external source. +(typically: apply bundle from `hg pull` or `hg push`). + +New revisions are usually provided as a delta against another revision. By +default, Mercurial will not recompute the same delta again , trusting +externally provided deltas. There have been rare cases of small adjustement +to the diffing algorithm in the past. So in some rare case, recomputing +delta provided by ancient clients can provides better results. Disabling +this option means going through a full delta recomputation for all incoming +revisions. It means a large increase in CPU usage and will slow operations +down. + +This option is enabled by default. When disabled, it also disable the +related ``storage.revlog.reuse-external-delta-parent`` option. + ``server`` -- diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -753,10 +753,14 @@ def resolverevlogstorevfsoptions(ui, req options[b'deltabothparents'] = deltabothparents -lazydeltabase = ui.configbool(b'storage', - b'revlog.reuse-external-delta-parent') +lazydelta = ui.configbool(b'storage', b'revlog.reuse-external-delta') +lazydeltabase = False +if lazydelta: +lazydeltabase = ui.configbool(b'storage', + b'revlog.reuse-external-delta-parent') if lazydeltabase is None: lazydeltabase = not scmutil.gddeltaconfig(ui) +options[b'lazydelta'] = lazydelta options[b'lazydeltabase'] = lazydeltabase chainspan = ui.configbytes(b'experimental', b'maxdeltachainspan') diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -410,7 +410,10 @@ class revlog(object): self._maxchainlen = opts['maxchainlen'] if 'deltabothparents' in opts: self._deltabothparents = opts['deltabothparents'] -self._lazydeltabase = bool(opts.get('lazydeltabase', False)) +self._lazydelta = bool(opts.get('lazydelta', True)) +self._lazydeltabase = False +if self._lazydelta: +self._lazydeltabase = bool(opts.get('lazydeltabase', False)) if 'compengine' in opts: self._compengine = opts['compengine'] if 'maxdeltachainspan' in opts: diff --git a/mercurial/revlogutils/deltas.py b/mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py +++ b/mercurial/revlogutils/deltas.py @@ -916,7 +916,7 @@ class deltacomputer(object): and currentbase != base and self.revlog.length(currentbase) == 0): currentbase = self.revlog.deltaparent(currentbase) -if currentbase == base: +if self.revlog._lazydelta and currentbase == base: delta = revinfo.cachedelta[1] if delta is None: delta = self._builddeltadiff(base, revinfo, fh) diff --git a/tests/test-sparse-revlog.t b/tests/test-sparse-revlog.t --- a/tests/test-sparse-revlog.t +++ b/tests/test-sparse-revlog.t @@ -40,7 +40,7 @@ repeatedly while some of it changes rare > maxchainlen = 15 > [storage] > revlog.optimize-delta-parent-choice = yes - > revlog.reuse-external-delta-parent = no + > revlog.reuse-external-delta = no > EOF $ hg init sparse-repo $ cd sparse-repo
[PATCH 1 of 2 "] storage: introduce a `revlog.reuse-external-delta-parent` config
# HG changeset patch # User Pierre-Yves David # Date 1551260965 -3600 # Wed Feb 27 10:49:25 2019 +0100 # Node ID ed7aebbee814840433cf40ce02aecde83d6129c1 # Parent 090a41251f093e8b8b97046deeef59f1d060d4e4 # EXP-Topic delta-control # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r ed7aebbee814 storage: introduce a `revlog.reuse-external-delta-parent` config As pointed in c59987ab96b4, we had no simple way to get a client to not blindly reuse the delta parent from a bundle. Instead one had to rely on a side effect of the deprecated `format.generaldelta` configuration. We introduce an explicit `revlog.reuse-external-delta-parent` configuration option (default to True) to control this behavior. If the option is not set, `format.generaldelta` still control this behavior. To test the new option, we convert a couple of place where `generaldelta` have been used for its side effects. diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -983,6 +983,9 @@ coreconfigitem('storage', 'revlog.optimi default=True, alias=[('format', 'aggressivemergedeltas')], ) +coreconfigitem('storage', 'revlog.reuse-external-delta-parent', +default=None, +) coreconfigitem('server', 'bookmarks-pushkey-compat', default=True, ) diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt --- a/mercurial/help/config.txt +++ b/mercurial/help/config.txt @@ -1843,6 +1843,28 @@ category impact performance and reposito Turning this option off can result in large increase of repository size for repository with many merges. +``revlog.reuse-external-delta-parent`` +Control the order in which delta parents are considered when adding new +revisions from an external source. +(typically: apply bundle from `hg pull` or `hg push`). + +New revisions are usually provided as a delta against other revisions. By +default, Mercurial will try to reuse this delta first, therefore using the +same "delta parent" as the source. Directly using delta's from the source +reduces CPU usage and usually speeds up operation. However, in some case, +the source might have sub-optimal delta bases and forcing their reevaluation +is useful. For example, pushes from an old client could have sub-optimal +delta's parent that the server want to optimize. (lack of general delta, bad +parents, choice, lack of sparse-revlog, etc). + +This option is enabled by default. Turning it off will ensure bad delta +parent choices from older client do not propagate to this repository, at +the cost of a small increase in CPU consumption. + +Note: this option only control the order in which delta parents are +considered. Even when disabled, the existing delta from the source will be +reused if the same delta parent is selected. + ``server`` -- diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -752,7 +752,12 @@ def resolverevlogstorevfsoptions(ui, req b'revlog.optimize-delta-parent-choice') options[b'deltabothparents'] = deltabothparents -options[b'lazydeltabase'] = not scmutil.gddeltaconfig(ui) + +lazydeltabase = ui.configbool(b'storage', + b'revlog.reuse-external-delta-parent') +if lazydeltabase is None: +lazydeltabase = not scmutil.gddeltaconfig(ui) +options[b'lazydeltabase'] = lazydeltabase chainspan = ui.configbytes(b'experimental', b'maxdeltachainspan') if 0 <= chainspan: diff --git a/tests/test-generaldelta.t b/tests/test-generaldelta.t --- a/tests/test-generaldelta.t +++ b/tests/test-generaldelta.t @@ -339,7 +339,7 @@ test maxdeltachainspan 52 51 -1base369640369 0.57656 369 00.0 53 61 -1base 0 0 0 0.0 0 00.0 54 71 -1base369640369 0.57656 369 00.0 - $ hg clone --pull source-repo --config experimental.maxdeltachainspan=0 noconst-chain --config format.generaldelta=yes + $ hg clone --pull source-repo --config experimental.maxdeltachainspan=0 noconst-chain --config format.usegeneraldelta=yes --config storage.revlog.reuse-external-delta-parent=no requesting all changes adding changesets adding manifests diff --git a/tests/test-sparse-revlog.t b/tests/test-sparse-revlog.t --- a/tests/test-sparse-revlog.t +++ b/tests/test-sparse-revlog.t @@ -40,8 +40,7 @@ repeatedly while some of it changes rare > maxchainlen = 15 > [storage] > revlog.optimize-delta-parent-choice = yes - > [format] - > generaldelta = yes + > revlog.reuse-external-delta-parent = no >
D6029: Bug 1477205 - Remove the exception when a node is created after closing the AudioContext. r?padenot
marmoute added a comment. Hi Valentin, It looks like you are not using the right Phabricator instance. This one is dedicated to the Mercurial projet, not Firefox. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6029 To: vmillet, #hg-reviewers Cc: marmoute, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5299: phabricator: fallback reading arcanist config files
philpep marked 3 inline comments as done. philpep added inline comments. INLINE COMMENTS > mharbison72 wrote in phabricator.py:187 > s/.encoding/.environ/ ? Woops... Thanks for catching this! > mharbison72 wrote in phabricator.py:200 > Should this be using vfs to open, instead of raw open? Using the vfs layer > allows the class that provides posix-like functionality on Windows to be used. Yes, done. > mharbison72 wrote in phabricator.py:290 > It might be clearer to return None, since the function is to fetch the repoid. Indeed, I fixed this. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5299 To: philpep, #hg-reviewers Cc: mharbison72, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5299: phabricator: fallback reading arcanist config files
philpep updated this revision to Diff 14253. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5299?vs=14175=14253 REVISION DETAIL https://phab.mercurial-scm.org/D5299 AFFECTED FILES hgext/phabricator.py CHANGE DETAILS diff --git a/hgext/phabricator.py b/hgext/phabricator.py --- a/hgext/phabricator.py +++ b/hgext/phabricator.py @@ -37,6 +37,9 @@ # API token. Get it from https://$HOST/conduit/login/ example.phabtoken = cli- + +As a fallback, read config from arc config files (.arcconfig, ~/.arcrc and +/etc/arcconfig) """ from __future__ import absolute_import @@ -46,6 +49,7 @@ import json import operator import re +import os from mercurial.node import bin, nullid from mercurial.i18n import _ @@ -60,13 +64,15 @@ parser, patch, phases, +pycompat, registrar, scmutil, smartset, tags, templateutil, url as urlmod, util, +vfs as vfsmod, ) from mercurial.utils import ( procutil, @@ -171,16 +177,49 @@ process(b'', params) return util.urlreq.urlencode(flatparams) +def readarcconfig(repo): +"""Return url, token, callsign read from arcanist config files + +This read and merge content of /etc/arcconfig, ~/.arcrc and .arconfig. +""" +if pycompat.iswindows: +paths = [ +vfsmod.vfs(encoding.environ['ProgramData']).join( + 'Phabricator', 'Arcanist', 'config'), +vfsmod.vfs(encoding.environ['AppData']).join('.arcrc') +] +else: +paths = [ +vfsmod.vfs('/etc').join('.arconfig'), +os.path.expanduser('~/.arcrc'), +] +paths.append(vfsmod.vfs(repo.root).join('.arcconfig')) +config = {} +for path in paths: +if vfsmod.vfs(path).exists(): +with vfsmod.vfs(path).open(None, auditpath=False) as f: +config.update(json.load(f)) +callsign = config.get('repository.callsign') +conduit_uri = config.get('conduit_uri', config.get('config', {}).get('default')) +if conduit_uri is not None: +token = config.get('hosts', {}).get(conduit_uri, {}).get('token') +url = conduit_uri.rstrip('/api/') +return url, token, callsign + def readurltoken(repo): """return conduit url, token and make sure they exist -Currently read from [auth] config section. In the future, it might -make sense to read from .arcconfig and .arcrc as well. +Currently read from [auth] config section and fallback to reading arc +config files. """ url = repo.ui.config(b'phabricator', b'url') if not url: -raise error.Abort(_(b'config %s.%s is required') - % (b'phabricator', b'url')) +url, token, __ = readarcconfig(repo) +if not url or not token: +raise error.Abort(_(b'unable to read phabricator conduit url and ' +b'token from config %s.%s or from arc config ' +b'files') % (b'phabricator', b'url')) +return url, token res = httpconnectionmod.readauthforuri(repo.ui, url, util.url(url).user) token = None @@ -246,7 +285,9 @@ return repophid callsign = repo.ui.config(b'phabricator', b'callsign') if not callsign: -return None +__, __, callsign = readarcconfig(repo) +if not callsign: +return None query = callconduit(repo, b'diffusion.repository.search', {b'constraints': {b'callsigns': [callsign]}}) if len(query[r'data']) == 0: To: philpep, #hg-reviewers Cc: mharbison72, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6029: Bug 1477205 - Remove the exception when a node is created after closing the AudioContext. r?padenot
vmillet 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/D6029 AFFECTED FILES dom/media/webaudio/AnalyserNode.cpp dom/media/webaudio/AudioBufferSourceNode.cpp dom/media/webaudio/AudioContext.cpp dom/media/webaudio/AudioContext.h dom/media/webaudio/AudioWorkletNode.cpp dom/media/webaudio/BiquadFilterNode.cpp dom/media/webaudio/ChannelMergerNode.cpp dom/media/webaudio/ChannelSplitterNode.cpp dom/media/webaudio/ConvolverNode.cpp dom/media/webaudio/DelayNode.cpp dom/media/webaudio/DynamicsCompressorNode.cpp dom/media/webaudio/GainNode.cpp dom/media/webaudio/IIRFilterNode.cpp dom/media/webaudio/MediaElementAudioSourceNode.cpp dom/media/webaudio/MediaStreamAudioDestinationNode.cpp dom/media/webaudio/MediaStreamAudioSourceNode.cpp dom/media/webaudio/OscillatorNode.cpp dom/media/webaudio/PannerNode.cpp dom/media/webaudio/StereoPannerNode.cpp dom/media/webaudio/WaveShaperNode.cpp dom/media/webaudio/test/test_audioContextSuspendResumeClose.html CHANGE DETAILS diff --git a/dom/media/webaudio/test/test_audioContextSuspendResumeClose.html b/dom/media/webaudio/test/test_audioContextSuspendResumeClose.html --- a/dom/media/webaudio/test/test_audioContextSuspendResumeClose.html +++ b/dom/media/webaudio/test/test_audioContextSuspendResumeClose.html @@ -41,7 +41,7 @@ return; } - expectException(function() { + expectNoException(function() { ctx[e.name].apply(ctx, e.args); }, DOMException.INVALID_STATE_ERR); }); diff --git a/dom/media/webaudio/WaveShaperNode.cpp b/dom/media/webaudio/WaveShaperNode.cpp --- a/dom/media/webaudio/WaveShaperNode.cpp +++ b/dom/media/webaudio/WaveShaperNode.cpp @@ -295,9 +295,6 @@ /* static */ already_AddRefed WaveShaperNode::Create( AudioContext& aAudioContext, const WaveShaperOptions& aOptions, ErrorResult& aRv) { - if (aAudioContext.CheckClosed(aRv)) { -return nullptr; - } RefPtr audioNode = new WaveShaperNode(); diff --git a/dom/media/webaudio/StereoPannerNode.cpp b/dom/media/webaudio/StereoPannerNode.cpp --- a/dom/media/webaudio/StereoPannerNode.cpp +++ b/dom/media/webaudio/StereoPannerNode.cpp @@ -167,9 +167,6 @@ /* static */ already_AddRefed StereoPannerNode::Create( AudioContext& aAudioContext, const StereoPannerOptions& aOptions, ErrorResult& aRv) { - if (aAudioContext.CheckClosed(aRv)) { -return nullptr; - } RefPtr audioNode = new StereoPannerNode(); diff --git a/dom/media/webaudio/PannerNode.cpp b/dom/media/webaudio/PannerNode.cpp --- a/dom/media/webaudio/PannerNode.cpp +++ b/dom/media/webaudio/PannerNode.cpp @@ -324,9 +324,6 @@ /* static */ already_AddRefed PannerNode::Create( AudioContext& aAudioContext, const PannerOptions& aOptions, ErrorResult& aRv) { - if (aAudioContext.CheckClosed(aRv)) { -return nullptr; - } RefPtr audioNode = new PannerNode(); diff --git a/dom/media/webaudio/OscillatorNode.cpp b/dom/media/webaudio/OscillatorNode.cpp --- a/dom/media/webaudio/OscillatorNode.cpp +++ b/dom/media/webaudio/OscillatorNode.cpp @@ -389,9 +389,6 @@ /* static */ already_AddRefed OscillatorNode::Create( AudioContext& aAudioContext, const OscillatorOptions& aOptions, ErrorResult& aRv) { - if (aAudioContext.CheckClosed(aRv)) { -return nullptr; - } RefPtr audioNode = new OscillatorNode(); diff --git a/dom/media/webaudio/MediaStreamAudioSourceNode.cpp b/dom/media/webaudio/MediaStreamAudioSourceNode.cpp --- a/dom/media/webaudio/MediaStreamAudioSourceNode.cpp +++ b/dom/media/webaudio/MediaStreamAudioSourceNode.cpp @@ -50,10 +50,6 @@ return nullptr; } - if (aAudioContext.CheckClosed(aRv)) { -return nullptr; - } - if (aAudioContext.Graph() != aOptions.mMediaStream->GetPlaybackStream()->Graph()) { nsCOMPtr pWindow = aAudioContext.GetParentObject(); diff --git a/dom/media/webaudio/MediaStreamAudioDestinationNode.cpp b/dom/media/webaudio/MediaStreamAudioDestinationNode.cpp --- a/dom/media/webaudio/MediaStreamAudioDestinationNode.cpp +++ b/dom/media/webaudio/MediaStreamAudioDestinationNode.cpp @@ -99,10 +99,6 @@ return nullptr; } - if (aAudioContext.CheckClosed(aRv)) { -return nullptr; - } - RefPtr audioNode = new MediaStreamAudioDestinationNode(); diff --git a/dom/media/webaudio/MediaElementAudioSourceNode.cpp b/dom/media/webaudio/MediaElementAudioSourceNode.cpp --- a/dom/media/webaudio/MediaElementAudioSourceNode.cpp +++ b/dom/media/webaudio/MediaElementAudioSourceNode.cpp @@ -25,10 +25,6 @@ return nullptr; } - if (aAudioContext.CheckClosed(aRv)) { -return nullptr; - } - RefPtr node = new MediaElementAudioSourceNode(); diff --git a/dom/media/webaudio/IIRFilterNode.cpp b/dom/media/webaudio/IIRFilterNode.cpp --- a/dom/media/webaudio/IIRFilterNode.cpp +++
D6028: branchmap: prevent reading the file twice through different iterators
This revision was automatically updated to reflect the committed changes. Closed by commit rHG8ad46ac6728e: branchmap: prevent reading the file twice through different iterators (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6028?vs=14246=14251 REVISION DETAIL https://phab.mercurial-scm.org/D6028 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 @@ -179,7 +179,7 @@ if not bcache.validfor(repo): # invalidate the cache raise ValueError(r'tip differs') -bcache.load(repo, f) +bcache.load(repo, lineiter) except (IOError, OSError): return None @@ -198,10 +198,10 @@ return bcache -def load(self, repo, f): -""" fully loads the branchcache by reading from the file f """ +def load(self, repo, lineiter): +""" fully loads the branchcache by reading from the file using the line +iterator passed""" cl = repo.changelog -lineiter = iter(f) for line in lineiter: line = line.rstrip('\n') if not line: To: pulkit, #hg-reviewers, lothiraldan Cc: lothiraldan, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6028: branchmap: prevent reading the file twice through different iterators
lothiraldan added subscribers: yuja, lothiraldan. lothiraldan accepted this revision. lothiraldan added a comment. Queued thanks, the test now pass both locally and on gcc112. @yuja nice catch! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6028 To: pulkit, #hg-reviewers, lothiraldan Cc: lothiraldan, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5955: watchman: ignore some of watchman errors
lothiraldan added a comment. Gentle ping on this series REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5955 To: lothiraldan, #hg-reviewers Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel