mercurial@30419: new changeset (1 on stable)
New changeset (1 on stable) in mercurial: http://selenic.com/repo/hg//rev/819f96b82fa4 changeset: 30419:819f96b82fa4 branch: stable tag: tip parent: 30321:e0ff47999b13 user:Mads Kiilerichdate:Mon Nov 14 22:43:25 2016 +0100 summary: shelve: add missing space in help text -- Repository URL: http://selenic.com/repo/hg/ ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] debuginstall: print compression engine support
# HG changeset patch # User Gregory Szorc# Date 1479527805 28800 # Fri Nov 18 19:56:45 2016 -0800 # Node ID a3b70554ff2a25fa429bbf388850b982b064cb93 # Parent 9375077f1ace71dfa2fc87a1d4eaeae8de267e20 debuginstall: print compression engine support Since compression engines may be provided by extensions and since not all registered compression engines may be available to use, it seems useful to provide a mechanism to see the state of known compression engines. This commit teaches `hg debuginstall` to print info on known and available compression engines. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2579,6 +2579,16 @@ def debuginstall(ui, **opts): problems += 1 fm.condwrite(err, 'extensionserror', " %s\n", err) +compengines = util.compengines._engines.values() +fm.write('compengines', _('checking registered compression engines (%s)\n'), + fm.formatlist(sorted(e.name() for e in compengines), + name='compengine', fmt='%s', sep=', ')) +fm.write('compenginesavail', _('checking available compression engines ' + '(%s)\n'), + fm.formatlist(sorted(e.name() for e in compengines + if e.available()), + name='compengine', fmt='%s', sep=', ')) + # templates p = templater.templatepaths() fm.write('templatedirs', 'checking templates (%s)...\n', ' '.join(p)) diff --git a/tests/test-install.t b/tests/test-install.t --- a/tests/test-install.t +++ b/tests/test-install.t @@ -11,6 +11,8 @@ hg debuginstall checking Mercurial custom build (*) (glob) checking module policy (*) (glob) checking installed modules (*mercurial)... (glob) + checking registered compression engines (*zlib*) (glob) + checking available compression engines (*zlib*) (glob) checking templates (*mercurial?templates)... (glob) checking default template (*mercurial?templates?map-cmdline.default) (glob) checking commit editor... (* -c "import sys; sys.exit(0)") (glob) @@ -21,6 +23,8 @@ hg debuginstall JSON $ hg debuginstall -Tjson | sed 's||\\|g' [ { +"compengines": ["bz2", "bz2truncated", "none", "zlib", "zstd"], +"compenginesavail": ["bz2", "bz2truncated", "none", "zlib", "zstd"], "defaulttemplate": "*mercurial?templates?map-cmdline.default", (glob) "defaulttemplateerror": null, "defaulttemplatenotfound": "default", @@ -58,6 +62,8 @@ hg debuginstall with no username checking Mercurial custom build (*) (glob) checking module policy (*) (glob) checking installed modules (*mercurial)... (glob) + checking registered compression engines (*zlib*) (glob) + checking available compression engines (*zlib*) (glob) checking templates (*mercurial?templates)... (glob) checking default template (*mercurial?templates?map-cmdline.default) (glob) checking commit editor... (* -c "import sys; sys.exit(0)") (glob) @@ -85,6 +91,8 @@ path variables are expanded (~ is the sa checking Mercurial custom build (*) (glob) checking module policy (*) (glob) checking installed modules (*mercurial)... (glob) + checking registered compression engines (*zlib*) (glob) + checking available compression engines (*zlib*) (glob) checking templates (*mercurial?templates)... (glob) checking default template (*mercurial?templates?map-cmdline.default) (glob) checking commit editor... (* -c "import sys; sys.exit(0)") (glob) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] histedit: make --keep work more like graft and use default phase for copies
On Fri, Nov 18, 2016 at 05:16:06PM +0100, Mads Kiilerich wrote: > # HG changeset patch > # User Mads Kiilerich> # Date 1479485469 -3600 > # Fri Nov 18 17:11:09 2016 +0100 > # Node ID 19ad769b648182e92a49015d85389fe2a8303c18 > # Parent 1156ec81f70907ff843ca30bb81b4ef59b9b7068 > histedit: make --keep work more like graft and use default phase for copies queued, thanks > > diff --git a/hgext/histedit.py b/hgext/histedit.py > --- a/hgext/histedit.py > +++ b/hgext/histedit.py > @@ -91,7 +91,8 @@ ones) until after it has completed all t > probably perform several strip operations when it's done. For the above > example, > it had to run strip twice. Strip can be slow depending on a variety of > factors, > so you might need to be a little patient. You can choose to keep the original > -revisions by passing the ``--keep`` flag. > +revisions by passing the ``--keep`` flag. This will work more like graft and > +not preserve/copy the original phase. > > The ``edit`` operation will drop you back to a command prompt, > allowing you to edit files freely, or even use ``hg record`` to commit > @@ -466,7 +467,7 @@ class histeditaction(object): > rulectx = repo[self.node] > > editor = self.commiteditor() > -commit = commitfuncfor(repo, rulectx) > +commit = commitfuncfor(repo, rulectx, self.state.keep) > > commit(text=rulectx.description(), user=rulectx.user(), > date=rulectx.date(), extra=rulectx.extra(), editor=editor) > @@ -489,7 +490,7 @@ class histeditaction(object): > return ctx, [] > return ctx, [(self.node, (ctx.node(),))] > > -def commitfuncfor(repo, src): > +def commitfuncfor(repo, src, keep): > """Build a commit function for the replacement of > > This function ensure we apply the same treatment to all changesets. > @@ -503,8 +504,9 @@ def commitfuncfor(repo, src): > def commitfunc(**kwargs): > phasebackup = repo.ui.backupconfig('phases', 'new-commit') > try: > -repo.ui.setconfig('phases', 'new-commit', phasemin, > - 'histedit') > +if not keep: > +repo.ui.setconfig('phases', 'new-commit', phasemin, > + 'histedit') > extra = kwargs.get('extra', {}).copy() > extra['histedit_source'] = src.hex() > kwargs['extra'] = extra > @@ -531,7 +533,7 @@ def applychanges(ui, repo, ctx, opts): > repo.ui.setconfig('ui', 'forcemerge', '', 'histedit') > return stats > > -def collapse(repo, first, last, commitopts, skipprompt=False): > +def collapse(repo, first, last, commitopts, skipprompt=False, keep=False): > """collapse the set of revisions from first to last as new one. > > Expected commit options are: > @@ -545,7 +547,7 @@ def collapse(repo, first, last, commitop > if not ctxs: > return None > for c in ctxs: > -if not c.mutable(): > +if not c.mutable() and not keep: > raise error.ParseError( > _("cannot fold into public change %s") % > node.short(c.node())) > base = first.parents()[0] > @@ -669,16 +671,15 @@ class fold(histeditaction): > return > else: > c = repo[prev.node] > -if not c.mutable(): > +if not c.mutable() and not self.state.keep: > raise error.ParseError( > _("cannot fold into public change %s") % > node.short(c.node())) > > - > def continuedirty(self): > repo = self.repo > rulectx = repo[self.node] > > -commit = commitfuncfor(repo, rulectx) > +commit = commitfuncfor(repo, rulectx, self.state.keep) > commit(text='fold-temp-revision %s' % node.short(self.node), > user=rulectx.user(), date=rulectx.date(), > extra=rulectx.extra()) > @@ -752,9 +753,10 @@ class fold(histeditaction): > phasebackup = repo.ui.backupconfig('phases', 'new-commit') > try: > phasemin = max(ctx.phase(), oldctx.phase()) > -repo.ui.setconfig('phases', 'new-commit', phasemin, 'histedit') > +if not self.state.keep: > +repo.ui.setconfig('phases', 'new-commit', phasemin, > 'histedit') > n = collapse(repo, ctx, repo[newnode], commitopts, > - skipprompt=self.skipprompt()) > + skipprompt=self.skipprompt(), keep=self.state.keep) > finally: > repo.ui.restoreconfig(phasebackup) > if n is None: > diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t > --- a/tests/test-histedit-edit.t > +++ b/tests/test-histedit-edit.t > @@ -453,6 +453,7 @@ rollback should not work after a histedi >$ echo foo >> a >$ hg ci -m 'extend a' >$ hg phase --public 1 > + > Attempting to fold a change into a public change should not work: >$ cat >
Re: [PATCH 2 of 2] commands: print chunk type in debugrevlog
On Thu, Nov 17, 2016 at 08:36:59PM -0800, Gregory Szorc wrote: > # HG changeset patch > # User Gregory Szorc> # Date 1479443400 28800 > # Thu Nov 17 20:30:00 2016 -0800 > # Node ID 4f92246570138fcf43913a287619706940e33e92 > # Parent 3a1a4b0f3fd8445b166608e86829e048770ffa92 > commands: print chunk type in debugrevlog queued, thanks > > Each data entry ("chunk") in a revlog has a type based on the first > byte of the data. This type indicates how to interpret the data. > > This seems like a useful thing to be able to query through a debug > command. So let's add that to `hg debugrevlog`. > > This does make `hg debugrevlog` slightly slower, as it has to read > more than just the index. However, even on the mozilla-unified > manifest (which is ~200MB spread over ~350K revisions), this takes > <400ms. > > diff --git a/mercurial/commands.py b/mercurial/commands.py > --- a/mercurial/commands.py > +++ b/mercurial/commands.py > @@ -15,6 +15,7 @@ import random > import re > import shlex > import socket > +import string > import sys > import tempfile > import time > @@ -3194,6 +3195,8 @@ def debugrevlog(ui, repo, file_=None, ** > datasize = [None, 0, 0] > fullsize = [None, 0, 0] > deltasize = [None, 0, 0] > +chunktypecounts = {} > +chunktypesizes = {} > > def addsize(size, l): > if l[0] is None or size < l[0]: > @@ -3231,6 +3234,20 @@ def debugrevlog(ui, repo, file_=None, ** > elif delta != nullrev: > numother += 1 > > +# Obtain data on the raw chunks in the revlog. > +chunk = r._chunkraw(rev, rev)[1] > +if chunk: > +chunktype = chunk[0] > +else: > +chunktype = 'empty' > + > +if chunktype not in chunktypecounts: > +chunktypecounts[chunktype] = 0 > +chunktypesizes[chunktype] = 0 > + > +chunktypecounts[chunktype] += 1 > +chunktypesizes[chunktype] += size > + > # Adjust size min value for empty cases > for size in (datasize, fullsize, deltasize): > if size[0] is None: > @@ -3282,6 +3299,24 @@ def debugrevlog(ui, repo, file_=None, ** > ui.write(('full : ') + fmt % pcfmt(fulltotal, totalsize)) > ui.write(('deltas: ') + fmt % pcfmt(deltatotal, totalsize)) > > +def fmtchunktype(chunktype): > +if chunktype == 'empty': > +return '%s : ' % chunktype > +elif chunktype in string.ascii_letters: > +return '0x%s (%s) : ' % (hex(chunktype), chunktype) > +else: > +return '0x%s : ' % hex(chunktype) > + > +ui.write('\n') > +ui.write(('chunks: ') + fmt2 % numrevs) > +for chunktype in sorted(chunktypecounts): > +ui.write(fmtchunktype(chunktype)) > +ui.write(fmt % pcfmt(chunktypecounts[chunktype], numrevs)) > +ui.write(('chunks size : ') + fmt2 % totalsize) > +for chunktype in sorted(chunktypecounts): > +ui.write(fmtchunktype(chunktype)) > +ui.write(fmt % pcfmt(chunktypesizes[chunktype], totalsize)) > + > ui.write('\n') > fmt = dfmtstr(max(avgchainlen, compratio)) > ui.write(('avg chain length : ') + fmt % avgchainlen) > diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t > --- a/tests/test-debugcommands.t > +++ b/tests/test-debugcommands.t > @@ -22,6 +22,11 @@ >full : 44 (100.00%) >deltas: 0 ( 0.00%) > > + chunks: 1 > + 0x75 (u) : 1 (100.00%) > + chunks size : 44 > + 0x75 (u) : 44 (100.00%) > + >avg chain length : 0 >max chain length : 0 >compression ratio : 0 > ___ > 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] setup: add flag to build_ext to control building zstd
On Thu, Nov 17, 2016 at 08:14:23PM -0800, Gregory Szorc wrote: > # HG changeset patch > # User Gregory Szorc> # Date 1479442150 28800 > # Thu Nov 17 20:09:10 2016 -0800 > # Node ID 0c36116df0e58677f78ff5ca19ed0e496fc12c11 > # Parent 41a8106789cae9716c39d8381fa5da1d3ea0d74b > setup: add flag to build_ext to control building zstd queued > > Downstream packagers will inevitably want to disable building the > vendored python-zstandard Python package. Rather than force them > to patch setup.py, let's give them a knob to use. > > distutils Command classes support defining custom options. It requires > setting certain class attributes (yes, class attributes: instance > attributes don't work because the class type is consulted before it > is instantiated). > > We already have a custom child class of build_ext, so we set these > class attributes, implement some scaffolding, and override > build_extensions to filter the Extension instance for the zstd > extension if the `--no-zstd` argument is specified. > > Example usage: > > $ python setup.py build_ext --no-zstd > > diff --git a/setup.py b/setup.py > --- a/setup.py > +++ b/setup.py > @@ -276,7 +276,30 @@ class hgdist(Distribution): > # too late for some cases > return not self.pure and Distribution.has_ext_modules(self) > > +# This is ugly as a one-liner. So use a variable. > +buildextnegops = dict(getattr(build_ext, 'negative_options', {})) > +buildextnegops['no-zstd'] = 'zstd' > + > class hgbuildext(build_ext): > +user_options = build_ext.user_options + [ > +('zstd', None, 'compile zstd bindings [default]'), > +('no-zstd', None, 'do not compile zstd bindings'), > +] > + > +boolean_options = build_ext.boolean_options + ['zstd'] > +negative_opt = buildextnegops > + > +def initialize_options(self): > +self.zstd = True > +return build_ext.initialize_options(self) > + > +def build_extensions(self): > +# Filter out zstd if disabled via argument. > +if not self.zstd: > +self.extensions = [e for e in self.extensions > + if e.name != 'mercurial.zstd'] > + > +return build_ext.build_extensions(self) > > def build_extension(self, ext): > try: > ___ > 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 2 of 2 V2] rebase: calculate ancestors for --base separately (issue5420)
On Thu, Nov 17, 2016 at 11:49:58PM +, Jun Wu wrote: > # HG changeset patch > # User Jun Wu> # Date 1479426495 0 > # Thu Nov 17 23:48:15 2016 + > # Node ID e5451a607d1ca53b2446ab049375e5dd5a055bb8 > # Parent 87e0edc93d87b88e2925877469d8c142e01737fc > # Available At https://bitbucket.org/quark-zju/hg-draft > # hg pull https://bitbucket.org/quark-zju/hg-draft -r > e5451a607d1c > rebase: calculate ancestors for --base separately (issue5420) These are queued, thanks. > > Previously, the --base option only works with a single "branch" - if there > are multiple branching points, "rebase" will error out with: > > abort: source is ancestor of destination > > This happens if the user has multiple draft branches with different > branching points, and uses "hg rebase -b 'draft()' -d master". The error > message looks cryptic to users who don't know the implementation detail. > > This patch changes the logic to calculate ancestors for each "base" branch > so it would work in the multiple branching points case. > > Note: if there are multiple bases where some of them are rebasable, while > some of them aren't because the branching point is the destination, the > current behavior is to abort with "nothing to rebase", which seems wrong. > However, that issue is not introduced by this patch - it exists for "-s" as > well. I have reported it as issue5422 and should be solved separately. > > diff --git a/hgext/rebase.py b/hgext/rebase.py > --- a/hgext/rebase.py > +++ b/hgext/rebase.py > @@ -722,10 +722,17 @@ def _definesets(ui, repo, destf=None, sr > destf = str(dest) > > -commonanc = repo.revs('ancestor(%ld, %d)', base, dest).first() > -if commonanc is not None: > -rebaseset = repo.revs('(%d::(%ld) - %d)::', > - commonanc, base, commonanc) > -else: > -rebaseset = [] > +# calculate ancestors for individual bases > +realbases = [] > +for b in repo.revs('roots(%ld)', base): > +# branching point > +bp = repo.revs('ancestor(%d, %d)', b, dest).first() > +if bp is None: > +continue > +# move b to be the direct child of the branching point > +b = repo.revs('%d::%d - %d', bp, b, bp).first() > +if b is not None: > +realbases.append(b) > + > +rebaseset = repo.revs('%ld::', realbases) > > if not rebaseset: > diff --git a/tests/test-rebase-base.t b/tests/test-rebase-base.t > new file mode 100644 > --- /dev/null > +++ b/tests/test-rebase-base.t > @@ -0,0 +1,94 @@ > + $ cat >> $HGRCPATH < + > [extensions] > + > rebase= > + > drawdag=$TESTDIR/drawdag.py > + > > + > [phases] > + > publish=False > + > > + > [alias] > + > tglog = log -G --template "{rev}: {desc}" > + > EOF > + > + $ hg init a > + $ cd a > + > + $ hg debugdrawdag < + > g f > + > |/ > + > e c d > + > | |/ > + > | b > + > |/ > + > a > + > EOS > + > + $ cd .. > + > +Pick a single base: > + > + $ cp -a a a1 && cd a1 > + $ hg rebase -b c -d g -q > + $ hg tglog > + o 6: d > + | > + | o 5: c > + |/ > + o 4: b > + | > + o 3: g > + | > + | o 2: f > + |/ > + o 1: e > + | > + o 0: a > + > + $ cd .. > + > +Pick a base that is already an descendant of dest: > + > + $ cp -a a a2 && cd a2 > + $ hg rebase -b g -d e > + nothing to rebase > + [1] > + $ hg rebase -b d -d a > + nothing to rebase > + [1] > + $ hg rebase -b d+c+f+e -d a > + nothing to rebase > + [1] > + $ cd .. > + > +Pick multiple bases (issue5420): > + > + $ cp -a a a3 && cd a3 > + $ hg rebase -b d+f -d g -q > + $ hg tglog > + o 6: f > + | > + | o 5: d > + | | > + | | o 4: c > + | |/ > + | o 3: b > + |/ > + o 2: g > + | > + o 1: e > + | > + o 0: a > + > + $ cd .. > + > +Mixed rebasable and non-rebasable bases (unresolved, issue5422): > + > + $ cp -a a a4 && cd a4 > + $ hg debugdrawdag < + > h > + > | > + > g > + > EOS > + $ hg rebase -b d+f+h -d g > + nothing to rebase > + [1] > ___ > 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
[Bug 5429] New: Fail on solaris11.3 while trying to compile mozilla-central ?
https://bz.mercurial-scm.org/show_bug.cgi?id=5429 Bug ID: 5429 Summary: Fail on solaris11.3 while trying to compile mozilla-central ? Product: Mercurial Version: 3.9.2 Hardware: PC OS: Other Status: UNCONFIRMED Severity: feature Priority: wish Component: Mercurial Assignee: bugzi...@selenic.com Reporter: njhnbehr...@gmail.com CC: mercurial-de...@selenic.com ico@devnull:/sources/mozilla-central$ ./mach mercurial-setup Ensuring https://hg.mozilla.org/hgcustom/version-control-tools is up to date at /export/home/nico/.mozbuild/version-control-tools pulling from https://hg.mozilla.org/hgcustom/version-control-tools searching for changes no changes found 0 files updated, 0 files merged, 0 files removed, 0 files unresolved This wizard will guide you through configuring Mercurial for an optimal experience contributing to Mozilla projects. The wizard makes no changes without your permission. To begin, press the enter/return key. ** unknown exception encountered, please report by visiting ** https://mercurial-scm.org/wiki/BugTracker ** Python 2.7.11 (default, Mar 14 2016, 17:31:55) [GCC 5.2.0] ** Mercurial Distributed SCM (version 3.9.2) ** Extensions loaded: color, pager, histedit, rebase, blackbox, firefoxtree, reviewboard, push-to-try, configwizard Traceback (most recent call last): File "/opt/csw/bin/hg", line 45, in mercurial.dispatch.run() File "/opt/csw/lib/python2.7/site-packages/mercurial/dispatch.py", line 59, in run sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255) File "/opt/csw/lib/python2.7/site-packages/mercurial/dispatch.py", line 125, in dispatch ret = _runcatch(req) File "/opt/csw/lib/python2.7/site-packages/mercurial/dispatch.py", line 204, in _runcatch return _dispatch(req) File "/opt/csw/lib/python2.7/site-packages/mercurial/dispatch.py", line 880, in _dispatch cmdpats, cmdoptions) File "/opt/csw/lib/python2.7/site-packages/mercurial/dispatch.py", line 637, in runcommand ret = _runcommand(ui, options, cmd, d) File "/opt/csw/lib/python2.7/site-packages/mercurial/extensions.py", line 210, in closure return func(*(args + a), **kw) File "/opt/csw/lib/python2.7/site-packages/hgext/pager.py", line 160, in pagecmd return orig(ui, options, cmd, cmdfunc) File "/opt/csw/lib/python2.7/site-packages/mercurial/extensions.py", line 210, in closure return func(*(args + a), **kw) File "/opt/csw/lib/python2.7/site-packages/hgext/color.py", line 503, in colorcmd return orig(ui_, opts, cmd, cmdfunc) File "/opt/csw/lib/python2.7/site-packages/mercurial/dispatch.py", line 1010, in _runcommand return checkargs() File "/opt/csw/lib/python2.7/site-packages/mercurial/dispatch.py", line 971, in checkargs return cmdfunc() File "/opt/csw/lib/python2.7/site-packages/mercurial/dispatch.py", line 877, in d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) File "/opt/csw/lib/python2.7/site-packages/mercurial/util.py", line 1036, in check return func(*args, **kwargs) File "/export/home/nico/.mozbuild/version-control-tools/hgext/configwizard/__init__.py", line 341, in configwizard cw = configobjwrapper(path) File "/export/home/nico/.mozbuild/version-control-tools/hgext/configwizard/__init__.py", line 952, in __init__ write_empty_values=True, list_values=False) File "/export/home/nico/.mozbuild/version-control-tools/pylib/configobj/configobj.py", line 1242, in __init__ self._load(infile, configspec) File "/export/home/nico/.mozbuild/version-control-tools/pylib/configobj/configobj.py", line 1332, in _load raise error configobj.DuplicateError: Duplicate section name at line 31. -- You are receiving this mail because: You are on the CC list for the bug. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 9] chgserver: copy to mercurial
Actually I'm not sure trading performance for correctness is the most correct way to go. I'd like to preserve the flexibility so that if we do want to eventually preload the repo object (and thus the index object / radix tree etc), we are still able to do so. Another approach to do that is to implement a "remote" "changelog" object - and a dedicated "changelog" server dealing with what "changelog" and "changelog.index" could do, namely "partialmatch" and "isancestor". IPC cost could be a concern but it does not sound like a bad idea for big repos with long changelog. Excerpts from Jun Wu's message of 2016-11-13 21:55:45 +: > # HG changeset patch > # User Jun Wu> # Date 1479070808 0 > # Sun Nov 13 21:00:08 2016 + > # Node ID c04847bc1bf1804cc7d8f5e7c50a653a9526 > # Parent e1d6aa0e4c3aed73e0dc523b8a8fd5f9fe23510a > chgserver: copy to mercurial > > The patch moves chgserver.py to mercurial and the chg refactoring (mainly to > avoid calling uisetup) starts here. The movement to core was decided at the > 4.0 sprint. > > It's inconvenient to change hgext.chgserver directly and then move it to > mercurial because this is a relatively large refactoring and until we have > all the patches, the "mercurial/" version would be incomplete or > incompatible to the current chg client. Maintaining compatibility while > doing the refactoring is hard. > > Therefore, in the mean time, the chg client will still use hgext.chgserver. > Once the refactoring is in a good shape, we will make the switch and remove > hgext.chgserver. > > "mercurial" was replaced to "." to make the import checker happy. > > The motivation behind the refactoring was mainly discussed at: > https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-July/085965.html > > The goals of the current planned refactoring are: > > a. do not run uisetup - much better compatibility > b. long socket path support > c. better integration with the pager extension > d. lock-free server start > e. fix remaining tests > > Note that a downside of "a." is things can be slower - With ~50 extensions > enabled, "chg version" may need 0.10 seconds, increased from 0.05 seconds. > However, "a." provides "correctness" that solves some hard issues like > infinite redirection with bundle or the share extension. So the performance > price looks worthwhile. If we do want that 0.05 seconds, we can optimize > later - like by making it possible to pre-run uisetups for part of the > extensions manually. > > diff --git a/hgext/chgserver.py b/mercurial/chgserver.py > copy from hgext/chgserver.py > copy to mercurial/chgserver.py > --- a/hgext/chgserver.py > +++ b/mercurial/chgserver.py > @@ -51,7 +51,7 @@ import sys > import time > > -from mercurial.i18n import _ > +from .i18n import _ > > -from mercurial import ( > +from . import ( > cmdutil, > commands, > @@ -125,5 +125,5 @@ def _getmtimepaths(ui): > modules = [m for n, m in extensions.extensions(ui)] > try: > -from mercurial import __version__ > +from . import __version__ > modules.append(__version__) > except ImportError: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] manifest: move manifestctx creation into manifestlog.get()
On Fri, Nov 18, 2016 at 10:56 AM, Durham Goodewrote: > I’m fine with getting rid of manifestv2. In the meantime, it’d be good to > get this patch in since it’s the last ctx constructor outside of > manifestlog.get(). Oh, did I forget to say that I queued it? Looks like I did :-) Thanks! > > On 11/18/16, 9:47 AM, "Martin von Zweigbergk" wrote: > > And of course that wasn't just for Durham. > > -- Forwarded message -- > From: Martin von Zweigbergk > Date: Fri, Nov 18, 2016 at 9:46 AM > Subject: Re: [PATCH] manifest: move manifestctx creation into > manifestlog.get() > To: Durham Goode > > > On Thu, Nov 17, 2016 at 3:36 PM, Durham Goode wrote: > > # HG changeset patch > > # User Durham Goode > > # Date 1479425479 28800 > > # Thu Nov 17 15:31:19 2016 -0800 > > # Node ID 916fbbd3d9a628dcd4a63c352d4d70b678e92a68 > > # Parent c27614f2dec1405db606d1ef871dfabf72cc0737 > > manifest: move manifestctx creation into manifestlog.get() > > > > Most manifestctx creation already happened in manifestlog.get(), but > there was > > one spot in the manifestctx class itself that created an instance > manually. This > > patch makes that one instance go through the manifestlog. This means > extensions > > can just wrap manifestlog.get() and it will cover all manifestctx > creations. It > > also means this code path now hits the manifestlog cache. > > > > diff --git a/mercurial/manifest.py b/mercurial/manifest.py > > --- a/mercurial/manifest.py > > +++ b/mercurial/manifest.py > > @@ -1418,7 +1418,7 @@ class manifestctx(object): > > if revlog._usemanifestv2: > > Looks like the below is only used with manifestv2, which no one is > using and no one will probably be using. > > That reminded me to update the wiki for manfestv2. Please take a look > at the "Space savings" section of > > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_wiki_ManifestV2Plan=DgIBaQ=5VD0RTtNlTh3ycd41b3MUw=nuarHzhP1wi1T9iURRCj1A=UGs0X2NyCTmbnJsMiQ_o3RWDnXgfqn3Y7J0uRnz-5p4=wvTFQc3KF1krxTB5k8hm9PkVcrvIWEANNelYw2mKouE= > and see how it's a > actually a space increase. I reported that a long time ago, but redid > the tests the other week (repo conversion took a week, I think) and > finally updated the wiki. Let me know if you (anyone) think we should > still keep the experimental manifestv2 code in there. > > > # Need to perform a slow delta > > r0 = revlog.deltaparent(revlog.rev(self._node)) > > -m0 = manifestctx(self._repo, revlog.node(r0)).read() > > +m0 = self._repo.manifestlog[revlog.node(r0)].read() > > m1 = self.read() > > md = manifestdict() > > for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems(): > > ___ > > Mercurial-devel mailing list > > Mercurial-devel@mercurial-scm.org > > > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel=DgIBaQ=5VD0RTtNlTh3ycd41b3MUw=nuarHzhP1wi1T9iURRCj1A=UGs0X2NyCTmbnJsMiQ_o3RWDnXgfqn3Y7J0uRnz-5p4=2fnnUnE_7o6jsxXbyA5zjQqTK9blzFt57ry0FTJq1Pc= > > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] manifest: move manifestctx creation into manifestlog.get()
I’m fine with getting rid of manifestv2. In the meantime, it’d be good to get this patch in since it’s the last ctx constructor outside of manifestlog.get(). On 11/18/16, 9:47 AM, "Martin von Zweigbergk"wrote: And of course that wasn't just for Durham. -- Forwarded message -- From: Martin von Zweigbergk Date: Fri, Nov 18, 2016 at 9:46 AM Subject: Re: [PATCH] manifest: move manifestctx creation into manifestlog.get() To: Durham Goode On Thu, Nov 17, 2016 at 3:36 PM, Durham Goode wrote: > # HG changeset patch > # User Durham Goode > # Date 1479425479 28800 > # Thu Nov 17 15:31:19 2016 -0800 > # Node ID 916fbbd3d9a628dcd4a63c352d4d70b678e92a68 > # Parent c27614f2dec1405db606d1ef871dfabf72cc0737 > manifest: move manifestctx creation into manifestlog.get() > > Most manifestctx creation already happened in manifestlog.get(), but there was > one spot in the manifestctx class itself that created an instance manually. This > patch makes that one instance go through the manifestlog. This means extensions > can just wrap manifestlog.get() and it will cover all manifestctx creations. It > also means this code path now hits the manifestlog cache. > > diff --git a/mercurial/manifest.py b/mercurial/manifest.py > --- a/mercurial/manifest.py > +++ b/mercurial/manifest.py > @@ -1418,7 +1418,7 @@ class manifestctx(object): > if revlog._usemanifestv2: Looks like the below is only used with manifestv2, which no one is using and no one will probably be using. That reminded me to update the wiki for manfestv2. Please take a look at the "Space savings" section of https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_wiki_ManifestV2Plan=DgIBaQ=5VD0RTtNlTh3ycd41b3MUw=nuarHzhP1wi1T9iURRCj1A=UGs0X2NyCTmbnJsMiQ_o3RWDnXgfqn3Y7J0uRnz-5p4=wvTFQc3KF1krxTB5k8hm9PkVcrvIWEANNelYw2mKouE= and see how it's a actually a space increase. I reported that a long time ago, but redid the tests the other week (repo conversion took a week, I think) and finally updated the wiki. Let me know if you (anyone) think we should still keep the experimental manifestv2 code in there. > # Need to perform a slow delta > r0 = revlog.deltaparent(revlog.rev(self._node)) > -m0 = manifestctx(self._repo, revlog.node(r0)).read() > +m0 = self._repo.manifestlog[revlog.node(r0)].read() > m1 = self.read() > md = manifestdict() > for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems(): > ___ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel=DgIBaQ=5VD0RTtNlTh3ycd41b3MUw=nuarHzhP1wi1T9iURRCj1A=UGs0X2NyCTmbnJsMiQ_o3RWDnXgfqn3Y7J0uRnz-5p4=2fnnUnE_7o6jsxXbyA5zjQqTK9blzFt57ry0FTJq1Pc= ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Fwd: [PATCH] manifest: move manifestctx creation into manifestlog.get()
And of course that wasn't just for Durham. -- Forwarded message -- From: Martin von ZweigbergkDate: Fri, Nov 18, 2016 at 9:46 AM Subject: Re: [PATCH] manifest: move manifestctx creation into manifestlog.get() To: Durham Goode On Thu, Nov 17, 2016 at 3:36 PM, Durham Goode wrote: > # HG changeset patch > # User Durham Goode > # Date 1479425479 28800 > # Thu Nov 17 15:31:19 2016 -0800 > # Node ID 916fbbd3d9a628dcd4a63c352d4d70b678e92a68 > # Parent c27614f2dec1405db606d1ef871dfabf72cc0737 > manifest: move manifestctx creation into manifestlog.get() > > Most manifestctx creation already happened in manifestlog.get(), but there was > one spot in the manifestctx class itself that created an instance manually. > This > patch makes that one instance go through the manifestlog. This means > extensions > can just wrap manifestlog.get() and it will cover all manifestctx creations. > It > also means this code path now hits the manifestlog cache. > > diff --git a/mercurial/manifest.py b/mercurial/manifest.py > --- a/mercurial/manifest.py > +++ b/mercurial/manifest.py > @@ -1418,7 +1418,7 @@ class manifestctx(object): > if revlog._usemanifestv2: Looks like the below is only used with manifestv2, which no one is using and no one will probably be using. That reminded me to update the wiki for manfestv2. Please take a look at the "Space savings" section of https://www.mercurial-scm.org/wiki/ManifestV2Plan and see how it's a actually a space increase. I reported that a long time ago, but redid the tests the other week (repo conversion took a week, I think) and finally updated the wiki. Let me know if you (anyone) think we should still keep the experimental manifestv2 code in there. > # Need to perform a slow delta > r0 = revlog.deltaparent(revlog.rev(self._node)) > -m0 = manifestctx(self._repo, revlog.node(r0)).read() > +m0 = self._repo.manifestlog[revlog.node(r0)].read() > m1 = self.read() > md = manifestdict() > for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems(): > ___ > 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