Re: [PATCH 1 of 6] upgrade: add a test to show the repository config being ignored
On Fri, Dec 8, 2017 at 3:19 AM, Boris Feld wrote: > # HG changeset patch > # User Boris Feld > # Date 1512676224 -3600 > # Thu Dec 07 20:50:24 2017 +0100 > # Node ID 90a8cc66a579cf9122e8fef91e4bc1f48062ff60 > # Parent 924805347f2fa830e2f371b32f3ba85f01debfee > # EXP-Topic upgrade.config > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > 90a8cc66a579 > upgrade: add a test to show the repository config being ignored > Queued this series. Good catches on the subtle bugs. It would be nice to have a test for upgrading a repo with lfs enabled. But I suppose that extension is new and experimental enough that it can wait until another day. > > The upgrade process ignores the config within the repository. The next > changeset fixes it, but we introduce this test before to show it actually > tests our target. > > diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t > --- a/tests/test-upgrade-repo.t > +++ b/tests/test-upgrade-repo.t > @@ -467,3 +467,95 @@ Check upgrading a large file repository >largefiles >revlogv1 >store > + > + $ cd .. > + > +repository config is taken in account > +- > + > + $ cat << EOF >> $HGRCPATH > + > [format] > + > maxchainlen = 1 > + > EOF > + > + $ hg init localconfig > + $ cd localconfig > + $ cat << EOF > file > + > some content > + > with some length > + > to make sure we get a delta > + > after changes > + > very long > + > very long > + > very long > + > very long > + > very long > + > very long > + > very long > + > very long > + > very long > + > very long > + > very long > + > EOF > + $ hg -q commit -A -m A > + $ echo "new line" >> file > + $ hg -q commit -m B > + $ echo "new line" >> file > + $ hg -q commit -m C > + > + $ cat << EOF >> .hg/hgrc > + > [format] > + > maxchainlen = 9001 > + > EOF > + $ hg config format > + format.maxchainlen=9001 > + $ hg debugindex file > + revoffset length delta linkrev nodeid p1 p2 > + 0 0 77 -1 0 bcc1d3df78b2 > > + 177 21 0 1 af3e29f7a72e bcc1d3df78b2 > > + 298 84 -1 2 8daf79c5522b af3e29f7a72e > > + > + $ hg debugupgraderepo --run --optimize redeltaall > + upgrade will perform the following actions: > + > + requirements > + preserved: dotencode, fncache, generaldelta, revlogv1, store > + > + redeltaall > + deltas within internal storage will be fully recomputed; this will > likely drastically slow down execution time > + > + beginning upgrade... > + repository locked and read-only > + creating temporary repository to stage migrated data: > $TESTTMP/localconfig/.hg/upgrade.* (glob) > + (it is safe to interrupt this process any time before data migration > completes) > + migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in > changelog) > + migrating 497 bytes in store; 882 bytes tracked data > + migrating 1 filelogs containing 3 revisions (182 bytes in store; 573 > bytes tracked data) > + finished migrating 3 filelog revisions across 1 filelogs; change in > size: 0 bytes > + migrating 1 manifests containing 3 revisions (141 bytes in store; 138 > bytes tracked data) > + finished migrating 3 manifest revisions across 1 manifests; change in > size: 0 bytes > + migrating changelog containing 3 revisions (174 bytes in store; 171 > bytes tracked data) > + finished migrating 3 changelog revisions; change in size: 0 bytes > + finished migrating 9 total revisions; total change in store size: 0 > bytes > + copying phaseroots > + data fully migrated to temporary repository > + marking source repository as being upgraded; clients will be unable to > read from repository > + starting in-place swap of repository data > + replaced files will be backed up at > $TESTTMP/localconfig/.hg/upgradebackup.* > (glob) > + replacing store... > + store replacement complete; repository was inconsistent for 0.0s > + finalizing requirements file and making repository readable again > + removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob) > + copy of old repository backed up at > $TESTTMP/localconfig/.hg/upgradebackup.* > (glob) > + the old repository will not be deleted; remove it to free up disk space > once the upgraded repository is verified > + $ hg debugindex file > + revoffset length delta linkrev nodeid p1 p2 > + 0 0 77 -1 0 bcc1d3df78b2 > > + 177 21 0 1 af3e29f7a72e bcc1d3df78b2 > > + 298 84 -1 2 8daf79c5522b af3e29f7a72e > > + $ cd .. > + > + $ cat << EOF >> $HGRCPATH > + > [format] > + > maxchainlen = 9001 > + > EOF > ___ > M
Re: [PATCH 1 of 6] upgrade: rename 'removecldeltachain' to 'plain-cl-delta'
On Fri, Dec 8, 2017 at 2:58 AM, Boris Feld wrote: > # HG changeset patch > # User Boris Feld > # Date 1512658559 -3600 > # Thu Dec 07 15:55:59 2017 +0100 > # Node ID 88ae8b7114e294c3bc641611324f1a7b023a1f5e > # Parent 483b5dd0f1aa412e9611ab694279c9d3735fee99 > # EXP-Topic upgrade > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > 88ae8b7114e2 > upgrade: rename 'removecldeltachain' to 'plain-cl-delta' > Queued this series. That new debug command is useful and concise! I'm not a huge fan of "format" as a user-facing name. But it already exists in hgrc and it is a debug command, so it isn't worth bikeshedding. I'm also curious to see where the compression series goes. > > The new naming is more descriptive of a "state" while the older one was > more > about "action". I'm looking into command exposing more of data about the > state > of the repository so "state" oriented work better there. > > The key has not been made public anywhere outside the debug area so it is > fine > to update it. > > diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py > --- a/mercurial/upgrade.py > +++ b/mercurial/upgrade.py > @@ -259,7 +259,7 @@ class generaldelta(requirementformatvari > > @registerformatvariant > class removecldeltachain(formatvariant): > -name = 'removecldeltachain' > +name = 'plain-cl-delta' > > default = True > > ___ > 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
D1623: tests: glob away ' that doesn't occur on all platforms in lfs test
This revision was automatically updated to reflect the committed changes. Closed by commit rHG85f866bf9362: tests: glob away ' that doesn't occur on all platforms in lfs test (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1623?vs=4287&id=4288 REVISION DETAIL https://phab.mercurial-scm.org/D1623 AFFECTED FILES tests/test-lfs.t CHANGE DETAILS diff --git a/tests/test-lfs.t b/tests/test-lfs.t --- a/tests/test-lfs.t +++ b/tests/test-lfs.t @@ -571,7 +571,7 @@ the user cache. $ find $TESTTMP/repo12/.hg/store/lfs/objects -type f - find: */repo12/.hg/store/lfs/objects': $ENOENT$ (glob) + find: */repo12/.hg/store/lfs/objects*: $ENOENT$ (glob) [1] $ hg --config extensions.share= share repo12 repo13 To: durin42, #hg-reviewers, krbullock Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1623: tests: glob away ' that doesn't occur on all platforms in lfs test
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1623 AFFECTED FILES tests/test-lfs.t CHANGE DETAILS diff --git a/tests/test-lfs.t b/tests/test-lfs.t --- a/tests/test-lfs.t +++ b/tests/test-lfs.t @@ -571,7 +571,7 @@ the user cache. $ find $TESTTMP/repo12/.hg/store/lfs/objects -type f - find: */repo12/.hg/store/lfs/objects': $ENOENT$ (glob) + find: */repo12/.hg/store/lfs/objects*: $ENOENT$ (glob) [1] $ hg --config extensions.share= share repo12 repo13 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
D1617: rebase: extract _assignworkingcopy
krbullock added inline comments. INLINE COMMENTS > rebase.py:393 > +def _performrebase(self, tr): > +self._assignworkingcopy() > +repo, ui = self.repo, self.ui Rather than having this method spookily set self.wctx, why not make `_assignworkingcopy` _return_ the wctx (and rename it accordingly)? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1617 To: phillco, #hg-reviewers, dlax Cc: krbullock, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1617: rebase: extract _assignworkingcopy
This revision was automatically updated to reflect the committed changes. Closed by commit rHG8dba17546016: rebase: extract _assignworkingcopy (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1617?vs=4277&id=4286 REVISION DETAIL https://phab.mercurial-scm.org/D1617 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -382,14 +382,16 @@ self.prepared = True -def _performrebase(self, tr): -repo, ui = self.repo, self.ui -# Assign a working copy object. +def _assignworkingcopy(self): if self.inmemory: from mercurial.context import overlayworkingctx self.wctx = overlayworkingctx(self.repo) else: self.wctx = self.repo[None] + +def _performrebase(self, tr): +self._assignworkingcopy() +repo, ui = self.repo, self.ui if self.keepbranchesf: # insert _savebranch at the start of extrafns so if # there's a user-provided extrafn it can clobber branch if To: phillco, #hg-reviewers, dlax Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1616: rebase: disable `inmemory` if the rebaseset contains the working copy
This revision was automatically updated to reflect the committed changes. Closed by commit rHG03bec089e105: rebase: disable `inmemory` if the rebaseset contains the working copy (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1616?vs=4276&id=4285 REVISION DETAIL https://phab.mercurial-scm.org/D1616 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -830,7 +830,8 @@ else: destmap = _definedestmap(ui, repo, destf, srcf, basef, revf, destspace=destspace, - inmemory=opts['inmemory']) + opts=opts) +rbsrt.inmemory = opts['inmemory'] retcode = rbsrt._preparenewrebase(destmap) if retcode is not None: return retcode @@ -850,7 +851,7 @@ rbsrt._finishrebase() def _definedestmap(ui, repo, destf=None, srcf=None, basef=None, revf=None, - destspace=None, inmemory=False): + destspace=None, opts=None): """use revisions argument to define destmap {srcrev: destrev}""" if revf is None: revf = [] @@ -864,7 +865,7 @@ if revf and srcf: raise error.Abort(_('cannot specify both a revision and a source')) -if not inmemory: +if not opts['inmemory']: cmdutil.checkunfinished(repo) cmdutil.bailifchanged(repo) @@ -939,6 +940,22 @@ ui.status(_('nothing to rebase from %s to %s\n') % ('+'.join(str(repo[r]) for r in base), dest)) return None +# If rebasing the working copy parent, force in-memory merge to be off. +# +# This is because the extra work of checking out the newly rebased commit +# outweights the benefits of rebasing in-memory, and executing an extra +# update command adds a bit of overhead, so better to just do it on disk. In +# all other cases leave it on. +# +# Note that there are cases where this isn't true -- e.g., rebasing large +# stacks that include the WCP. However, I'm not yet sure where the cutoff +# is. +rebasingwcp = repo['.'].rev() in rebaseset +if opts['inmemory'] and rebasingwcp: +opts['inmemory'] = False +# Check these since we did not before. +cmdutil.checkunfinished(repo) +cmdutil.bailifchanged(repo) if not destf: dest = repo[_destrebase(repo, rebaseset, destspace=destspace)] To: phillco, #hg-reviewers, dlax Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1607: remotenames: rename related file and storage dir to logexchange
krbullock requested changes to this revision. krbullock added a comment. This revision now requires changes to proceed. This doesn't apply cleanly. Can you rebase? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1607 To: pulkit, #hg-reviewers, krbullock Cc: krbullock, durin42, smf, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1601: clone: add support for storing remotenames while cloning
This revision was automatically updated to reflect the committed changes. Closed by commit rHG773a9a06047c: clone: add support for storing remotenames while cloning (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1601?vs=4148&id=4284 REVISION DETAIL https://phab.mercurial-scm.org/D1601 AFFECTED FILES mercurial/hg.py tests/test-remotenames.t CHANGE DETAILS diff --git a/tests/test-remotenames.t b/tests/test-remotenames.t --- a/tests/test-remotenames.t +++ b/tests/test-remotenames.t @@ -4,6 +4,8 @@ $ cat >> $HGRCPATH << EOF > [alias] > glog = log -G -T '{rev}:{node|short} {desc}' + > [experimental] + > remotenames = True > EOF Making a server repo @@ -46,25 +48,12 @@ $ cd .. - $ hg init client - $ cd client - $ cat >> .hg/hgrc << EOF - > [experimental] - > remotenames = True - > EOF - $ hg pull ../server/ - pulling from ../server/ - requesting all changes - adding changesets - adding manifests - adding file changes - added 9 changesets with 9 changes to 9 files (+1 heads) - adding remote bookmark bar - adding remote bookmark foo - new changesets 18d04c59bb5d:3e1487808078 - (run 'hg heads' to see heads) + $ hg clone server client + updating to branch default + 8 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cd client $ cat .hg/remotenames/bookmarks 0 diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -31,6 +31,7 @@ merge as mergemod, node, phases, +remotenames, repoview, scmutil, sshpeer, @@ -689,6 +690,9 @@ destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone') +if ui.configbool('experimental', 'remotenames'): +remotenames.pullremotenames(destrepo, srcpeer) + if update: if update is not True: checkout = srcpeer.lookup(update) To: pulkit, #hg-reviewers, krbullock Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1457: workers: don't use backgroundfilecloser in threads
krbullock requested changes to this revision. krbullock added a comment. This revision now requires changes to proceed. Looks okay to me except for Augie's nit. @indygreg ? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1457 To: wlis, #hg-reviewers, indygreg, krbullock Cc: krbullock, durin42, indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1620: revset: use phasecache.getrevset to calculate public()
This revision was automatically updated to reflect the committed changes. Closed by commit rHG0c1aff6d73a7: revset: use phasecache.getrevset to calculate public() (authored by quark, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1620?vs=4275&id=4281 REVISION DETAIL https://phab.mercurial-scm.org/D1620 AFFECTED FILES mercurial/phases.py mercurial/revset.py CHANGE DETAILS diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1504,8 +1504,7 @@ def _phase(repo, subset, *targets): """helper to select all rev in phases""" -s = repo._phasecache.getrevset(repo, targets) -return subset & s +return repo._phasecache.getrevset(repo, targets, subset) @predicate('draft()', safe=True) def draft(repo, subset, x): @@ -1612,11 +1611,7 @@ """Changeset in public phase.""" # i18n: "public" is a keyword getargs(x, 0, 0, _("public takes no arguments")) -phase = repo._phasecache.phase -target = phases.public -condition = lambda r: phase(repo, r) == target -return subset.filter(condition, condrepr=('', target), - cache=False) +return _phase(repo, subset, phases.public) @predicate('remote([id [,path]])', safe=False) def remote(repo, subset, x): diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -208,7 +208,7 @@ self.filterunknown(repo) self.opener = repo.svfs -def getrevset(self, repo, phases): +def getrevset(self, repo, phases, subset=None): """return a smartset for the given phases""" self.loadphaserevs(repo) # ensure phase's sets are loaded phases = set(phases) @@ -222,7 +222,10 @@ revs = set.union(*[self._phasesets[p] for p in phases]) if repo.changelog.filteredrevs: revs = revs - repo.changelog.filteredrevs -return smartset.baseset(revs) +if subset is None: +return smartset.baseset(revs) +else: +return subset & smartset.baseset(revs) else: phases = set(allphases).difference(phases) if not phases: @@ -232,9 +235,11 @@ revs = self._phasesets[p] else: revs = set.union(*[self._phasesets[p] for p in phases]) +if subset is None: +subset = smartset.fullreposet(repo) if not revs: -return smartset.fullreposet(repo) -return smartset.fullreposet(repo).filter(lambda r: r not in revs) +return subset +return subset.filter(lambda r: r not in revs) def copy(self): # Shallow copy meant to ensure isolation in To: quark, #hg-reviewers, yuja Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1619: highlight: eagerly discover plugin lexers while demandimport is off
This revision was automatically updated to reflect the committed changes. Closed by commit rHG169d66db5920: highlight: eagerly discover plugin lexers while demandimport is off (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1619?vs=4274&id=4280 REVISION DETAIL https://phab.mercurial-scm.org/D1619 AFFECTED FILES hgext/highlight/highlight.py CHANGE DETAILS diff --git a/hgext/highlight/highlight.py b/hgext/highlight/highlight.py --- a/hgext/highlight/highlight.py +++ b/hgext/highlight/highlight.py @@ -22,8 +22,12 @@ import pygments import pygments.formatters import pygments.lexers +import pygments.plugin import pygments.util +for unused in pygments.plugin.find_plugin_lexers(): +pass + highlight = pygments.highlight ClassNotFound = pygments.util.ClassNotFound guess_lexer = pygments.lexers.guess_lexer To: durin42, #hg-reviewers, quark, yuja Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1285: repoview: add a new attribute _visibilityexceptions and related API
yuja added inline comments. INLINE COMMENTS > quark wrote in localrepo.py:575 > I guess `hg log -r HASH --hidden` would go through this code path so `pass` > makes sense. Maybe. My concern was `getvisibilityexceptions()` "seemed" not working correctly in that case. I know unfiltered repo has no exception, but I would expect `get` will return `add`-ed. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1285 To: pulkit, #hg-reviewers, quark, yuja Cc: yuja, lothiraldan, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1285: repoview: add a new attribute _visibilityexceptions and related API
yuja added a comment. >> How long should the visibilityexception be preserved? > > The visibility exceptions must be preserved until we calculate filteredrevs for that filter. After adding the expections, we clear filteredrevcache to make sure we calculate that again. Sounds like it is actually a temporary variable. Instead, how about making `filtertable` or `filterfunc` dynamic? repo.filtertable['visible:blahblah'] = partial(computehidden, exceptrevs) repo.filtered('visible:blahblah') >> We could attach it to `unfi`, but in which case, we have to be careful to not leak >> the current visibilityexception to the subsequent sessions. A `repo` object may >> live longer than a single command/request session in hgweb or command server. > > Since we want them while calculating filteredrevs where we pass a unfiltered repo, we need a way to get visibilityexceptions for a filtername from unfi. Maybe we can clear out the exceptions after using them. I guess the hard part is when we can say the exceptions are "used." REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1285 To: pulkit, #hg-reviewers, quark, yuja Cc: yuja, lothiraldan, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1606: phases: drop the list with phase of each rev, always comput phase sets
yuja added inline comments. INLINE COMMENTS > quark wrote in phases.py:236 > `baseset.__contains__` is slower than `set.__contains__` so the current code > is faster. Really? It's aliased to `self._set.__contains__`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1606 To: joerg.sonnenberger, #hg-reviewers, quark, yuja Cc: yuja, durin42, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1285: repoview: add a new attribute _visibilityexceptions and related API
quark added inline comments. INLINE COMMENTS > yuja wrote in localrepo.py:575 > raise ProgrammingError? I guess `hg log -r HASH --hidden` would go through this code path so `pass` makes sense. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1285 To: pulkit, #hg-reviewers, quark, yuja Cc: yuja, lothiraldan, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1622: transaction: Use intbitset for implementing changes['phase']
quark added a comment. Although this is definitely better for the clone case. intbitset does not seem to implement segmented bitsets so the memory usage could in theory be worse for other cases. INLINE COMMENTS > localrepo.py:1283 > tr.changes['obsmarkers'] = set() > -tr.changes['phases'] = [set() for i in range(7)] > +tr.changes['phases'] = [intbitset() for i in range(6)] > tr.changes['bookmarks'] = {} It's still worthwhile to have `set()` as a fallback. So the code runs in pure python or pypy environment REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1622 To: joerg.sonnenberger, #hg-reviewers Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1621: transaction: split changes['phases'] into sets for src and target phase
quark accepted this revision. quark added a comment. That said, I think the usage of list of sets is smart and this change looks good to me. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1621 To: joerg.sonnenberger, #hg-reviewers, quark Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1621: transaction: split changes['phases'] into sets for src and target phase
quark added inline comments. INLINE COMMENTS > localrepo.py:1243 >**pycompat.strkwargs(args)) > if hook.hashook(repo.ui, 'pretxnclose-phase'): > cl = repo.unfiltered().changelog Since this hook is the only user of `tr.changes['phases']`. I'd suggest disabling calculating `tr.changes['phases']` if the hook does not exist. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1621 To: joerg.sonnenberger, #hg-reviewers Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1621: transaction: split changes['phases'] into sets for src and target phase
joerg.sonnenberger added a comment. This is a Proof-of-Concept and with a follow-up in https://phab.mercurial-scm.org/D1622 to use a C implementation for the bitset. Original code: 485s / 584MB Set version: 501s / 582MB intbitset: 478s / 563MB REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1621 To: joerg.sonnenberger, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1621: transaction: split changes['phases'] into sets for src and target phase
joerg.sonnenberger created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY changes['phases'] used to be a dictionary mapping revisions to (old, new) tuples. The encoding is highly redundant and eats ~40MB for the test case in issue5691. Recognize that for new, only the three phases are valid and record the state using three sets. For old, keep three sets for the phases as well and encode unknown as lack of membership in the three sets. Provide a helper function to enumerate the changes. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1621 AFFECTED FILES mercurial/localrepo.py mercurial/phases.py tests/testlib/ext-phase-report.py CHANGE DETAILS diff --git a/tests/testlib/ext-phase-report.py b/tests/testlib/ext-phase-report.py --- a/tests/testlib/ext-phase-report.py +++ b/tests/testlib/ext-phase-report.py @@ -1,11 +1,12 @@ # tiny extension to report phase changes during transaction from __future__ import absolute_import +from mercurial import phases def reposetup(ui, repo): def reportphasemove(tr): -for rev, move in sorted(tr.changes['phases'].iteritems()): +for rev, move in sorted(phases.phasechanges(tr.changes['phases'])): if move[0] is None: ui.write(('test-debug-phase: new rev %d: x -> %d\n' % (rev, move[1]))) diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -186,17 +186,38 @@ headsbyphase[phase].append(node) return headsbyphase +def phasechanges(data): +offset = len(allphases) +for tgtphase in allphases: +for rev in data[tgtphase + offset]: +srcphase = None +for phase in allphases: +if rev in data[phase]: +srcphase = phase +break +yield (rev, (srcphase, tgtphase)) + def _trackphasechange(data, rev, old, new): -"""add a phase move the dictionnary +"""add a phase move the sets If data is None, nothing happens. """ if data is None: return -existing = data.get(rev) -if existing is not None: -old = existing[0] -data[rev] = (old, new) +assert old in allphases or old is None +assert new in allphases +offset = len(allphases) + +if rev not in data[new + offset]: +found = False +for phase in allphases: +if phase == new: +data[phase + offset].add(rev) +elif rev in data[phase + offset]: +data[phase + offset].discard(rev) +found = True +if not found and old is not None: +data[old].add(rev) class phasecache(object): def __init__(self, repo, phasedefaults, _load=True): diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1242,7 +1242,8 @@ **pycompat.strkwargs(args)) if hook.hashook(repo.ui, 'pretxnclose-phase'): cl = repo.unfiltered().changelog -for rev, (old, new) in tr.changes['phases'].items(): +phasechanges = phases.phasechanges(tr.changes['phases']) +for rev, (old, new) in phasechanges: args = tr.hookargs.copy() node = hex(cl.node(rev)) args.update(phases.preparehookargs(node, old, new)) @@ -1277,7 +1278,7 @@ checkambigfiles=_cachedfiles) tr.changes['revs'] = xrange(0, 0) tr.changes['obsmarkers'] = set() -tr.changes['phases'] = {} +tr.changes['phases'] = [set() for i in range(7)] tr.changes['bookmarks'] = {} tr.hookargs['txnid'] = txnid @@ -1306,7 +1307,7 @@ if hook.hashook(repo.ui, 'txnclose-phase'): cl = repo.unfiltered().changelog -phasemv = sorted(tr.changes['phases'].items()) +phasemv = sorted(phases.phasechanges(tr.changes['phases'])) for rev, (old, new) in phasemv: args = tr.hookargs.copy() node = hex(cl.node(rev)) To: joerg.sonnenberger, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1622: transaction: Use intbitset for implementing changes['phase']
joerg.sonnenberger 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/D1622 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 @@ -15,6 +15,8 @@ import time import weakref +from intbitset import intbitset + from .i18n import _ from .node import ( hex, @@ -1278,7 +1280,7 @@ checkambigfiles=_cachedfiles) tr.changes['revs'] = xrange(0, 0) tr.changes['obsmarkers'] = set() -tr.changes['phases'] = [set() for i in range(7)] +tr.changes['phases'] = [intbitset() for i in range(6)] tr.changes['bookmarks'] = {} tr.hookargs['txnid'] = txnid To: joerg.sonnenberger, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1617: rebase: extract _assignworkingcopy
phillco updated this revision to Diff 4277. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1617?vs=4248&id=4277 REVISION DETAIL https://phab.mercurial-scm.org/D1617 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -382,14 +382,16 @@ self.prepared = True -def _performrebase(self, tr): -repo, ui = self.repo, self.ui -# Assign a working copy object. +def _assignworkingcopy(self): if self.inmemory: from mercurial.context import overlayworkingctx self.wctx = overlayworkingctx(self.repo) else: self.wctx = self.repo[None] + +def _performrebase(self, tr): +self._assignworkingcopy() +repo, ui = self.repo, self.ui if self.keepbranchesf: # insert _savebranch at the start of extrafns so if # there's a user-provided extrafn it can clobber branch if To: phillco, #hg-reviewers, dlax Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1616: rebase: disable `inmemory` if the rebaseset contains the working copy
phillco updated this revision to Diff 4276. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1616?vs=4247&id=4276 REVISION DETAIL https://phab.mercurial-scm.org/D1616 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -830,7 +830,8 @@ else: destmap = _definedestmap(ui, repo, destf, srcf, basef, revf, destspace=destspace, - inmemory=opts['inmemory']) + opts=opts) +rbsrt.inmemory = opts['inmemory'] retcode = rbsrt._preparenewrebase(destmap) if retcode is not None: return retcode @@ -850,7 +851,7 @@ rbsrt._finishrebase() def _definedestmap(ui, repo, destf=None, srcf=None, basef=None, revf=None, - destspace=None, inmemory=False): + destspace=None, opts=None): """use revisions argument to define destmap {srcrev: destrev}""" if revf is None: revf = [] @@ -864,7 +865,7 @@ if revf and srcf: raise error.Abort(_('cannot specify both a revision and a source')) -if not inmemory: +if not opts['inmemory']: cmdutil.checkunfinished(repo) cmdutil.bailifchanged(repo) @@ -939,6 +940,22 @@ ui.status(_('nothing to rebase from %s to %s\n') % ('+'.join(str(repo[r]) for r in base), dest)) return None +# If rebasing the working copy parent, force in-memory merge to be off. +# +# This is because the extra work of checking out the newly rebased commit +# outweights the benefits of rebasing in-memory, and executing an extra +# update command adds a bit of overhead, so better to just do it on disk. In +# all other cases leave it on. +# +# Note that there are cases where this isn't true -- e.g., rebasing large +# stacks that include the WCP. However, I'm not yet sure where the cutoff +# is. +rebasingwcp = repo['.'].rev() in rebaseset +if opts['inmemory'] and rebasingwcp: +opts['inmemory'] = False +# Check these since we did not before. +cmdutil.checkunfinished(repo) +cmdutil.bailifchanged(repo) if not destf: dest = repo[_destrebase(repo, rebaseset, destspace=destspace)] To: phillco, #hg-reviewers, dlax Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@35308: 44 new changesets
44 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/1f30cbac34b6 changeset: 35265:1f30cbac34b6 user:Boris Feld date:Tue Oct 17 15:39:34 2017 +0200 summary: bundle2: add a 'modes' dictionary to the bundle operation https://www.mercurial-scm.org/repo/hg/rev/496154e41968 changeset: 35266:496154e41968 user:Boris Feld date:Tue Oct 17 15:26:16 2017 +0200 summary: bundle2: support a 'records' mode for the 'bookmarks' part https://www.mercurial-scm.org/repo/hg/rev/cb4dcd7fabe7 changeset: 35267:cb4dcd7fabe7 user:Boris Feld date:Tue Oct 17 15:27:17 2017 +0200 summary: getbundle: add support for 'bookmarks' boolean argument https://www.mercurial-scm.org/repo/hg/rev/44b8b5ad30eb changeset: 35268:44b8b5ad30eb user:Boris Feld date:Tue Oct 17 15:27:22 2017 +0200 summary: pull: retrieve bookmarks through the binary part when possible https://www.mercurial-scm.org/repo/hg/rev/2af38229f147 changeset: 35269:2af38229f147 user:Yuya Nishihara date:Thu Sep 22 15:52:09 2016 +0900 summary: test-log: test that fctx.ancestors() can't index parents only by linkrev https://www.mercurial-scm.org/repo/hg/rev/0d27685b4a2f changeset: 35270:0d27685b4a2f user:Yuya Nishihara date:Thu Sep 22 17:16:53 2016 +0900 summary: dagop: copy basefilectx.ancestors() to free function https://www.mercurial-scm.org/repo/hg/rev/d90c534099b1 changeset: 35271:d90c534099b1 user:Yuya Nishihara date:Sun Oct 22 17:23:34 2017 +0900 summary: filectx: extract helper method to obtain filectx pointing to its introrev https://www.mercurial-scm.org/repo/hg/rev/70e86db6a913 changeset: 35272:70e86db6a913 user:Yuya Nishihara date:Thu Sep 22 17:48:46 2016 +0900 summary: dagop: yield intro filectx by filectxancestors() https://www.mercurial-scm.org/repo/hg/rev/8dee2080f35c changeset: 35273:8dee2080f35c user:Yuya Nishihara date:Thu Sep 22 18:01:55 2016 +0900 summary: dagop: use fctx.rev() consistently in filectxancestors() https://www.mercurial-scm.org/repo/hg/rev/2b348dc3239a changeset: 35274:2b348dc3239a user:Yuya Nishihara date:Thu Sep 22 18:11:37 2016 +0900 summary: dagop: change visit dict of filectxancestors() indexed solely by rev https://www.mercurial-scm.org/repo/hg/rev/b4b328ea6175 changeset: 35275:b4b328ea6175 user:Yuya Nishihara date:Thu Sep 22 18:18:56 2016 +0900 summary: dagop: put start fctx into visit dict of filectxancestors() https://www.mercurial-scm.org/repo/hg/rev/205c3c6c1a51 changeset: 35276:205c3c6c1a51 user:Yuya Nishihara date:Thu Sep 22 18:23:58 2016 +0900 summary: dagop: extend filectxancestors() to walk multiple files https://www.mercurial-scm.org/repo/hg/rev/6ba79cf34f5e changeset: 35277:6ba79cf34f5e user:Matthieu Laneuville date:Thu Oct 26 00:13:38 2017 +0900 summary: patch: add within-line color diff capacity https://www.mercurial-scm.org/repo/hg/rev/0768708589ef changeset: 35278:0768708589ef user:Matt Harbison date:Thu Nov 16 21:05:15 2017 -0500 summary: lfs-test: note a problem with unpushed lfs files and cloning/sharing https://www.mercurial-scm.org/repo/hg/rev/be4481d6222e changeset: 35279:be4481d6222e user:Matt Harbison date:Tue Dec 05 23:08:59 2017 -0500 summary: largefiles: refactor _usercachedir() to allow reuse with lfs https://www.mercurial-scm.org/repo/hg/rev/8e72f9152c4d changeset: 35280:8e72f9152c4d user:Matt Harbison date:Wed Dec 06 22:56:15 2017 -0500 summary: lfs: introduce a user level cache for lfs files https://www.mercurial-scm.org/repo/hg/rev/010179e21e91 changeset: 35281:010179e21e91 user:Phil Cohen date:Fri Dec 01 00:07:23 2017 -0800 summary: context: switch ctx() use to changectx() https://www.mercurial-scm.org/repo/hg/rev/46d7f0713a87 changeset: 35282:46d7f0713a87 user:Phil Cohen date:Fri Dec 01 00:07:23 2017 -0800 summary: filemerge: raise InMemoryMergeConflictsError if we hit merge conflicts in IMM https://www.mercurial-scm.org/repo/hg/rev/46510597d266 changeset: 35283:46510597d266 user:Phil Cohen date:Fri Dec 01 00:07:23 2017 -0800 summary: merge: remove calls to flushall() https://www.mercurial-scm.org/repo/hg/rev/1b03407e808d changeset: 35284:1b03407e808d user:Phil Cohen date:Fri Dec 01 00:07:23 2017 -0800 summary: merge: skip subrepo state, update hooks, and updating the dirstate in IMM https://www.mercurial-scm.org/repo/hg/rev/3ceebf497057 changeset: 35285:3ceebf497057 user:Phil Cohen date:Fri Dec 01 00:07:23 2017 -0800 summary: overlayworkingctx: remove flushall() https://www.mercurial-scm.org/repo/hg/rev/307b1689e3f8 changeset: 35286:307b1689e3f8 user:Phil Cohen date:Fri
D1606: phases: drop the list with phase of each rev, always comput phase sets
quark added inline comments. INLINE COMMENTS > yuja wrote in phases.py:236 > Nit: could be written as `fullrepoest(repo) - baseset(revs)`. `baseset.__contains__` is slower than `set.__contains__` so the current code is faster. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1606 To: joerg.sonnenberger, #hg-reviewers, quark, yuja Cc: yuja, durin42, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1620: revset: use phasecache.getrevset to calculate public()
quark created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Other revsets like secret(), draft(), _nonpublic() are using phasescache.getrevset already. The latter is more efficient after https://phab.mercurial-scm.org/D1606. So let's migrate the public() revset function too. Tested using: $ hg debugshell --hidden --cwd hg-committed` In [1]: %timeit len(repo.revs('public()')) - Before https://phab.mercurial-scm.org/D1606: 10 loops, best of 3: 22.5 ms per loop - Before this change, after https://phab.mercurial-scm.org/D1606: 10 loops, best of 3: 28.6 ms per loop - After this change: 10 loops, best of 3: 20.2 ms per loop Therefore `public()` revset becomes even slightly faster after the data structure change by https://phab.mercurial-scm.org/D1606. A similar performance win could also be observed on a large repo. A side effect is `phasecache.getrevset` needs to take a `subset` parameter. That was added with a default value so it won't cause BC issues. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1620 AFFECTED FILES mercurial/phases.py mercurial/revset.py CHANGE DETAILS diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1504,8 +1504,7 @@ def _phase(repo, subset, *targets): """helper to select all rev in phases""" -s = repo._phasecache.getrevset(repo, targets) -return subset & s +return repo._phasecache.getrevset(repo, targets, subset) @predicate('draft()', safe=True) def draft(repo, subset, x): @@ -1612,11 +1611,7 @@ """Changeset in public phase.""" # i18n: "public" is a keyword getargs(x, 0, 0, _("public takes no arguments")) -phase = repo._phasecache.phase -target = phases.public -condition = lambda r: phase(repo, r) == target -return subset.filter(condition, condrepr=('', target), - cache=False) +return _phase(repo, subset, phases.public) @predicate('remote([id [,path]])', safe=False) def remote(repo, subset, x): diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -208,7 +208,7 @@ self.filterunknown(repo) self.opener = repo.svfs -def getrevset(self, repo, phases): +def getrevset(self, repo, phases, subset=None): """return a smartset for the given phases""" self.loadphaserevs(repo) # ensure phase's sets are loaded phases = set(phases) @@ -222,7 +222,10 @@ revs = set.union(*[self._phasesets[p] for p in phases]) if repo.changelog.filteredrevs: revs = revs - repo.changelog.filteredrevs -return smartset.baseset(revs) +if subset is None: +return smartset.baseset(revs) +else: +return subset & smartset.baseset(revs) else: phases = set(allphases).difference(phases) if not phases: @@ -232,9 +235,11 @@ revs = self._phasesets[p] else: revs = set.union(*[self._phasesets[p] for p in phases]) +if subset is None: +subset = smartset.fullreposet(repo) if not revs: -return smartset.fullreposet(repo) -return smartset.fullreposet(repo).filter(lambda r: r not in revs) +return subset +return subset.filter(lambda r: r not in revs) def copy(self): # Shallow copy meant to ensure isolation in To: quark, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1619: highlight: eagerly discover plugin lexers while demandimport is off
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Since highlight is only relevant for servers, it seems worthwhile to just trigger this eagerly, which avoids really weird traceback problems caused by demandimport messing with some of the lexer plugins. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1619 AFFECTED FILES hgext/highlight/highlight.py CHANGE DETAILS diff --git a/hgext/highlight/highlight.py b/hgext/highlight/highlight.py --- a/hgext/highlight/highlight.py +++ b/hgext/highlight/highlight.py @@ -22,8 +22,12 @@ import pygments import pygments.formatters import pygments.lexers +import pygments.plugin import pygments.util +for unused in pygments.plugin.find_plugin_lexers(): +pass + highlight = pygments.highlight ClassNotFound = pygments.util.ClassNotFound guess_lexer = pygments.lexers.guess_lexer 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
D1244: overlayworkingctx: invalidate the manifest cache when changing parents
This revision was automatically updated to reflect the committed changes. Closed by commit rHG777cb4497d8d: overlayworkingctx: invalidate the manifest cache when changing parents (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1244?vs=4258&id=4273 REVISION DETAIL https://phab.mercurial-scm.org/D1244 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 @@ -1999,6 +1999,10 @@ def setbase(self, wrappedctx): self._wrappedctx = wrappedctx self._parents = [wrappedctx] +# Drop old manifest cache as it is now out of date. +# This is necessary when, e.g., rebasing several nodes with one +# ``overlayworkingctx`` (e.g. with --collapse). +util.clearcachedproperty(self, '_manifest') def data(self, path): if self.isdirty(path): To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1243: overlayworkingctx: add `_compact()`
This revision was automatically updated to reflect the committed changes. Closed by commit rHGdc9da4f4f363: overlayworkingctx: add `_compact()` (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1243?vs=4249&id=4272 REVISION DETAIL https://phab.mercurial-scm.org/D1243 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 @@ -2225,6 +2225,29 @@ def clean(self): self._cache = {} +def _compact(self): +"""Removes keys from the cache that are actually clean, by comparing +them with the underlying context. + +This can occur during the merge process, e.g. by passing --tool :local +to resolve a conflict. +""" +keys = [] +for path in self._cache.keys(): +cache = self._cache[path] +try: +underlying = self._wrappedctx[path] +if (underlying.data() == cache['data'] and +underlying.flags() == cache['flags']): +keys.append(path) +except error.ManifestLookupError: +# Path not in the underlying manifest (created). +continue + +for path in keys: +del self._cache[path] +return keys + def _markdirty(self, path, exists, data=None, date=None, flags=''): self._cache[path] = { 'exists': exists, To: phillco, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1238: overlayworkingctx: add _manifest, files(), added(), removed(), modified()
This revision was automatically updated to reflect the committed changes. Closed by commit rHG2e1c32a9c97b: overlayworkingctx: add _manifest, files(), added(), removed(), modified() (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1238?vs=4230&id=4267 REVISION DETAIL https://phab.mercurial-scm.org/D1238 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 @@ -2014,6 +2014,43 @@ else: return self._wrappedctx[path].data() +@propertycache +def _manifest(self): +parents = self.parents() +man = parents[0].manifest().copy() + +flag = self._flagfunc +for path in self.added(): +man[path] = addednodeid +man.setflag(path, flag(path)) +for path in self.modified(): +man[path] = modifiednodeid +man.setflag(path, flag(path)) +for path in self.removed(): +del man[path] +return man + +@propertycache +def _flagfunc(self): +def f(path): +return self._cache[path]['flags'] +return f + +def files(self): +return sorted(self.added() + self.modified() + self.removed()) + +def modified(self): +return [f for f in self._cache.keys() if self._cache[f]['exists'] and +self._existsinparent(f)] + +def added(self): +return [f for f in self._cache.keys() if self._cache[f]['exists'] and +not self._existsinparent(f)] + +def removed(self): +return [f for f in self._cache.keys() if +not self._cache[f]['exists'] and self._existsinparent(f)] + def isinmemory(self): return True To: phillco, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1242: overlayworkingctx: add ``tomemctx()`` and ``commit()``
This revision was automatically updated to reflect the committed changes. Closed by commit rHG71edd38c4bb4: overlayworkingctx: add ``tomemctx()`` (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1242?vs=4234&id=4271 REVISION DETAIL https://phab.mercurial-scm.org/D1242 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 @@ -2177,6 +2177,42 @@ self._path) return self._wrappedctx[path].size() +def tomemctx(self, text, branch=None, extra=None, date=None, parents=None, + user=None, editor=None): +"""Converts this ``overlayworkingctx`` into a ``memctx`` ready to be +committed. + +``text`` is the commit message. +``parents`` (optional) are rev numbers. +""" +# Default parents to the wrapped contexts' if not passed. +if parents is None: +parents = self._wrappedctx.parents() +if len(parents) == 1: +parents = (parents[0], None) + +# ``parents`` is passed as rev numbers; convert to ``commitctxs``. +if parents[1] is None: +parents = (self._repo[parents[0]], None) +else: +parents = (self._repo[parents[0]], self._repo[parents[1]]) + +files = self._cache.keys() +def getfile(repo, memctx, path): +if self._cache[path]['exists']: +return memfilectx(repo, path, + self._cache[path]['data'], + 'l' in self._cache[path]['flags'], + 'x' in self._cache[path]['flags'], + self._cache[path]['copied'], + memctx) +else: +# Returning None, but including the path in `files`, is +# necessary for memctx to register a deletion. +return None +return memctx(self._repo, parents, text, files, getfile, date=date, + extra=extra, user=user, branch=branch, editor=editor) + def isdirty(self, path): return path in self._cache To: phillco, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1241: overlayworkingctx: add _auditconflicts to write()
This revision was automatically updated to reflect the committed changes. Closed by commit rHG72fbdd373de8: overlayworkingctx: add _auditconflicts to write() (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1241?vs=4233&id=4270 REVISION DETAIL https://phab.mercurial-scm.org/D1241 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 @@ -2092,9 +2092,50 @@ except error.ManifestLookupError: return False +def _auditconflicts(self, path): +"""Replicates conflict checks done by wvfs.write(). + +Since we never write to the filesystem and never call `applyupdates` in +IMM, we'll never check that a path is actually writable -- e.g., because +it adds `a/foo`, but `a` is actually a file in the other commit. +""" +def fail(path, component): +# p1() is the base and we're receiving "writes" for p2()'s +# files. +if 'l' in self.p1()[component].flags(): +raise error.Abort("error: %s conflicts with symlink %s " + "in %s." % (path, component, + self.p1().rev())) +else: +raise error.Abort("error: '%s' conflicts with file '%s' in " + "%s." % (path, component, + self.p1().rev())) + +# Test that each new directory to be created to write this path from p2 +# is not a file in p1. +components = path.split('/') +for i in xrange(len(components)): +component = "/".join(components[0:i]) +if component in self.p1(): +fail(path, component) + +# Test the other direction -- that this path from p2 isn't a directory +# in p1 (test that p1 doesn't any paths matching `path/*`). +match = matchmod.match('/', '', [path + '/'], default=b'relpath') +matches = self.p1().manifest().matches(match) +if len(matches) > 0: +if len(matches) == 1 and matches.keys()[0] == path: +return +raise error.Abort("error: file '%s' cannot be written because " + " '%s/' is a folder in %s (containing %d " + "entries: %s)" + % (path, path, self.p1(), len(matches), + ', '.join(matches.keys( + def write(self, path, data, flags=''): if data is None: raise error.ProgrammingError("data must be non-None") +self._auditconflicts(path) self._markdirty(path, exists=True, data=data, date=util.makedate(), flags=flags) To: phillco, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1239: overlayworkingctx: add a no-op ``clearunknown()``
This revision was automatically updated to reflect the committed changes. Closed by commit rHGbaf58e621363: overlayworkingctx: add a no-op ``clearunknown()`` (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1239?vs=4231&id=4268 REVISION DETAIL https://phab.mercurial-scm.org/D1239 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 @@ -2217,6 +2217,9 @@ def remove(self, ignoremissing=False): return self._parent.remove(self._path) +def clearunknown(self): +pass + class workingcommitctx(workingctx): """A workingcommitctx object makes access to data related to the revision being committed convenient. To: phillco, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1240: overlayworkingctx: inherit from committablectx instead of workingctx
This revision was automatically updated to reflect the committed changes. Closed by commit rHG8e1386b342f7: overlayworkingctx: inherit from committablectx instead of workingctx (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1240?vs=4232&id=4269 REVISION DETAIL https://phab.mercurial-scm.org/D1240 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 @@ -1976,9 +1976,9 @@ def setflags(self, l, x): self._repo.wvfs.setflags(self._path, l, x) -class overlayworkingctx(workingctx): -"""Wraps another mutable context with a write-back cache that can be flushed -at a later time. +class overlayworkingctx(committablectx): +"""Wraps another mutable context with a write-back cache that can be +converted into a commit context. self._cache[path] maps to a dict with keys: { 'exists': bool? @@ -2161,7 +2161,7 @@ return overlayworkingfilectx(self._repo, path, parent=self, filelog=filelog) -class overlayworkingfilectx(workingfilectx): +class overlayworkingfilectx(committablefilectx): """Wrap a ``workingfilectx`` but intercepts all writes into an in-memory cache, which can be flushed through later by calling ``flush()``.""" To: phillco, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1245: rebase: pass wctx to rebasenode()
This revision was automatically updated to reflect the committed changes. Closed by commit rHG259feddc04e6: rebase: pass wctx to rebasenode() (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1245?vs=4260&id=4262 REVISION DETAIL https://phab.mercurial-scm.org/D1245 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -481,7 +481,7 @@ ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'rebase') stats = rebasenode(repo, rev, p1, base, self.state, - self.collapsef, dest) + self.collapsef, dest, wctx=self.wctx) if stats and stats[3] > 0: if self.wctx.isinmemory(): raise error.InMemoryMergeConflictsError() @@ -992,7 +992,7 @@ repo.dirstate.setbranch(repo[newnode].branch()) return newnode -def rebasenode(repo, rev, p1, base, state, collapse, dest): +def rebasenode(repo, rev, p1, base, state, collapse, dest, wctx): 'Rebase a single revision rev on top of p1 using base as merge ancestor' # Merge phase # Update to destination and merge it with local To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1248: rebase: add concludememorynode(), and call it when rebasing in-memory
This revision was automatically updated to reflect the committed changes. Closed by commit rHG228916ca12b5: rebase: add concludememorynode(), and call it when rebasing in-memory (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1248?vs=4245&id=4265 REVISION DETAIL https://phab.mercurial-scm.org/D1248 AFFECTED FILES hgext/rebase.py mercurial/context.py CHANGE DETAILS diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2102,6 +2102,12 @@ def isdirty(self, path): return path in self._cache +def isempty(self): +# We need to discard any keys that are actually clean before the empty +# commit check. +self._compact() +return len(self._cache) == 0 + def clean(self): self._cache = {} diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -495,11 +495,21 @@ merging = p2 != nullrev editform = cmdutil.mergeeditform(merging, 'rebase') editor = cmdutil.getcommiteditor(editform=editform, **opts) -newnode = concludenode(repo, rev, p1, p2, - extrafn=_makeextrafn(self.extrafns), - editor=editor, - keepbranches=self.keepbranchesf, - date=self.date) +if self.wctx.isinmemory(): +newnode = concludememorynode(repo, rev, p1, p2, +wctx=self.wctx, +extrafn=_makeextrafn(self.extrafns), +editor=editor, +keepbranches=self.keepbranchesf, +date=self.date) +mergemod.mergestate.clean(repo) +else: +newnode = concludenode(repo, rev, p1, p2, +extrafn=_makeextrafn(self.extrafns), +editor=editor, +keepbranches=self.keepbranchesf, +date=self.date) + if newnode is None: # If it ended up being a no-op commit, then the normal # merge state clean-up path doesn't happen, so do it @@ -552,13 +562,22 @@ dsguard = None if ui.configbool('rebase', 'singletransaction'): dsguard = dirstateguard.dirstateguard(repo, 'rebase') -with util.acceptintervention(dsguard): -newnode = concludenode(repo, revtoreuse, p1, self.external, - commitmsg=commitmsg, - extrafn=_makeextrafn(self.extrafns), - editor=editor, - keepbranches=self.keepbranchesf, - date=self.date) +if self.inmemory: +newnode = concludememorynode(repo, revtoreuse, p1, +self.external, +commitmsg=commitmsg, +extrafn=_makeextrafn(self.extrafns), +editor=editor, +keepbranches=self.keepbranchesf, +date=self.date, wctx=self.wctx) +else: +with util.acceptintervention(dsguard): +newnode = concludenode(repo, revtoreuse, p1, self.external, +commitmsg=commitmsg, +extrafn=_makeextrafn(self.extrafns), +editor=editor, +keepbranches=self.keepbranchesf, +date=self.date) if newnode is not None: newrev = repo[newnode].rev() for oldrev in self.state.iterkeys(): @@ -964,6 +983,44 @@ (max(destancestors), ', '.join(str(p) for p in sorted(parents +def concludememorynode(repo, rev, p1, p2, wctx=None, + commitmsg=None, editor=None, extrafn=None, + keepbranches=False, date=None): +'''Commit the wd changes with parents p1 and p2. Reuse commit info from rev +but also store useful information in extra. +Return node of committed revision.''' +ctx = repo[rev] +if commitmsg is None: +commitmsg = ctx.description() +keepbranch = keepbranches and repo[p1].branch() != ctx.branch() +extra = {'rebase_source': ctx.hex()} +if extrafn: +extrafn(ctx, extra) + +destphase = max(ctx.phase(), phases.draft) +overrides = {('phases', 'new-commit'): destphase} +with repo.ui.configoverride(overrides, 'rebase'): +if keepbranch: +repo.ui.setconf
D1247: rebase: pass the wctx object (IMM or on-disk) to merge.update
This revision was automatically updated to reflect the committed changes. Closed by commit rHG2bac2d836ce0: rebase: pass the wctx object (IMM or on-disk) to merge.update (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1247?vs=4212&id=4264 REVISION DETAIL https://phab.mercurial-scm.org/D1247 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -1017,7 +1017,7 @@ # When collapsing in-place, the parent is the common ancestor, we # have to allow merging with it. stats = mergemod.update(repo, rev, True, True, base, collapse, -labels=['dest', 'source']) +labels=['dest', 'source'], wc=wctx) if collapse: copies.duplicatecopies(repo, wctx, rev, dest) else: To: phillco, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1249: rebase: rerun a rebase on-disk if IMM merge conflicts arise
This revision was automatically updated to reflect the committed changes. Closed by commit rHGd901a88891fe: rebase: rerun a rebase on-disk if IMM merge conflicts arise (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1249?vs=4261&id=4266 REVISION DETAIL https://phab.mercurial-scm.org/D1249 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -759,6 +759,25 @@ unresolved conflicts. """ +if opts.get('continue') or opts.get('abort'): +# in-memory rebase is not compatible with resuming rebases. +opts['inmemory'] = False + +if opts.get('inmemory', False): +try: +# in-memory merge doesn't support conflicts, so if we hit any, abort +# and re-run as an on-disk merge. +return _origrebase(ui, repo, **opts) +except error.InMemoryMergeConflictsError: +ui.warn(_('hit merge conflicts; re-running rebase without in-memory' + ' merge\n')) +_origrebase(ui, repo, **{'abort': True}) +opts['inmemory'] = False +return _origrebase(ui, repo, **opts) +else: +return _origrebase(ui, repo, **opts) + +def _origrebase(ui, repo, **opts): opts = pycompat.byteskwargs(opts) if 'inmemory' not in opts: opts['inmemory'] = False To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1246: rebase: do not update if IMM; instead, set the overlaywctx's parents
This revision was automatically updated to reflect the committed changes. Closed by commit rHG5c25fe7fb1e6: rebase: do not update if IMM; instead, set the overlaywctx's parents (authored by phillco, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1246?vs=4259&id=4263 REVISION DETAIL https://phab.mercurial-scm.org/D1246 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -507,7 +507,10 @@ mergemod.mergestate.clean(repo) else: # Skip commit if we are collapsing -repo.setparents(repo[p1].node()) +if self.wctx.isinmemory(): +self.wctx.setbase(repo[p1]) +else: +repo.setparents(repo[p1].node()) newnode = None # Update the state if newnode is not None: @@ -570,7 +573,8 @@ if newwd < 0: # original directory is a parent of rebase set root or ignored newwd = self.originalwd -if newwd not in [c.rev() for c in repo[None].parents()]: +if (newwd not in [c.rev() for c in repo[None].parents()] and +not self.inmemory): ui.note(_("update back to initial working directory parent\n")) hg.updaterepo(repo, newwd, False) @@ -996,18 +1000,22 @@ 'Rebase a single revision rev on top of p1 using base as merge ancestor' # Merge phase # Update to destination and merge it with local -if repo['.'].rev() != p1: -repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1])) -mergemod.update(repo, p1, False, True) +if wctx.isinmemory(): +wctx.setbase(repo[p1]) else: -repo.ui.debug(" already in destination\n") -repo.dirstate.write(repo.currenttransaction()) +# This is necessary to invalidate workingctx's caches. +wctx = repo[None] +if repo['.'].rev() != p1: +repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1])) +mergemod.update(repo, p1, False, True) +else: +repo.ui.debug(" already in destination\n") +repo.dirstate.write(repo.currenttransaction()) repo.ui.debug(" merge against %d:%s\n" % (rev, repo[rev])) if base is not None: repo.ui.debug(" detach base %d:%s\n" % (base, repo[base])) # When collapsing in-place, the parent is the common ancestor, we # have to allow merging with it. -wctx = repo[None] stats = mergemod.update(repo, rev, True, True, base, collapse, labels=['dest', 'source']) if collapse: To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1249: rebase: rerun a rebase on-disk if IMM merge conflicts arise
phillco added a comment. I've moved the comment back to `rebase()` to fix the help issue. I'm mostly neutral on using recursion or using this approach, though I think having to pass a flag to prevent infinite recursion would be messy. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1249 To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1249: rebase: rerun a rebase on-disk if IMM merge conflicts arise
phillco updated this revision to Diff 4261. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1249?vs=4246&id=4261 REVISION DETAIL https://phab.mercurial-scm.org/D1249 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -759,6 +759,25 @@ unresolved conflicts. """ +if opts.get('continue') or opts.get('abort'): +# in-memory rebase is not compatible with resuming rebases. +opts['inmemory'] = False + +if opts.get('inmemory', False): +try: +# in-memory merge doesn't support conflicts, so if we hit any, abort +# and re-run as an on-disk merge. +return _origrebase(ui, repo, **opts) +except error.InMemoryMergeConflictsError: +ui.warn(_('hit merge conflicts; re-running rebase without in-memory' + ' merge\n')) +_origrebase(ui, repo, **{'abort': True}) +opts['inmemory'] = False +return _origrebase(ui, repo, **opts) +else: +return _origrebase(ui, repo, **opts) + +def _origrebase(ui, repo, **opts): opts = pycompat.byteskwargs(opts) if 'inmemory' not in opts: opts['inmemory'] = False To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1245: rebase: pass wctx to rebasenode()
phillco added inline comments. INLINE COMMENTS > dlax wrote in rebase.py:995 > Isn't it meant to be used in the function body? I see a `wctx = repo[None]` > below, perhaps it should be dropped. > > But this wouldn't work with a `None` default value as mentioned in the next > patch. Yes, it's used in the next patch. But you're right that it's the only callsite, so I've made it non-optional. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1245 To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1245: rebase: pass wctx to rebasenode()
phillco updated this revision to Diff 4260. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1245?vs=4210&id=4260 REVISION DETAIL https://phab.mercurial-scm.org/D1245 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -481,7 +481,7 @@ ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'rebase') stats = rebasenode(repo, rev, p1, base, self.state, - self.collapsef, dest) + self.collapsef, dest, wctx=self.wctx) if stats and stats[3] > 0: if self.wctx.isinmemory(): raise error.InMemoryMergeConflictsError() @@ -992,7 +992,7 @@ repo.dirstate.setbranch(repo[newnode].branch()) return newnode -def rebasenode(repo, rev, p1, base, state, collapse, dest): +def rebasenode(repo, rev, p1, base, state, collapse, dest, wctx): 'Rebase a single revision rev on top of p1 using base as merge ancestor' # Merge phase # Update to destination and merge it with local To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1246: rebase: do not update if IMM; instead, set the overlaywctx's parents
phillco added inline comments. INLINE COMMENTS > dlax wrote in rebase.py:1003 > `wctx` has a default value of `None`, so either it shouldn't have that or > there should be a check for `None` here. Good point -- dropped. > dlax wrote in rebase.py:1007 > `wctx` is redefined here. This is intentional. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1246 To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1246: rebase: do not update if IMM; instead, set the overlaywctx's parents
phillco updated this revision to Diff 4259. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1246?vs=4211&id=4259 REVISION DETAIL https://phab.mercurial-scm.org/D1246 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -507,7 +507,10 @@ mergemod.mergestate.clean(repo) else: # Skip commit if we are collapsing -repo.setparents(repo[p1].node()) +if self.wctx.isinmemory(): +self.wctx.setbase(repo[p1]) +else: +repo.setparents(repo[p1].node()) newnode = None # Update the state if newnode is not None: @@ -570,7 +573,8 @@ if newwd < 0: # original directory is a parent of rebase set root or ignored newwd = self.originalwd -if newwd not in [c.rev() for c in repo[None].parents()]: +if (newwd not in [c.rev() for c in repo[None].parents()] and +not self.inmemory): ui.note(_("update back to initial working directory parent\n")) hg.updaterepo(repo, newwd, False) @@ -996,18 +1000,22 @@ 'Rebase a single revision rev on top of p1 using base as merge ancestor' # Merge phase # Update to destination and merge it with local -if repo['.'].rev() != p1: -repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1])) -mergemod.update(repo, p1, False, True) +if wctx.isinmemory(): +wctx.setbase(repo[p1]) else: -repo.ui.debug(" already in destination\n") -repo.dirstate.write(repo.currenttransaction()) +# This is necessary to invalidate workingctx's caches. +wctx = repo[None] +if repo['.'].rev() != p1: +repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1])) +mergemod.update(repo, p1, False, True) +else: +repo.ui.debug(" already in destination\n") +repo.dirstate.write(repo.currenttransaction()) repo.ui.debug(" merge against %d:%s\n" % (rev, repo[rev])) if base is not None: repo.ui.debug(" detach base %d:%s\n" % (base, repo[base])) # When collapsing in-place, the parent is the common ancestor, we # have to allow merging with it. -wctx = repo[None] stats = mergemod.update(repo, rev, True, True, base, collapse, labels=['dest', 'source']) if collapse: To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1616: rebase: disable `inmemory` if the rebaseset contains the working copy
phillco added a comment. @dlax you mean the parts where we pass `opts` instead of `inmemory`? This is necessary for the function to mutate `opts['inmemory']`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1616 To: phillco, #hg-reviewers, dlax Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1244: overlayworkingctx: invalidate the manifest cache when changing parents
phillco updated this revision to Diff 4258. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1244?vs=4236&id=4258 REVISION DETAIL https://phab.mercurial-scm.org/D1244 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 @@ -1999,6 +1999,10 @@ def setbase(self, wrappedctx): self._wrappedctx = wrappedctx self._parents = [wrappedctx] +# Drop old manifest cache as it is now out of date. +# This is necessary when, e.g., rebasing several nodes with one +# ``overlayworkingctx`` (e.g. with --collapse). +util.clearcachedproperty(self, '_manifest') def data(self, path): if self.isdirty(path): To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1244: overlayworkingctx: invalidate the manifest cache when changing parents
phillco added inline comments. INLINE COMMENTS > dlax wrote in context.py:2003 > Wouldn't `util.clearcachedproperty(self, '_manifest')` work? Thanks! I did not know about it -- will use. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1244 To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1249: rebase: rerun a rebase on-disk if IMM merge conflicts arise
phillco added inline comments. INLINE COMMENTS > durin42 wrote in rebase.py:667 > It's just a style thing. I find avoiding recursion to generally be clearer. > > @phillco dlax is right, the docstring needs fixed here (I'm surprised tests > passed...) huh, weird. not sure how they did. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1249 To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] run-tests: if ran outside of tests/, we should not search CWD for hg lib
> On Dec 7, 2017, at 21:46, matthieu.laneuvi...@octobus.net wrote: > > # HG changeset patch > # User Matthieu Laneuville > # Date 1512650569 -32400 > # Thu Dec 07 21:42:49 2017 +0900 > # Node ID cd24cca4374384c80700782913c906c375d13e93 > # Parent af5507203d01d76ccb1d9ec04b1c9827d6017be9 > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > cd24cca43743 > # EXP-Topic runtest-libfix > run-tests: if ran outside of tests/, we should not search CWD for hg lib > > Since a18eef03d879, it is possible to start run-tests.py from another > directory. > If hg base folder is used, the local library is loaded preferentially which > leads to an 'unexpected mercurial lib used' warning. > > This is because CWD is always prepended to PYPATH by default, which doesn't do > anything, unless one happens to be in hg base directory. This patch insures > that > in a testing environment, CWD is removed from PYPATH, and the corresponding > test > was also updated. I assume you mean that `pwd` is implicitly on sys.path, right? Not that run-tests is doing something to add `pwd` to sys.path via PYTHONPATH? > > diff -r af5507203d01 -r cd24cca43743 hg > --- a/hg Sun Oct 15 18:02:11 2017 +0200 > +++ b/hg Thu Dec 07 21:42:49 2017 +0900 > @@ -27,6 +27,11 @@ if libdir != '@' 'LIBDIR' '@': > libdir = os.path.abspath(libdir) > sys.path.insert(0, libdir) > > +# if called by run-tests, make sure we don't import CWD hg by mistake > +if os.environ.get('TESTDIR', False): > +if sys.path[0] == os.path.dirname(os.path.abspath(__file__)): > +sys.path.remove(sys.path[0]) Yikes. This feels like the wrong fix, as you're now modifying the globally-installed hg stub to be aware of the test runner. > + > # enable importing on demand to reduce startup time > try: > if sys.version_info[0] < 3 or sys.version_info >= (3, 6): > diff -r af5507203d01 -r cd24cca43743 tests/run-tests.py > --- a/tests/run-tests.py Sun Oct 15 18:02:11 2017 +0200 > +++ b/tests/run-tests.py Thu Dec 07 21:42:49 2017 +0900 > @@ -2898,7 +2898,13 @@ class TestRunner(object): > if self._hgpath is not None: > return self._hgpath > > -cmd = b'%s -c "import mercurial; print (mercurial.__path__[0])"' > +# if run from somewhere else than tests/, avoid searching CWD for hg > lib > +if os.getcwd() != os.path.dirname(os.path.abspath(__file__)): > +cmd = b'%s -c "import sys; sys.path.remove(\'\'); ' \ > + 'import mercurial; print (mercurial.__path__[0])"' > +else: > +cmd = b'%s -c "import mercurial; print (mercurial.__path__[0])"' > + > cmd = cmd % PYTHON > if PYTHON3: > cmd = _strpath(cmd) > ___ > 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: [PATCH] hgweb: rewrite `template = A and B or C` to be a proper ternary operator
> On Dec 8, 2017, at 10:00, Anton Shestakov wrote: > > # HG changeset patch > # User Anton Shestakov > # Date 1512743234 -28800 > # Fri Dec 08 22:27:14 2017 +0800 > # Node ID 2cc3c1ae70e2286aa612b08a1671e6a5d77b4a22 > # Parent cb0df5a3affba6e8f1789de337230cbeecda9c5a > # EXP-Topic hgweb-cleanup > hgweb: rewrite `template = A and B or C` to be a proper ternary operator queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] check-code: allow tabs in heredoc
> On Dec 8, 2017, at 10:58, Yuya Nishihara wrote: > > # HG changeset patch > # User Yuya Nishihara > # Date 1512747555 -32400 > # Sat Dec 09 00:39:15 2017 +0900 > # Node ID ef030121dac2ff448db7d9bf667419b6249717c6 > # Parent dd85117b9bcace7416d51e7d59b492d00b4e44c7 > check-code: allow tabs in heredoc queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1612: fsmonitor: fsmonitor should send wlock notifications to watchman
This revision was automatically updated to reflect the committed changes. Closed by commit rHGc67fb3bfe3a1: fsmonitor: fsmonitor should send wlock notifications to watchman (authored by ekent, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1612?vs=4164&id=4257 REVISION DETAIL https://phab.mercurial-scm.org/D1612 AFFECTED FILES hgext/fsmonitor/__init__.py CHANGE DETAILS diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py --- a/hgext/fsmonitor/__init__.py +++ b/hgext/fsmonitor/__init__.py @@ -161,6 +161,9 @@ configitem('fsmonitor', 'blacklistusers', default=list, ) +configitem('experimental', 'fsmonitor.transaction_notify', +default=False, +) # This extension is incompatible with the following blacklisted extensions # and will disable itself when encountering one of these: @@ -656,14 +659,18 @@ self.enter() def enter(self): -# We explicitly need to take a lock here, before we proceed to update -# watchman about the update operation, so that we don't race with -# some other actor. merge.update is going to take the wlock almost -# immediately anyway, so this is effectively extending the lock -# around a couple of short sanity checks. +# Make sure we have a wlock prior to sending notifications to watchman. +# We don't want to race with other actors. In the update case, +# merge.update is going to take the wlock almost immediately. We are +# effectively extending the lock around several short sanity checks. if self.oldnode is None: self.oldnode = self.repo['.'].node() -self._lock = self.repo.wlock() + +if self.repo.currentwlock() is None: +if util.safehasattr(self.repo, 'wlocknostateupdate'): +self._lock = self.repo.wlocknostateupdate() +else: +self._lock = self.repo.wlock() self.need_leave = self._state( 'state-enter', hex(self.oldnode)) @@ -784,4 +791,34 @@ orig = super(fsmonitorrepo, self).status return overridestatus(orig, self, *args, **kwargs) +def wlocknostateupdate(self, *args, **kwargs): +return super(fsmonitorrepo, self).wlock(*args, **kwargs) + +def wlock(self, *args, **kwargs): +l = super(fsmonitorrepo, self).wlock(*args, **kwargs) +if not ui.configbool( +"experimental", "fsmonitor.transaction_notify"): +return l +if l.held != 1: +return l +origrelease = l.releasefn + +def staterelease(): +if origrelease: +origrelease() +if l.stateupdate: +l.stateupdate.exit() +l.stateupdate = None + +try: +l.stateupdate = None +l.stateupdate = state_update(self, name="hg.transaction") +l.stateupdate.enter() +l.releasefn = staterelease +except Exception as e: +# Swallow any errors; fire and forget +self.ui.log( +'watchman', 'Exception in state update %s\n', e) +return l + repo.__class__ = fsmonitorrepo To: ekent, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1611: fsmonitor: remove watchman transaction and working copy change notifications
This revision was automatically updated to reflect the committed changes. Closed by commit rHG73abb81ccb28: fsmonitor: remove watchman transaction and working copy change notifications (authored by ekent, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1611?vs=4163&id=4256 REVISION DETAIL https://phab.mercurial-scm.org/D1611 AFFECTED FILES hgext/fsmonitor/__init__.py CHANGE DETAILS diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py --- a/hgext/fsmonitor/__init__.py +++ b/hgext/fsmonitor/__init__.py @@ -117,7 +117,6 @@ from mercurial.i18n import _ from mercurial.node import ( hex, -nullid, ) from mercurial import ( @@ -162,12 +161,6 @@ configitem('fsmonitor', 'blacklistusers', default=list, ) -configitem('experimental', 'fsmonitor.transaction_notify', -default=False, -) -configitem('experimental', 'fsmonitor.wc_change_notify', -default=False, -) # This extension is incompatible with the following blacklisted extensions # and will disable itself when encountering one of these: @@ -609,14 +602,6 @@ self._fsmonitorstate.invalidate() return super(fsmonitordirstate, self).invalidate(*args, **kwargs) -if dirstate._ui.configbool( -"experimental", "fsmonitor.wc_change_notify"): -def setparents(self, p1, p2=nullid): -with state_update(self._repo, name="hg.wc_change", - oldnode=self._pl[0], newnode=p1, - partial=False): -return super(fsmonitordirstate, self).setparents(p1, p2) - dirstate.__class__ = fsmonitordirstate dirstate._fsmonitorinit(repo) @@ -799,32 +784,4 @@ orig = super(fsmonitorrepo, self).status return overridestatus(orig, self, *args, **kwargs) -if ui.configbool("experimental", "fsmonitor.transaction_notify"): -def transaction(self, *args, **kwargs): -tr = super(fsmonitorrepo, self).transaction( - *args, **kwargs) -if tr.count != 1: -return tr -stateupdate = state_update(self, name="hg.transaction") -stateupdate.enter() - -class fsmonitortrans(tr.__class__): -def _abort(self): -try: -result = super(fsmonitortrans, self)._abort() -finally: -stateupdate.exit(abort=True) -return result - -def close(self): -try: -result = super(fsmonitortrans, self).close() -finally: -if self.count == 0: -stateupdate.exit() -return result - -tr.__class__ = fsmonitortrans -return tr - repo.__class__ = fsmonitorrepo To: ekent, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1616: rebase: disable `inmemory` if the rebaseset contains the working copy
dlax added a comment. In https://phab.mercurial-scm.org/D1616#27819, @durin42 wrote: > @dlax I see a request changes here, but I don't see any commentary as to why? I meant to comment that the first hunks (i.e. those above the big comment block) seem unrelated and to ask for clarification. No idea where my comment went, sorry... REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1616 To: phillco, #hg-reviewers, dlax Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1249: rebase: rerun a rebase on-disk if IMM merge conflicts arise
durin42 accepted this revision. durin42 added inline comments. INLINE COMMENTS > dlax wrote in rebase.py:667 > Why would that be nice? Do you foresee any problem? > It just makes the code harder to follow, IMHO. > > Besides, now the `rebase()` no longer has a docstring, meaning that help is > broken. It's just a style thing. I find avoiding recursion to generally be clearer. @phillco dlax is right, the docstring needs fixed here (I'm surprised tests passed...) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1249 To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1249: rebase: rerun a rebase on-disk if IMM merge conflicts arise
dlax added inline comments. INLINE COMMENTS > durin42 wrote in rebase.py:667 > Avoiding the recursion seems like a nice thing to me. I prefer what Phil has > to just doing recursion... Why would that be nice? Do you foresee any problem? It just makes the code harder to follow, IMHO. Besides, now the `rebase()` no longer has a docstring, meaning that help is broken. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1249 To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@35264: 4 new changesets
4 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/f392066d127c changeset: 35261:f392066d127c user:Boris Feld date:Tue Oct 17 12:07:24 2017 +0200 summary: bookmark: add pushkey hook compatiblity to the bundle2 part https://www.mercurial-scm.org/repo/hg/rev/3fd5f05a5b87 changeset: 35262:3fd5f05a5b87 user:Boris Feld date:Sun Oct 15 19:22:56 2017 +0200 summary: push: move bundle2-pushkey based bookmarks exchange in its own function https://www.mercurial-scm.org/repo/hg/rev/ae79d878702b changeset: 35263:ae79d878702b user:Boris Feld date:Tue Oct 17 12:37:39 2017 +0200 summary: bookmark: introduce in advance a variant of the exchange test https://www.mercurial-scm.org/repo/hg/rev/a1e70c1dbec0 changeset: 35264:a1e70c1dbec0 bookmark:@ tag: tip user:Boris Feld date:Tue Oct 17 12:38:13 2017 +0200 summary: bookmark: use the 'bookmarks' bundle2 part to push bookmark update (issue5165) -- 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
D1616: rebase: disable `inmemory` if the rebaseset contains the working copy
durin42 added a comment. @dlax I see a request changes here, but I don't see any commentary as to why? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1616 To: phillco, #hg-reviewers, dlax Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1249: rebase: rerun a rebase on-disk if IMM merge conflicts arise
durin42 added inline comments. INLINE COMMENTS > dlax wrote in rebase.py:667 > Do we need to make another function? Can't we call rebase again with options > modified? Avoiding the recursion seems like a nice thing to me. I prefer what Phil has to just doing recursion... REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1249 To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1285: repoview: add a new attribute _visibilityexceptions and related API
pulkit added a comment. In https://phab.mercurial-scm.org/D1285#27808, @yuja wrote: > > I have spend a lot of time on this and I am unable to make this work without making it class attribute because to calculate filterrevs, unfilteredrepo is passed and I lose the reference to the object on which I initially stored the visibilityexceptions. If I call `repo.filtered(filtername)`, I am getting a new object with empty visibilityexception set. > > How long should the visibilityexception be preserved? The visibility exceptions must be preserved until we calculate filteredrevs for that filter. After adding the expections, we clear filteredrevcache to make sure we calculate that again. > The safest one is to bind it to a temporary filteredrepo object, so that new `.filtered()` > object won't see it. > > We could attach it to `unfi`, but in which case, we have to be careful to not leak > the current visibilityexception to the subsequent sessions. A `repo` object may > live longer than a single command/request session in hgweb or command server. Since we want them while calculating filteredrevs where we pass a unfiltered repo, we need a way to get visibilityexceptions for a filtername from unfi. Maybe we can clear out the exceptions after using them. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1285 To: pulkit, #hg-reviewers, quark, yuja Cc: yuja, lothiraldan, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1285: repoview: add a new attribute _visibilityexceptions and related API
yuja added a comment. > I have spend a lot of time on this and I am unable to make this work without making it class attribute because to calculate filterrevs, unfilteredrepo is passed and I lose the reference to the object on which I initially stored the visibilityexceptions. If I call `repo.filtered(filtername)`, I am getting a new object with empty visibilityexception set. How long should the visibilityexception be preserved? The safest one is to bind it to a temporary filteredrepo object, so that new `.filtered()` object won't see it. We could attach it to `unfi`, but in which case, we have to be careful to not leak the current visibilityexception to the subsequent sessions. A `repo` object may live longer than a single command/request session in hgweb or command server. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1285 To: pulkit, #hg-reviewers, quark, yuja Cc: yuja, lothiraldan, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 2] cat: record the current behavior of wildcard matches in subrepos
On Thu, 7 Dec 2017 11:54:00 -0600, Kevin Bullock wrote: > > I think "make hg recurse subrepos by default" is a noticeable BC since > > we'll have to specify --no-subrepo to get files in the root repository, for > > example. > > We wouldn't need to grow a flag for that, a fileset could do it: `hg status > -X 'set:insubrepo()'` Yes, that's nicer than a flag. But my points is you'll be surprised if "hg files" suddenly starts showing all files including subrepos if you are accustomed to the current subrepo behavior. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] check-code: allow tabs in heredoc
# HG changeset patch # User Yuya Nishihara # Date 1512747555 -32400 # Sat Dec 09 00:39:15 2017 +0900 # Node ID ef030121dac2ff448db7d9bf667419b6249717c6 # Parent dd85117b9bcace7416d51e7d59b492d00b4e44c7 check-code: allow tabs in heredoc diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -135,7 +135,6 @@ testpats = [ (r'if\s*!', "don't use '!' to negate exit status"), (r'/dev/u?random', "don't use entropy, use /dev/zero"), (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"), -(r'^( *)\t', "don't use tabs to indent"), (r'sed (-e )?\'(\d+|/[^/]*/)i(?!\\\n)', "put a backslash-escaped newline after sed 'i' command"), (r'^diff *-\w*[uU].*$\n(^ \$ |^$)', "prefix diff -u/-U with cmp"), @@ -225,6 +224,7 @@ utestpats = [ ] ] +# transform plain test rules to unified test's for i in [0, 1]: for tp in testpats[i]: p = tp[0] @@ -235,6 +235,11 @@ for i in [0, 1]: p = r"^ [$>] .*(%s)" % p utestpats[i].append((p, m) + tp[2:]) +# don't transform the following rules: +# " > \t" and " \t" should be allowed in unified tests +testpats[0].append((r'^( *)\t', "don't use tabs to indent")) +utestpats[0].append((r'^( ?)\t', "don't use tabs to indent")) + utestfilters = [ (r"<<(\S+)((.|\n)*?\n > \1)", rephere), (r"( +)(#([^!][^\n]*\S)?)", repcomment), diff --git a/tests/test-contrib-check-code.t b/tests/test-contrib-check-code.t --- a/tests/test-contrib-check-code.t +++ b/tests/test-contrib-check-code.t @@ -173,6 +173,17 @@ don't use old-style two-argument raise, use Exception(message) [1] + $ cat < tab.t + >indent + > >heredoc + > EOF + $ "$check_code" tab.t + tab.t:1: + > indent + don't use tabs to indent + [1] + $ rm tab.t + $ cat > rst.py < """problematic rst text > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1606: phases: drop the list with phase of each rev, always comput phase sets
This revision was automatically updated to reflect the committed changes. Closed by commit rHGd13526333835: phases: drop the list with phase of each rev, always comput phase sets (authored by joerg.sonnenberger, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D1606?vs=4228&id=4254#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1606?vs=4228&id=4254 REVISION DETAIL https://phab.mercurial-scm.org/D1606 AFFECTED FILES mercurial/cext/parsers.c mercurial/cext/revlog.c mercurial/localrepo.py mercurial/phases.py mercurial/policy.py CHANGE DETAILS diff --git a/mercurial/policy.py b/mercurial/policy.py --- a/mercurial/policy.py +++ b/mercurial/policy.py @@ -75,7 +75,7 @@ (r'cext', r'diffhelpers'): 1, (r'cext', r'mpatch'): 1, (r'cext', r'osutil'): 1, -(r'cext', r'parsers'): 3, +(r'cext', r'parsers'): 4, } # map import request to other package or module diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -115,6 +115,7 @@ ) from . import ( error, +pycompat, smartset, txnutil, util, @@ -202,46 +203,54 @@ if _load: # Cheap trick to allow shallow-copy without copy module self.phaseroots, self.dirty = _readroots(repo, phasedefaults) -self._phaserevs = None +self._phasemaxrev = nullrev self._phasesets = None self.filterunknown(repo) self.opener = repo.svfs def getrevset(self, repo, phases): """return a smartset for the given phases""" self.loadphaserevs(repo) # ensure phase's sets are loaded - -if self._phasesets and all(self._phasesets[p] is not None - for p in phases): -# fast path - use _phasesets -revs = self._phasesets[phases[0]] -if len(phases) > 1: -revs = revs.copy() # only copy when needed -for p in phases[1:]: -revs.update(self._phasesets[p]) +phases = set(phases) +if public not in phases: +# fast path: _phasesets contains the interesting sets, +# might only need a union and post-filtering. +if len(phases) == 1: +[p] = phases +revs = self._phasesets[p] +else: +revs = set.union(*[self._phasesets[p] for p in phases]) if repo.changelog.filteredrevs: revs = revs - repo.changelog.filteredrevs return smartset.baseset(revs) else: -# slow path - enumerate all revisions -phase = self.phase -revs = (r for r in repo if phase(repo, r) in phases) -return smartset.generatorset(revs, iterasc=True) +phases = set(allphases).difference(phases) +if not phases: +return smartset.fullreposet(repo) +if len(phases) == 1: +[p] = phases +revs = self._phasesets[p] +else: +revs = set.union(*[self._phasesets[p] for p in phases]) +if not revs: +return smartset.fullreposet(repo) +return smartset.fullreposet(repo).filter(lambda r: r not in revs) def copy(self): # Shallow copy meant to ensure isolation in # advance/retractboundary(), nothing more. ph = self.__class__(None, None, _load=False) ph.phaseroots = self.phaseroots[:] ph.dirty = self.dirty ph.opener = self.opener -ph._phaserevs = self._phaserevs +ph._phasemaxrev = self._phasemaxrev ph._phasesets = self._phasesets return ph def replace(self, phcache): """replace all values in 'self' with content of phcache""" -for a in ('phaseroots', 'dirty', 'opener', '_phaserevs', '_phasesets'): +for a in ('phaseroots', 'dirty', 'opener', '_phasemaxrev', + '_phasesets'): setattr(self, a, getattr(phcache, a)) def _getphaserevsnative(self, repo): @@ -253,54 +262,53 @@ def _computephaserevspure(self, repo): repo = repo.unfiltered() -revs = [public] * len(repo.changelog) -self._phaserevs = revs -self._populatephaseroots(repo) -for phase in trackedphases: -roots = list(map(repo.changelog.rev, self.phaseroots[phase])) -if roots: -for rev in roots: -revs[rev] = phase -for rev in repo.changelog.descendants(roots): -revs[rev] = phase +cl = repo.changelog +self._phasesets = [set() for phase in allphases] +roots = pycompat.maplist(cl.rev, self.phaseroots[secret]) +if roots: +ps = set(cl.descendants(roots)) +for root in roots: +ps.add(root) +
D1615: transaction: build changes['revs'] as range instead of a set
This revision was automatically updated to reflect the committed changes. Closed by commit rHG137a08d82232: transaction: build changes['revs'] as range instead of a set (authored by joerg.sonnenberger, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1615?vs=4229&id=4253 REVISION DETAIL https://phab.mercurial-scm.org/D1615 AFFECTED FILES mercurial/changelog.py mercurial/localrepo.py mercurial/obsutil.py mercurial/scmutil.py CHANGE DETAILS diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -1262,7 +1262,7 @@ @reportsummary def reportnewcs(repo, tr): """Report the range of new revisions pulled/unbundled.""" -newrevs = list(tr.changes.get('revs', set())) +newrevs = tr.changes.get('revs', xrange(0, 0)) if not newrevs: return diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py --- a/mercurial/obsutil.py +++ b/mercurial/obsutil.py @@ -441,12 +441,12 @@ public = phases.public addedmarkers = tr.changes.get('obsmarkers') addedrevs = tr.changes.get('revs') -seenrevs = set(addedrevs) +seenrevs = set() obsoleted = set() for mark in addedmarkers: node = mark[0] rev = torev(node) -if rev is None or rev in seenrevs: +if rev is None or rev in seenrevs or rev in addedrevs: continue seenrevs.add(rev) if phase(repo, rev) == public: diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1275,7 +1275,7 @@ validator=validate, releasefn=releasefn, checkambigfiles=_cachedfiles) -tr.changes['revs'] = set() +tr.changes['revs'] = xrange(0, 0) tr.changes['obsmarkers'] = set() tr.changes['phases'] = {} tr.changes['bookmarks'] = {} diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -541,5 +541,10 @@ *args, **kwargs) revs = transaction.changes.get('revs') if revs is not None: -revs.add(rev) +if revs: +assert revs[-1] + 1 == rev +revs = xrange(revs[0], rev + 1) +else: +revs = xrange(rev, rev + 1) +transaction.changes['revs'] = revs return node To: joerg.sonnenberger, #hg-reviewers, quark, yuja Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1610: ui: add diff.showfunc to tweakdefaults
This revision was automatically updated to reflect the committed changes. Closed by commit rHG4caafe280488: ui: add diff.showfunc to tweakdefaults (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1610?vs=4161&id=4252 REVISION DETAIL https://phab.mercurial-scm.org/D1610 AFFECTED FILES mercurial/ui.py CHANGE DETAILS diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -62,6 +62,7 @@ [diff] git = 1 +showfunc = 1 """ samplehgrcs = { To: durin42, #hg-reviewers, dlax, yuja Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1609: ui: add curses interface to tweakdefaults
This revision was automatically updated to reflect the committed changes. Closed by commit rHG03a83ace9816: ui: add curses interface to tweakdefaults (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1609?vs=4160&id=4251 REVISION DETAIL https://phab.mercurial-scm.org/D1609 AFFECTED FILES mercurial/ui.py CHANGE DETAILS diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -51,6 +51,8 @@ rollback = False # Make `hg status` report copy information statuscopies = yes +# Prefer curses UIs when available. Revert to plain-text with `text`. +interface = curses [commands] # Make `hg status` emit cwd-relative paths by default. To: durin42, #hg-reviewers, quark, pulkit, yuja Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 2] patch: reverse _inlinediff output for consistency
On Fri, 08 Dec 2017 18:42:11 +0900, matthieu.laneuvi...@octobus.net wrote: > # HG changeset patch > # User Matthieu Laneuville > # Date 1512719238 -32400 > # Fri Dec 08 16:47:18 2017 +0900 > # Node ID 8e3ebafd54d664a1f3ce2032b20cff92b5b399fb > # Parent 483b5dd0f1aa412e9611ab694279c9d3735fee99 > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > 8e3ebafd54d6 > # EXP-Topic inline-diff > patch: reverse _inlinediff output for consistency Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] patch: move part of tabsplitter logic in _inlinediff
On Fri, 08 Dec 2017 22:54:12 +0900, matthieu.laneuvi...@octobus.net wrote: > # HG changeset patch > # User Matthieu Laneuville > # Date 1512721211 -32400 > # Fri Dec 08 17:20:11 2017 +0900 > # Node ID 06f6f388daf0d5177aa9d92bf92e9e8edf190a9f > # Parent a1215935559d6e2afa49be0a1601b6ba8eaa7dbf > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > 06f6f388daf0 > # EXP-Topic inline-diff > patch: move part of tabsplitter logic in _inlinediff > > It cannot be entirely moved within _inlinediff as long as worddiff is > experimental (when turned off, matches is always an empty dict). Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] hgweb: rewrite `template = A and B or C` to be a proper ternary operator
# HG changeset patch # User Anton Shestakov # Date 1512743234 -28800 # Fri Dec 08 22:27:14 2017 +0800 # Node ID 2cc3c1ae70e2286aa612b08a1671e6a5d77b4a22 # Parent cb0df5a3affba6e8f1789de337230cbeecda9c5a # EXP-Topic hgweb-cleanup hgweb: rewrite `template = A and B or C` to be a proper ternary operator diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -413,7 +413,7 @@ def changelog(web, req, tmpl, shortlog=F else: nextentry = [] -return tmpl(shortlog and 'shortlog' or 'changelog', changenav=changenav, +return tmpl('shortlog' if shortlog else 'changelog', changenav=changenav, node=ctx.hex(), rev=pos, symrev=symrev, changesets=count, entries=entries, latestentry=latestentry, nextentry=nextentry, diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -411,7 +411,7 @@ def changesetentry(web, req, tmpl, ctx): files = [] parity = paritygen(web.stripecount) for blockno, f in enumerate(ctx.files()): -template = f in ctx and 'filenodelink' or 'filenolink' +template = 'filenodelink' if f in ctx else 'filenolink' files.append(tmpl(template, node=ctx.hex(), file=f, blockno=blockno + 1, parity=next(parity))) @@ -572,7 +572,7 @@ def diffstat(tmpl, ctx, statgen, parity) fileno = 0 for filename, adds, removes, isbinary in stats: -template = filename in files and 'diffstatlink' or 'diffstatnolink' +template = 'diffstatlink' if filename in files else 'diffstatnolink' total = adds + removes fileno += 1 yield tmpl(template, node=ctx.hex(), file=filename, fileno=fileno, ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1606: phases: drop the list with phase of each rev, always comput phase sets
yuja accepted this revision. yuja added a comment. This revision is now accepted and ready to land. Queued, thanks. Can you send follow-up patches to address trivial issues? INLINE COMMENTS > revlog.c:692 > for (i = 0; i < len; i++) { > PyObject *phaseval; > Removed unused variable in flight. > phases.py:205 > self.phaseroots, self.dirty = _readroots(repo, phasedefaults) > -self._phaserevs = None > +self._phasemaxrev = nullrev > self._phasesets = None Nit: this isn't the "max" revision, but the size. Perhaps the initial value should be 0. > phases.py:236 > +return smartset.fullreposet(repo) > +return smartset.fullreposet(repo).filter(lambda r: r not in revs) > Nit: could be written as `fullrepoest(repo) - baseset(revs)`. > phases.py:264 > repo = repo.unfiltered() > -revs = [public] * len(repo.changelog) > -self._phaserevs = revs > -self._populatephaseroots(repo) > -for phase in trackedphases: > -roots = list(map(repo.changelog.rev, self.phaseroots[phase])) > -if roots: > -for rev in roots: > -revs[rev] = phase > -for rev in repo.changelog.descendants(roots): > -revs[rev] = phase > +cl = repo.changelog > +self._phasesets = [set() for phase in allphases] Nice, no dependency on repo. As a follow-up, maybe we can extract a pure function as truly drop-in replacement for the native function. > phases.py:266 > +self._phasesets = [set() for phase in allphases] > +roots = map(cl.rev, self.phaseroots[secret]) > +if roots: s/map/pycompat.maplist/ for Python 3 compatibility. Fixed in flight. > phases.py:295 > def phase(self, repo, rev): > # We need a repo argument here to be able to build _phaserevs > # if necessary. The repository instance is not stored in s/_phaserevs/_phasesets/. Fixed in flight. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1606 To: joerg.sonnenberger, #hg-reviewers, quark, yuja Cc: yuja, durin42, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
pulkit requested changes to this revision. pulkit added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > test-obshistory.t:190 > + $ hg update 471597cad322 > + abort: hidden revision '471597cad322' successors: 337fec4d2edc, > f257fde29c7a! > + (use --hidden to access hidden revisions) This one looks odd. Please make this one similar to other split message. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1591 To: lothiraldan, #hg-reviewers, durin42, pulkit Cc: pulkit, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] patch: move part of tabsplitter logic in _inlinediff
# HG changeset patch # User Matthieu Laneuville # Date 1512721211 -32400 # Fri Dec 08 17:20:11 2017 +0900 # Node ID 06f6f388daf0d5177aa9d92bf92e9e8edf190a9f # Parent a1215935559d6e2afa49be0a1601b6ba8eaa7dbf # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 06f6f388daf0 # EXP-Topic inline-diff patch: move part of tabsplitter logic in _inlinediff It cannot be entirely moved within _inlinediff as long as worddiff is experimental (when turned off, matches is always an empty dict). diff -r a1215935559d -r 06f6f388daf0 mercurial/patch.py --- a/mercurial/patch.pyFri Dec 08 16:54:59 2017 +0900 +++ b/mercurial/patch.pyFri Dec 08 17:20:11 2017 +0900 @@ -2510,16 +2510,15 @@ def difflabel(func, *args, **kw): for prefix, label in prefixes: if stripline.startswith(prefix): if diffline: -for token in tabsplitter.findall(stripline): -if '\t' == token[0]: -yield (token, 'diff.tab') -else: -if i in matches: -for t, l in _inlinediff( - lines[i].rstrip(), - lines[matches[i]].rstrip(), - label): -yield (t, l) +if i in matches: +for t, l in _inlinediff(lines[i].rstrip(), +lines[matches[i]].rstrip(), +label): +yield (t, l) +else: +for token in tabsplitter.findall(stripline): +if '\t' == token[0]: +yield (token, 'diff.tab') else: yield (token, label) else: @@ -2581,11 +2580,13 @@ def _inlinediff(s1, s2, operation): s = difflib.ndiff(re.split(br'(\W)', s2), re.split(br'(\W)', s1)) for part in s: -if part[0] in operation_skip: +if part[0] in operation_skip or len(part) == 2: continue l = operation + '.highlight' if part[0] in ' ': l = operation +if part[2:] == '\t': +l = 'diff.tab' if l == label: # contiguous token with same label token += part[2:] continue diff -r a1215935559d -r 06f6f388daf0 tests/test-diff-color.t --- a/tests/test-diff-color.t Fri Dec 08 16:54:59 2017 +0900 +++ b/tests/test-diff-color.t Fri Dec 08 17:20:11 2017 +0900 @@ -269,6 +269,9 @@ test inline color diff > this is the second line > third line starts with space > + starts with a plus sign + >this one with one tab + >now with full two tabs + >now tabseverywhere, much fun > > this line won't change > @@ -281,11 +284,15 @@ test inline color diff > EOF $ hg add file1 $ hg ci -m 'commit' + $ cat > file1 << EOF > that is the first paragraph > this is the second line > third line starts with space > - starts with a minus sign + >this one with two tab + >now with full three tabs + >now there are tabs everywhere, much fun > > this line won't change > @@ -301,15 +308,21 @@ test inline color diff [diff.diffline|diff --git a/file1 b/file1] [diff.file_a|--- a/file1] [diff.file_b|+++ b/file1] - [diff.hunk|@@ -1,13 +1,14 @@] + [diff.hunk|@@ -1,16 +1,17 @@] [diff.deleted|-this is the first line] [diff.deleted|-this is the second line] [diff.deleted|-third line starts with space] [diff.deleted|-+ starts with a plus sign] + [diff.deleted|-][diff.tab| ][diff.deleted|this one with one tab] + [diff.deleted|-][diff.tab| ][diff.deleted|now with full two tabs] + [diff.deleted|-][diff.tab| ][diff.deleted|now tabs][diff.tab| ][diff.deleted|everywhere, much fun] [diff.inserted|+that is the first paragraph] [diff.inserted|+this is the second line] [diff.inserted|+third line starts with space] [diff.inserted|+- starts with a minus sign] + [diff.inserted|+][diff.tab| ][diff.inserted|this one with two tab] + [diff.inserted|+][diff.tab| ][diff.inserted|now with full three tabs] + [diff.inserted|+][diff.tab| ][diff.inserted|now there are tabs][diff.tab| ][diff.inserted|everywhere, much fun] this line won't change @@ -328,15 +341,21 @@ test inline color diff [diff.diffline|diff --git a/file1 b/file1] [diff.file_a|--- a/file1] [diff.file_b|+++ b/file1] - [diff.hunk|@@ -1,13 +1,14 @
[PATCH 5 of 6] upgrade: add a 'redeltafullall' mode
# HG changeset patch # User Boris Feld # Date 1512674823 -3600 # Thu Dec 07 20:27:03 2017 +0100 # Node ID f020935650c9a3ba2c762524bde86243fbd39fe3 # Parent 5ac3ff23878f3a58a88540e776f9aa845ebbdd62 # EXP-Topic upgrade.config # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r f020935650c9 upgrade: add a 'redeltafullall' mode We add a new mode for delta recomputation, when selected, each full text will go through the full "addrevision" mechanism again. This is slower than "redeltaall" but this gives the opportunity for extensions to trigger special logic. For example, the lfs extensions can decide to promote some revision to lfs storage during the upgrade. diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -2264,7 +2264,9 @@ class revlog(object): DELTAREUSESAMEREVS = 'samerevs' DELTAREUSENEVER = 'never' -DELTAREUSEALL = {'always', 'samerevs', 'never'} +DELTAREUSEFULLADD = 'fulladd' + +DELTAREUSEALL = {'always', 'samerevs', 'never', 'fulladd'} def clone(self, tr, destrevlog, addrevisioncb=None, deltareuse=DELTAREUSESAMEREVS, aggressivemergedeltas=None): @@ -2355,18 +2357,24 @@ class revlog(object): if not cachedelta: rawtext = self.revision(rev, raw=True) -ifh = destrevlog.opener(destrevlog.indexfile, 'a+', -checkambig=False) -dfh = None -if not destrevlog._inline: -dfh = destrevlog.opener(destrevlog.datafile, 'a+') -try: -destrevlog._addrevision(node, rawtext, tr, linkrev, p1, p2, -flags, cachedelta, ifh, dfh) -finally: -if dfh: -dfh.close() -ifh.close() + +if deltareuse == self.DELTAREUSEFULLADD: +destrevlog.addrevision(rawtext, tr, linkrev, p1, p2, + cachedelta=cachedelta, + node=node, flags=flags) +else: +ifh = destrevlog.opener(destrevlog.indexfile, 'a+', +checkambig=False) +dfh = None +if not destrevlog._inline: +dfh = destrevlog.opener(destrevlog.datafile, 'a+') +try: +destrevlog._addrevision(node, rawtext, tr, linkrev, p1, +p2, flags, cachedelta, ifh, dfh) +finally: +if dfh: +dfh.close() +ifh.close() if addrevisioncb: addrevisioncb(self, rev, node) diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -369,6 +369,19 @@ def findoptimizations(repo): 'recomputed; this will likely drastically slow down ' 'execution time'))) +optimizations.append(improvement( +name='redeltafulladd', +type=optimisation, +description=_('every revision will be re-added as if it was new ' + 'content. It will go through the full storage ' + 'mechanism giving extensions a chance to process it ' + '(eg. lfs). This is similar to "redeltaall" but even ' + 'slower since more logic is involved.'), +upgrademessage=_('each revision will be added as new content to the ' + 'internal storage; this will likely drastically slow ' + 'down execution time, but some extensions might need ' + 'it'))) + return optimizations def determineactions(repo, deficiencies, sourcereqs, destreqs): @@ -618,6 +631,8 @@ def _upgraderepo(ui, srcrepo, dstrepo, r deltareuse = revlog.revlog.DELTAREUSESAMEREVS elif 'redeltamultibase' in actions: deltareuse = revlog.revlog.DELTAREUSESAMEREVS +if 'redeltafulladd' in actions: +deltareuse = revlog.revlog.DELTAREUSEFULLADD else: deltareuse = revlog.revlog.DELTAREUSEALWAYS diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t +++ b/tests/test-upgrade-repo.t @@ -100,6 +100,9 @@ An upgrade of a repository created with redeltaall deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed + redeltafulladd + every revision will be re-added as if it was new content. It will go through the full st
[PATCH 6 of 6] lfs: allow to run 'debugupgraderepo' on repo with largefiles
# HG changeset patch # User Boris Feld # Date 1512680178 -3600 # Thu Dec 07 21:56:18 2017 +0100 # Node ID 7cacbb9241087919b600713e3f3aad76ca17cac3 # Parent f020935650c9a3ba2c762524bde86243fbd39fe3 # EXP-Topic upgrade.config # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 7cacbb924108 lfs: allow to run 'debugupgraderepo' on repo with largefiles The extensions wrap the necessary function to ensure the 'lfs' requirements won't be dropped. It is now possible to run `hg debugupgraderepo` on a repository with lfs. diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py --- a/hgext/lfs/__init__.py +++ b/hgext/lfs/__init__.py @@ -46,6 +46,7 @@ from mercurial import ( registrar, revlog, scmutil, +upgrade, vfs as vfsmod, ) @@ -139,6 +140,12 @@ def extsetup(ui): wrapfunction(scmutil, 'wrapconvertsink', wrapper.convertsink) +wrapfunction(upgrade, 'preservedrequirements', + wrapper.upgraderequirements) + +wrapfunction(upgrade, 'supporteddestrequirements', + wrapper.upgraderequirements) + wrapfunction(changegroup, 'supportedoutgoingversions', wrapper.supportedoutgoingversions) diff --git a/hgext/lfs/wrapper.py b/hgext/lfs/wrapper.py --- a/hgext/lfs/wrapper.py +++ b/hgext/lfs/wrapper.py @@ -302,3 +302,9 @@ def uploadblobs(repo, pointers): remoteblob = repo.svfs.lfsremoteblobstore remoteblob.writebatch(pointers, repo.svfs.lfslocalblobstore) + +def upgraderequirements(orig, repo): +reqs = orig(repo) +if 'lfs' in repo.requirements: +reqs.add('lfs') +return reqs ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 6] upgrade: use the repository 'ui' as the base for the new repository
# HG changeset patch # User Boris Feld # Date 1512669335 -3600 # Thu Dec 07 18:55:35 2017 +0100 # Node ID 2c12e70358f6754054becbf4c016ef5ca2bedddb # Parent 90a8cc66a579cf9122e8fef91e4bc1f48062ff60 # EXP-Topic upgrade.config # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 2c12e70358f6 upgrade: use the repository 'ui' as the base for the new repository The `repo.baseui` contains all the configuration but the one specific to the repository (so it can be used when dealing with local peer and sub- repository). However, we need the repository config to be taken into account when doing the upgrade. Otherwise, the upgrade related config that exists in the repository config won't be taken into account when performing the update. A buggy and surprising behavior. We had to work around protection set around `repo.ui.copy` since we are an uncommon case. diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -830,9 +830,22 @@ def upgraderepo(ui, repo, run=False, opt try: ui.write(_('creating temporary repository to stage migrated ' 'data: %s\n') % tmppath) -dstrepo = localrepo.localrepository(repo.baseui, -path=tmppath, -create=True) + +# repo.ui is protected against copy: +# +# running `repo.ui.copy` actually call `repo.baseui.copy`. Here, we +# -really- wants to copy the actual `repo.ui` object (since we +# create a copy of the repository). +# +# We have to work around the protection. +oldcopy = repo.ui.copy +try: +repo.ui.__dict__.pop('copy', None) +dstrepo = localrepo.localrepository(repo.ui, +path=tmppath, +create=True) +finally: +repo.ui.copy = oldcopy with dstrepo.wlock(), dstrepo.lock(): backuppath = _upgraderepo(ui, repo, dstrepo, newreqs, diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t +++ b/tests/test-upgrade-repo.t @@ -531,12 +531,12 @@ repository config is taken in account migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) migrating 497 bytes in store; 882 bytes tracked data migrating 1 filelogs containing 3 revisions (182 bytes in store; 573 bytes tracked data) - finished migrating 3 filelog revisions across 1 filelogs; change in size: 0 bytes + finished migrating 3 filelog revisions across 1 filelogs; change in size: -63 bytes migrating 1 manifests containing 3 revisions (141 bytes in store; 138 bytes tracked data) finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 3 revisions (174 bytes in store; 171 bytes tracked data) finished migrating 3 changelog revisions; change in size: 0 bytes - finished migrating 9 total revisions; total change in store size: 0 bytes + finished migrating 9 total revisions; total change in store size: -63 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository @@ -552,7 +552,7 @@ repository config is taken in account revoffset length delta linkrev nodeid p1 p2 0 0 77 -1 0 bcc1d3df78b2 177 21 0 1 af3e29f7a72e bcc1d3df78b2 - 298 84 -1 2 8daf79c5522b af3e29f7a72e + 298 21 1 2 8daf79c5522b af3e29f7a72e $ cd .. $ cat << EOF >> $HGRCPATH ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 4 of 6] upgrade: use actual filelog to convert filelog
# HG changeset patch # User Boris Feld # Date 1512682638 -3600 # Thu Dec 07 22:37:18 2017 +0100 # Node ID 5ac3ff23878f3a58a88540e776f9aa845ebbdd62 # Parent 0711e3f3c5915d976f72ce22d138437d84c42701 # EXP-Topic upgrade.config # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 5ac3ff23878f upgrade: use actual filelog to convert filelog Extensions can add extra logic related to the config, so we must use the actual class. The path used needs minimal transformation for this to work. diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -14,6 +14,7 @@ from .i18n import _ from . import ( changelog, error, +filelog, hg, localrepo, manifest, @@ -413,9 +414,8 @@ def _revlogfrompath(repo, path): mandir = path[:-len('00manifest.i')] return manifest.manifestrevlog(repo.svfs, dir=mandir) else: -# Filelogs don't do anything special with settings. So we can use a -# vanilla revlog. -return revlog.revlog(repo.svfs, path) +#reverse of "/".join(("data", path + ".i")) +return filelog.filelog(repo.svfs, path[5:-2]) def _copyrevlogs(ui, srcrepo, dstrepo, tr, deltareuse, aggressivemergedeltas): """Copy revlogs between 2 repos.""" ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 6] upgrade: add a test to show the repository config being ignored
# HG changeset patch # User Boris Feld # Date 1512676224 -3600 # Thu Dec 07 20:50:24 2017 +0100 # Node ID 90a8cc66a579cf9122e8fef91e4bc1f48062ff60 # Parent 924805347f2fa830e2f371b32f3ba85f01debfee # EXP-Topic upgrade.config # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 90a8cc66a579 upgrade: add a test to show the repository config being ignored The upgrade process ignores the config within the repository. The next changeset fixes it, but we introduce this test before to show it actually tests our target. diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t +++ b/tests/test-upgrade-repo.t @@ -467,3 +467,95 @@ Check upgrading a large file repository largefiles revlogv1 store + + $ cd .. + +repository config is taken in account +- + + $ cat << EOF >> $HGRCPATH + > [format] + > maxchainlen = 1 + > EOF + + $ hg init localconfig + $ cd localconfig + $ cat << EOF > file + > some content + > with some length + > to make sure we get a delta + > after changes + > very long + > very long + > very long + > very long + > very long + > very long + > very long + > very long + > very long + > very long + > very long + > EOF + $ hg -q commit -A -m A + $ echo "new line" >> file + $ hg -q commit -m B + $ echo "new line" >> file + $ hg -q commit -m C + + $ cat << EOF >> .hg/hgrc + > [format] + > maxchainlen = 9001 + > EOF + $ hg config format + format.maxchainlen=9001 + $ hg debugindex file + revoffset length delta linkrev nodeid p1 p2 + 0 0 77 -1 0 bcc1d3df78b2 + 177 21 0 1 af3e29f7a72e bcc1d3df78b2 + 298 84 -1 2 8daf79c5522b af3e29f7a72e + + $ hg debugupgraderepo --run --optimize redeltaall + upgrade will perform the following actions: + + requirements + preserved: dotencode, fncache, generaldelta, revlogv1, store + + redeltaall + deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time + + beginning upgrade... + repository locked and read-only + creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob) + (it is safe to interrupt this process any time before data migration completes) + migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) + migrating 497 bytes in store; 882 bytes tracked data + migrating 1 filelogs containing 3 revisions (182 bytes in store; 573 bytes tracked data) + finished migrating 3 filelog revisions across 1 filelogs; change in size: 0 bytes + migrating 1 manifests containing 3 revisions (141 bytes in store; 138 bytes tracked data) + finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes + migrating changelog containing 3 revisions (174 bytes in store; 171 bytes tracked data) + finished migrating 3 changelog revisions; change in size: 0 bytes + finished migrating 9 total revisions; total change in store size: 0 bytes + copying phaseroots + data fully migrated to temporary repository + marking source repository as being upgraded; clients will be unable to read from repository + starting in-place swap of repository data + replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob) + replacing store... + store replacement complete; repository was inconsistent for 0.0s + finalizing requirements file and making repository readable again + removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob) + copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob) + the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified + $ hg debugindex file + revoffset length delta linkrev nodeid p1 p2 + 0 0 77 -1 0 bcc1d3df78b2 + 177 21 0 1 af3e29f7a72e bcc1d3df78b2 + 298 84 -1 2 8daf79c5522b af3e29f7a72e + $ cd .. + + $ cat << EOF >> $HGRCPATH + > [format] + > maxchainlen = 9001 + > EOF ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 3 of 6] upgrade: more standard creation of the temporary repository
# HG changeset patch # User Boris Feld # Date 1512669370 -3600 # Thu Dec 07 18:56:10 2017 +0100 # Node ID 0711e3f3c5915d976f72ce22d138437d84c42701 # Parent 2c12e70358f6754054becbf4c016ef5ca2bedddb # EXP-Topic upgrade.config # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 0711e3f3c591 upgrade: more standard creation of the temporary repository By using the standard path to create a repository we fill some hole in the current initialization process. The one who triggered this changeset was the lack of extensions initialization. diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -14,6 +14,7 @@ from .i18n import _ from . import ( changelog, error, +hg, localrepo, manifest, revlog, @@ -841,9 +842,7 @@ def upgraderepo(ui, repo, run=False, opt oldcopy = repo.ui.copy try: repo.ui.__dict__.pop('copy', None) -dstrepo = localrepo.localrepository(repo.ui, -path=tmppath, -create=True) +dstrepo = hg.repository(repo.ui, path=tmppath, create=True) finally: repo.ui.copy = oldcopy ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 4 of 6] debugformat: update label depending on value difference
# HG changeset patch # User Boris Feld # Date 1512659552 -3600 # Thu Dec 07 16:12:32 2017 +0100 # Node ID 88e1cddecf068bac5850a0beea0354ffa29f78c3 # Parent 0c9fa09bab4cdc2af7d5541d31de2aba694e9002 # EXP-Topic upgrade # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 88e1cddecf06 debugformat: update label depending on value difference The new label highlight areas where the repo format differs from current config or default. This should help people spot area where a repository mismatch with the expected state. diff --git a/mercurial/color.py b/mercurial/color.py --- a/mercurial/color.py +++ b/mercurial/color.py @@ -102,6 +102,15 @@ except ImportError: 'changeset.secret': '', 'diffstat.deleted': 'red', 'diffstat.inserted': 'green', +'formatvariant.name.mismatchconfig': 'red', +'formatvariant.name.mismatchdefault': 'yellow', +'formatvariant.name.uptodate': 'green', +'formatvariant.repo.mismatchconfig': 'red', +'formatvariant.repo.mismatchdefault': 'yellow', +'formatvariant.repo.uptodate': 'green', +'formatvariant.config.special': 'yellow', +'formatvariant.config.default': 'green', +'formatvariant.default': '', 'histedit.remaining': 'red bold', 'ui.prompt': 'yellow', 'log.changeset': 'yellow', diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -891,12 +891,26 @@ def debugformat(ui, repo, **opts): repovalue = fv.fromrepo(repo) configvalue = fv.fromconfig(repo) +if repovalue != configvalue: +namelabel = 'formatvariant.name.mismatchconfig' +repolabel = 'formatvariant.repo.mismatchconfig' +elif repovalue != fv.default: +namelabel = 'formatvariant.name.mismatchdefault' +repolabel = 'formatvariant.repo.mismatchdefault' +else: +namelabel = 'formatvariant.name.uptodate' +repolabel = 'formatvariant.repo.uptodate' + fm.write('name', makeformatname(fv.name), fv.name, - label='formatvariant.name') + label=namelabel) fm.write('repo', ' %3s', formatvalue(repovalue), - label='formatvariant.repo') + label=repolabel) +if fv.default != configvalue: +configlabel = 'formatvariant.config.special' +else: +configlabel = 'formatvariant.config.default' fm.condwrite(ui.verbose, 'config', ' %6s', formatvalue(configvalue), - label='formatvariant.config') + label=configlabel) fm.condwrite(ui.verbose, 'default', ' %7s', formatvalue(fv.default), label='formatvariant.default') fm.plain('\n') diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t +++ b/tests/test-upgrade-repo.t @@ -72,6 +72,12 @@ An upgrade of a repository created with dotencode: yesyes yes generaldelta: yesyes yes plain-cl-delta: yesyes yes + $ hg debugformat --verbose --config format.usegfncache=no --color=debug + format-variant repo config default + [formatvariant.name.uptodate|fncache: ][formatvariant.repo.uptodate| yes][formatvariant.config.default|yes][formatvariant.default| yes] + [formatvariant.name.uptodate|dotencode: ][formatvariant.repo.uptodate| yes][formatvariant.config.default|yes][formatvariant.default| yes] + [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default|yes][formatvariant.default| yes] + [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default|yes][formatvariant.default| yes] $ hg debugupgraderepo (no feature deficiencies found in existing repository) performing an upgrade with "--run" will make the following changes: @@ -137,6 +143,12 @@ Various sub-optimal detections work dotencode: noyes yes generaldelta:no no yes plain-cl-delta: yesyes yes + $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug + format-variant repo config default + [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] + [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] + [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes] + [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default|yes][formatvariant.default|
[PATCH 1 of 6] upgrade: rename 'removecldeltachain' to 'plain-cl-delta'
# HG changeset patch # User Boris Feld # Date 1512658559 -3600 # Thu Dec 07 15:55:59 2017 +0100 # Node ID 88ae8b7114e294c3bc641611324f1a7b023a1f5e # Parent 483b5dd0f1aa412e9611ab694279c9d3735fee99 # EXP-Topic upgrade # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 88ae8b7114e2 upgrade: rename 'removecldeltachain' to 'plain-cl-delta' The new naming is more descriptive of a "state" while the older one was more about "action". I'm looking into command exposing more of data about the state of the repository so "state" oriented work better there. The key has not been made public anywhere outside the debug area so it is fine to update it. diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -259,7 +259,7 @@ class generaldelta(requirementformatvari @registerformatvariant class removecldeltachain(formatvariant): -name = 'removecldeltachain' +name = 'plain-cl-delta' default = True ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 6] debugformat: add a 'debugformat' command
# HG changeset patch # User Boris Feld # Date 1512659986 -3600 # Thu Dec 07 16:19:46 2017 +0100 # Node ID 98baa863b15b6168076dc8d1ae87f22f7cac6746 # Parent 88ae8b7114e294c3bc641611324f1a7b023a1f5e # EXP-Topic upgrade # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 98baa863b15b debugformat: add a 'debugformat' command The command displays basic data about all format variants registered for repo upgrades. This gives a quick way to peek into a repository format. The 'fm.write()' calls are very independent because more data will be added in later changeset. Having more separate call make the later patch clearer. diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -859,6 +859,38 @@ def debugfileset(ui, repo, expr, **opts) for f in ctx.getfileset(expr): ui.write("%s\n" % f) +@command('debugformat', + [] + cmdutil.formatteropts, +_('')) +def debugformat(ui, repo, **opts): +"""display format information about the current repository""" +maxvariantlength = max(len(fv.name) for fv in upgrade.allformatvariant) +maxvariantlength = max(len('format-variant'), maxvariantlength) + +def makeformatname(name): +return '%s:' + (' ' * (maxvariantlength - len(name))) + +def formatvalue(value): +if value: +return 'yes' +else: +return 'no' + +fm = ui.formatter('debugformat', opts) +fm.plain('format-variant') +fm.plain(' ' * (maxvariantlength - len('format-variant'))) +fm.plain(' repo') +fm.plain('\n') +fm.startitem() +for fv in upgrade.allformatvariant: +repovalue = fv.fromrepo(repo) + +fm.write('name', makeformatname(fv.name), fv.name, + label='formatvariant.name') +fm.write('repo', ' %3s', formatvalue(repovalue), + label='formatvariant.repo') +fm.plain('\n') + @command('debugfsinfo', [], _('[PATH]'), norepo=True) def debugfsinfo(ui, path="."): """show information detected about current filesystem""" diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -87,6 +87,7 @@ Show debug commands if there are no othe debugdiscovery debugextensions debugfileset + debugformat debugfsinfo debuggetbundle debugignore @@ -264,6 +265,7 @@ Show all commands + options debugdiscovery: old, nonheads, rev, ssh, remotecmd, insecure debugextensions: template debugfileset: rev + debugformat: template debugfsinfo: debuggetbundle: head, common, type debugignore: diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -922,6 +922,7 @@ Test list of internal help commands debugextensions show information about active extensions debugfileset parse and apply a fileset specification + debugformat display format information about the current repository debugfsinfo show information detected about current filesystem debuggetbundle retrieves a bundle from a repo diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t +++ b/tests/test-upgrade-repo.t @@ -54,6 +54,12 @@ An upgrade of a repository created with $ hg init empty $ cd empty + $ hg debugformat + format-variant repo + fncache:yes + dotencode: yes + generaldelta: yes + plain-cl-delta: yes $ hg debugupgraderepo (no feature deficiencies found in existing repository) performing an upgrade with "--run" will make the following changes: @@ -101,6 +107,12 @@ Various sub-optimal detections work > store > EOF + $ hg debugformat + format-variant repo + fncache: no + dotencode: no + generaldelta:no + plain-cl-delta: yes $ hg debugupgraderepo repository lacks features recommended by current config options: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 6 of 6] upgrade: register compression as a format variants
# HG changeset patch # User Boris Feld # Date 1512661848 -3600 # Thu Dec 07 16:50:48 2017 +0100 # Node ID 924805347f2fa830e2f371b32f3ba85f01debfee # Parent 02131064aabbd4b3b686c6005070bf3f6baea27b # EXP-Topic upgrade # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 924805347f2f upgrade: register compression as a format variants Compression is a promising vector for speedup, let us make it easier to check the compression used and upgrade existing repository. diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -284,6 +284,28 @@ class removecldeltachain(formatvariant): def fromconfig(repo): return True +@registerformatvariant +class compressionengine(formatvariant): +name = 'compression' +default = 'zlib' + +description = _('Compresion algorithm used to compress data. ' +'Some engine are faster than other') + +upgrademessage = _('revlog content will be recompressed with the new ' + 'algorithm.') + +@classmethod +def fromrepo(cls, repo): +for req in repo.requirements: +if req.startswith('exp-compression-'): +return req.split('-', 2)[2] +return 'zlib' + +@classmethod +def fromconfig(cls, repo): +return repo.ui.config('experimental', 'format.compression') + def finddeficiencies(repo): """returns a list of deficiencies that the repo suffer from""" deficiencies = [] diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t +++ b/tests/test-upgrade-repo.t @@ -60,24 +60,28 @@ An upgrade of a repository created with dotencode: yes generaldelta: yes plain-cl-delta: yes + compression:zlib $ hg debugformat --verbose format-variant repo config default fncache:yesyes yes dotencode: yesyes yes generaldelta: yesyes yes plain-cl-delta: yesyes yes + compression:zlib zlibzlib $ hg debugformat --verbose --config format.usegfncache=no format-variant repo config default fncache:yesyes yes dotencode: yesyes yes generaldelta: yesyes yes plain-cl-delta: yesyes yes + compression:zlib zlibzlib $ hg debugformat --verbose --config format.usegfncache=no --color=debug format-variant repo config default [formatvariant.name.uptodate|fncache: ][formatvariant.repo.uptodate| yes][formatvariant.config.default|yes][formatvariant.default| yes] [formatvariant.name.uptodate|dotencode: ][formatvariant.repo.uptodate| yes][formatvariant.config.default|yes][formatvariant.default| yes] [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default|yes][formatvariant.default| yes] [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default|yes][formatvariant.default| yes] + [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default|zlib] $ hg debugupgraderepo (no feature deficiencies found in existing repository) performing an upgrade with "--run" will make the following changes: @@ -131,24 +135,28 @@ Various sub-optimal detections work dotencode: no generaldelta:no plain-cl-delta: yes + compression:zlib $ hg debugformat --verbose format-variant repo config default fncache: noyes yes dotencode: noyes yes generaldelta:noyes yes plain-cl-delta: yesyes yes + compression:zlib zlibzlib $ hg debugformat --verbose --config format.usegeneraldelta=no format-variant repo config default fncache: noyes yes dotencode: noyes yes generaldelta:no no yes plain-cl-delta: yesyes yes + compression:zlib zlibzlib $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug format-variant repo config default [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes] [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default|yes][formatvariant.default| yes] + [formatvariant.name.uptodate|compression: ][formatvari
[PATCH 3 of 6] debugformat: add data about the config when verbose
# HG changeset patch # User Boris Feld # Date 1512659120 -3600 # Thu Dec 07 16:05:20 2017 +0100 # Node ID 0c9fa09bab4cdc2af7d5541d31de2aba694e9002 # Parent 98baa863b15b6168076dc8d1ae87f22f7cac6746 # EXP-Topic upgrade # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 0c9fa09bab4c debugformat: add data about the config when verbose In verbose mode, the command also displays the current configuration choice for the variant and the global Mercurial default for it. diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -863,7 +863,10 @@ def debugfileset(ui, repo, expr, **opts) [] + cmdutil.formatteropts, _('')) def debugformat(ui, repo, **opts): -"""display format information about the current repository""" +"""display format information about the current repository + +Use --verbose to get extra information about current config value and +Mercurial default.""" maxvariantlength = max(len(fv.name) for fv in upgrade.allformatvariant) maxvariantlength = max(len('format-variant'), maxvariantlength) @@ -880,15 +883,22 @@ def debugformat(ui, repo, **opts): fm.plain('format-variant') fm.plain(' ' * (maxvariantlength - len('format-variant'))) fm.plain(' repo') +if ui.verbose: +fm.plain(' config default') fm.plain('\n') fm.startitem() for fv in upgrade.allformatvariant: repovalue = fv.fromrepo(repo) +configvalue = fv.fromconfig(repo) fm.write('name', makeformatname(fv.name), fv.name, label='formatvariant.name') fm.write('repo', ' %3s', formatvalue(repovalue), label='formatvariant.repo') +fm.condwrite(ui.verbose, 'config', ' %6s', formatvalue(configvalue), + label='formatvariant.config') +fm.condwrite(ui.verbose, 'default', ' %7s', formatvalue(fv.default), + label='formatvariant.default') fm.plain('\n') @command('debugfsinfo', [], _('[PATH]'), norepo=True) diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t +++ b/tests/test-upgrade-repo.t @@ -60,6 +60,18 @@ An upgrade of a repository created with dotencode: yes generaldelta: yes plain-cl-delta: yes + $ hg debugformat --verbose + format-variant repo config default + fncache:yesyes yes + dotencode: yesyes yes + generaldelta: yesyes yes + plain-cl-delta: yesyes yes + $ hg debugformat --verbose --config format.usegfncache=no + format-variant repo config default + fncache:yesyes yes + dotencode: yesyes yes + generaldelta: yesyes yes + plain-cl-delta: yesyes yes $ hg debugupgraderepo (no feature deficiencies found in existing repository) performing an upgrade with "--run" will make the following changes: @@ -113,6 +125,18 @@ Various sub-optimal detections work dotencode: no generaldelta:no plain-cl-delta: yes + $ hg debugformat --verbose + format-variant repo config default + fncache: noyes yes + dotencode: noyes yes + generaldelta:noyes yes + plain-cl-delta: yesyes yes + $ hg debugformat --verbose --config format.usegeneraldelta=no + format-variant repo config default + fncache: noyes yes + dotencode: noyes yes + generaldelta:no no yes + plain-cl-delta: yesyes yes $ hg debugupgraderepo repository lacks features recommended by current config options: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 5 of 6] debugformat: handle non-boolean value for variant
# HG changeset patch # User Boris Feld # Date 1512661764 -3600 # Thu Dec 07 16:49:24 2017 +0100 # Node ID 02131064aabbd4b3b686c6005070bf3f6baea27b # Parent 88e1cddecf068bac5850a0beea0354ffa29f78c3 # EXP-Topic upgrade # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 02131064aabb debugformat: handle non-boolean value for variant diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -874,6 +874,8 @@ def debugformat(ui, repo, **opts): return '%s:' + (' ' * (maxvariantlength - len(name))) def formatvalue(value): +if util.safehasattr(value, 'startswith'): +return value if value: return 'yes' else: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1591: visibility: improve the message when accessing filtered obsolete rev
lothiraldan updated this revision to Diff 4250. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1591?vs=4156&id=4250 REVISION DETAIL https://phab.mercurial-scm.org/D1591 AFFECTED FILES mercurial/context.py mercurial/obsutil.py tests/test-log.t tests/test-obshistory.t tests/test-obsolete.t CHANGE DETAILS diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -196,7 +196,7 @@ abort: unknown revision '6'! [255] $ hg log -r 4 - abort: hidden revision '4'! + abort: hidden revision '4' was rewritten as: 5601fb93a350! (use --hidden to access hidden revisions) [255] $ hg debugrevspec 'rev(6)' @@ -1324,7 +1324,7 @@ 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753] $ hg book -d bookb $ hg log -r 13bedc178fce - abort: hidden revision '13bedc178fce'! + abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753! (use --hidden to access hidden revisions) [255] diff --git a/tests/test-obshistory.t b/tests/test-obshistory.t new file mode 100644 --- /dev/null +++ b/tests/test-obshistory.t @@ -0,0 +1,541 @@ +This test file test the various messages when accessing obsolete +revisions. + +Global setup + + + $ . $TESTDIR/testlib/obsmarker-common.sh + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [phases] + > publish=False + > [experimental] + > evolution.createmarkers = yes + > evolution.effect-flags = yes + > EOF + +Test output on amended commit += + +Test setup +-- + + $ hg init $TESTTMP/local-amend + $ cd $TESTTMP/local-amend + $ mkcommit ROOT + $ mkcommit A0 + $ echo 42 >> A0 + $ hg commit --amend -m "A1 + > + > Better commit message" + $ hg log --hidden -G + @ changeset: 2:4ae3a4151de9 + | tag: tip + | parent: 0:ea207398892e + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A1 + | + | x changeset: 1:471f378eab4c + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |obsolete:rewritten using amend as 2:4ae3a4151de9 + |summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +Actual test +--- + $ hg update 471f378eab4c + abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9! + (use --hidden to access hidden revisions) + [255] + $ hg update --hidden "desc(A0)" + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with pruned commit +== + +Test setup +-- + + $ hg init $TESTTMP/local-prune + $ cd $TESTTMP/local-prune + $ mkcommit ROOT + $ mkcommit A0 # 0 + $ mkcommit B0 # 1 + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + $ hg debugobsolete --record-parents `getid 'desc(B0)'` + obsoleted 1 changesets + + $ hg log --hidden -G + @ changeset: 2:0dec01379d3b + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | obsolete:pruned + | summary: B0 + | + o changeset: 1:471f378eab4c + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + + +Actual test +--- + $ hg up 1 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg up 0dec01379d3b + abort: hidden revision '0dec01379d3b' is pruned! + (use --hidden to access hidden revisions) + [255] + $ hg up --hidden -r 'desc(B0)' + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Test output with splitted commit + + +Test setup +-- + + $ hg init $TESTTMP/local-split + $ cd $TESTTMP/local-split + $ mkcommit ROOT + $ echo 42 >> a + $ echo 43 >> b + $ hg commit -A -m "A0" + adding a + adding b + $ hg log --hidden -G + @ changeset: 1:471597cad322 + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +# Simulate a split + $ hg up 0 + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + + $ echo 42 >> a + $ hg commit -A -m "A0" + addi
D1232: rebase: add the --inmemory option flag; assign a wctx object for the rebase
dlax added a comment. dlax (Denis Laxalde) wrote: > Also, would be nice to have some test coverage. Unless I missed it, there's still no test at all for the --inmemory option in this series. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1232 To: phillco, #hg-reviewers, dlax, durin42 Cc: durin42, dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 2] patch: catch unexpected case in _inlinediff
# HG changeset patch # User Matthieu Laneuville # Date 1512719699 -32400 # Fri Dec 08 16:54:59 2017 +0900 # Node ID a1215935559d6e2afa49be0a1601b6ba8eaa7dbf # Parent 8e3ebafd54d664a1f3ce2032b20cff92b5b399fb # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a1215935559d # EXP-Topic inline-diff patch: catch unexpected case in _inlinediff If operation is neither 'diff.inserted' or 'diff.deleted', label and token won't be define. This patch explicitely catches that exception. diff -r 8e3ebafd54d6 -r a1215935559d mercurial/patch.py --- a/mercurial/patch.pyFri Dec 08 16:47:18 2017 +0900 +++ b/mercurial/patch.pyFri Dec 08 16:54:59 2017 +0900 @@ -2575,6 +2575,9 @@ def _inlinediff(s1, s2, operation): token = '+' s2 = s2[1:] s1 = s1[1:] +else: +raise error.ProgrammingError("Case not expected, operation = %s" % +operation) s = difflib.ndiff(re.split(br'(\W)', s2), re.split(br'(\W)', s1)) for part in s: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 2] patch: reverse _inlinediff output for consistency
# HG changeset patch # User Matthieu Laneuville # Date 1512719238 -32400 # Fri Dec 08 16:47:18 2017 +0900 # Node ID 8e3ebafd54d664a1f3ce2032b20cff92b5b399fb # Parent 483b5dd0f1aa412e9611ab694279c9d3735fee99 # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 8e3ebafd54d6 # EXP-Topic inline-diff patch: reverse _inlinediff output for consistency diff -r 483b5dd0f1aa -r 8e3ebafd54d6 mercurial/patch.py --- a/mercurial/patch.pyWed Dec 06 23:33:01 2017 +0100 +++ b/mercurial/patch.pyFri Dec 08 16:47:18 2017 +0900 @@ -2515,7 +2515,7 @@ def difflabel(func, *args, **kw): yield (token, 'diff.tab') else: if i in matches: -for l, t in _inlinediff( +for t, l in _inlinediff( lines[i].rstrip(), lines[matches[i]].rstrip(), label): @@ -2587,10 +2587,10 @@ def _inlinediff(s1, s2, operation): token += part[2:] continue else: -buff.append((label, token)) +buff.append((token, label)) label = l token = part[2:] -buff.append((label, token)) +buff.append((token, label)) return buff ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1249: rebase: rerun a rebase on-disk if IMM merge conflicts arise
dlax requested changes to this revision. dlax added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > rebase.py:667 > + > +def _origrebase(ui, repo, **opts): > """move changeset (and descendants) to a different branch Do we need to make another function? Can't we call rebase again with options modified? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1249 To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1245: rebase: pass wctx to rebasenode()
dlax requested changes to this revision. dlax added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > rebase.py:995 > > -def rebasenode(repo, rev, p1, base, state, collapse, dest): > +def rebasenode(repo, rev, p1, base, state, collapse, dest, wctx=None): > 'Rebase a single revision rev on top of p1 using base as merge ancestor' Isn't it meant to be used in the function body? I see a `wctx = repo[None]` below, perhaps it should be dropped. But this wouldn't work with a `None` default value as mentioned in the next patch. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1245 To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1246: rebase: do not update if IMM; instead, set the overlaywctx's parents
dlax requested changes to this revision. dlax added a comment. This revision now requires changes to proceed. Needs test. INLINE COMMENTS > rebase.py:1003 > # Update to destination and merge it with local > -if repo['.'].rev() != p1: > -repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1])) > -mergemod.update(repo, p1, False, True) > +if wctx.isinmemory(): > +wctx.setbase(repo[p1]) `wctx` has a default value of `None`, so either it shouldn't have that or there should be a check for `None` here. > rebase.py:1007 > +# This is necessary to invalidate workingctx's caches. > +wctx = repo[None] > +if repo['.'].rev() != p1: `wctx` is redefined here. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1246 To: phillco, #hg-reviewers, durin42, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1244: overlayworkingctx: invalidate the manifest cache when changing parents
dlax added inline comments. INLINE COMMENTS > context.py:2003 > +# Drop old manifest cache: > +self._invalidate() > Wouldn't `util.clearcachedproperty(self, '_manifest')` work? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1244 To: phillco, #hg-reviewers, durin42 Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1232: rebase: add the --inmemory option flag; assign a wctx object for the rebase
dlax added inline comments. INLINE COMMENTS > rebase.py:738 > +if 'inmemory' not in opts: > +opts['inmemory'] = False > rbsrt = rebaseruntime(repo, ui, opts) This is useless because "inmemory" will be in `opts` and because you wrote `opts.get('inmemory', False)` in `rebaseruntime.__init__()` above. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1232 To: phillco, #hg-reviewers, dlax, durin42 Cc: durin42, dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D1607: remotenames: rename related file and storage dir to logexchange
pulkit (Pulkit Goyal) writes: > pulkit updated this revision to Diff 4162. > pulkit edited the summary of this revision. > pulkit retitled this revision from "remotenames: rename the file to > logexchange" to "remotenames: rename related file and storage dir to > logexchange". This is better than before. Though, I'm still opposed to skipping hgext/. signature.asc Description: PGP signature ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D1551: remotenames: consider existing data while storing newer data
durin42 (Augie Fackler) writes: > durin42 added a comment. > > > In https://phab.mercurial-scm.org/D1551#27325, @smf wrote: > > > durin42 (Augie Fackler) writes: > > > > > durin42 added a comment. > > > > > > I'm landing this series as-is, even though there are some good ideas > for how we could improve the storage layer. My reasoning is this: we've had > this as a semi-popular extension for literally years, it's functionality that > we know is useful, and it'd be better to land something good rather than > never land it in the name of wishing for something better. We've got almost > two full months left in the cycle before this even ships as an experimental > feature, so if anyone wants to try and iterate aggressively on the format I'd > be delighted to talk over goals and review patches (but I'm far too busy to > do any coding work, alas.) > > > > I hadn't finished writing my review of this patch, so that's awesome. I > > have many concerns for this as-is. We need to have some kind of > > measuring stick for quality in core instead of saying, "perfect is the > > enemy of good," and letting everything through. > > > Sean, the last state I had from you[0] was requiring three-step refactor > that involved not-small work on at least blackbox and journal, as well as on > remotenames. I don't think that's realistic (and so kills remotenames as > something we can ship any fraction of in core), and it's been weeks since we > had any action on that last round of patches. As far as I can tell, everyone > that was part of that discussion agrees in broad strokes with your notions, > but nobody is willing to do the work, certainly not as a blocker for landing > this functionality in core. > > 0: https://phab.mercurial-scm.org/D1358#23866 > > > I'm not asking for perfect. I'm asking for this to be reworked to > > something consistent for core. We haven't had a file format so external > > pushed to core so quickly before. Histedit, journal, schemes, and even > > mq have their own file formats which have been ironed out in hgext/. > > I'm confused. histedit landed in core in a single go, with no review on the > file format (it was pickle! the worst possible choice!). The file format > we're looking at here for remotenames is substantially similar to the one > that's been in remotebranches for nearly a decade, so forgive me if I'm > dubious that a file format refactor should be a blocker here. histedit landed in hgext/. My push back is to this putting remotenames in mercurial/. In fact, I can't think of an extension that has skipped going into hgext/ like this has. As I've brought up before, there are scheme fixes, path patches, and other minor things that could be improved before even getting to this patch. > > For this patch as-is, it should at the very least be named > > logexchange.py or something similar. "remotenames" is weird name to have > > in core and already conflicts with the name of the extension it comes > > from. > > Per irc, Pulkit already has a patch ready to fix that. > > > I plan to back this out because there are so many things that need > > to be worked out before this lands. > > Do not back this out without getting someone else to agree with you first. > As of now I see a new complaint in this message from you (please rename this) > which is fine, and is something we can roll forward on. > > > What happened to our quality for core? > > Patience. If I'd known about the naming concern I would have waited to land > this, but I never saw that complaint in the almost a month this patch (or its > precursor stack related to https://phab.mercurial-scm.org/D1358) have been > visible. I can't read minds, and it's consistent with past decisions to bring > things in without name changes (we did that on histedit!), but I see why we > should behave differently here (since we're only bringing parts of > remotenames to core.) > > Does that help clarify things? Again, histedit landed in hgext/. As for my delay in responding to this list: I've taken a break because it doesn't seem that healthy debate is encouraged or welcomed. For a while now, I've observed more strong-arming and less collaboration. signature.asc Description: PGP signature ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel