D6169: unshelve: disable unshelve during merge (issue5123)
yuja added a comment. > As stated in the issue5123, unshelve can destroy the second parent of > the context when tried to unshelve with an uncommitted merge. This > patch makes unshelve to abort when called with an uncommitted merge. Is it difficult to fix unshelve to not lose merge parents? https://bz.mercurial-scm.org/show_bug.cgi?id=5123#c2 REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6169 To: navaneeth.suresh, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D6169: unshelve: disable unshelve during merge (issue5123)
> As stated in the issue5123, unshelve can destroy the second parent of > the context when tried to unshelve with an uncommitted merge. This > patch makes unshelve to abort when called with an uncommitted merge. Is it difficult to fix unshelve to not lose merge parents? https://bz.mercurial-scm.org/show_bug.cgi?id=5123#c2 ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D6027: mq: make unshelve to apply on modified mq patch (issue4318)
> --- a/hgext/mq.py > +++ b/hgext/mq.py > @@ -3518,7 +3518,10 @@ > delattr(self.unfiltered(), r'mq') > > def abortifwdirpatched(self, errmsg, force=False): > -if self.mq.applied and self.mq.checkapplied and not force: > +shelveinprogress = any('shelvedstate' in state > +for state in cmdutil.unfinishedstates) > +if (self.mq.applied and self.mq.checkapplied and not force and > +not shelveinprogress): It doesn't make sense to check the existence of 'shelvedstate' in a static table. Can't we somehow get around the mq in a similar way to shelve.getcommitfunc()? I don't think it's good idea to rely on state files saved on disk. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] phabricator: better error message when phabread fails to get a differential
On Sun, 24 Mar 2019 19:24:12 -0400, Jordi Gutiérrez Hermoso wrote: > # HG changeset patch > # User Laurent Peuch > # Date 1553469818 14400 > # Sun Mar 24 19:23:38 2019 -0400 > # Node ID a39d18493bf66aa29f7d0dc1c5a4164b84507e1b > # Parent ba064f95175e6cb1467401a3a536d8c32229d4b1 > phabricator: better error message when phabread fails to get a differential > > diff --git a/hgext/phabricator.py b/hgext/phabricator.py > --- a/hgext/phabricator.py > +++ b/hgext/phabricator.py > @@ -783,8 +783,9 @@ def querydrev(repo, spec): > prefetched[drev[b'phid']] = drev > prefetched[int(drev[b'id'])] = drev > if key not in prefetched: > -raise error.Abort(_(b'cannot get Differential Revision %r') > - % params) > +raise error.Abort(_(b'cannot get Differential Revision %s using > the params %r.' > + % (key, params)), stringutil.pprint()? Otherwise, py3 would print b''. > + hint=_("check that the Differential Revision > exists and that you have access to it")) test-check-code.t would say hi. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] shelve: add --keep to list of allowables
On Sun, 24 Mar 2019 20:13:37 -0400, Jordi Gutiérrez Hermoso wrote: > # HG changeset patch > # User Jordi Gutiérrez Hermoso > # Date 1553472793 14400 > # Sun Mar 24 20:13:13 2019 -0400 > # Node ID 4b1cb76ab29461a0a4c5ff12bb364ea2bb5b1b89 > # Parent 50d5e64ec561a8227ad32fe86c1811963e7664cd > shelve: add --keep to list of allowables Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6164: wix: add a hook for a prebuild script to inject extra libraries
durin42 added a comment. In https://phab.mercurial-scm.org/D6164#89916, @indygreg wrote: > In https://phab.mercurial-scm.org/D6164#89915, @durin42 wrote: > > > In https://phab.mercurial-scm.org/D6164#89914, @indygreg wrote: > > > > > In https://phab.mercurial-scm.org/D6164#89913, @durin42 wrote: > > > > > > > > > > > > > > > > How about we add an argument to define the path(s) to the pip requirements file(s) to use? By default, it can use the `requirements.txt` in the repo. Would that solve your use case? > > > > > > No, because I have some stuff which (out of tragic necessity at the moment) isn't `pip` installable, and I have to install it into the virtualenv by banging some rocks together. :( > > > Bleh. So you do need the power of a full script here. Yep. :( > I'll queue with the naming change to "virtualenv populate script" or something along those lines. Thanks. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6164 To: durin42, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6164: wix: add a hook for a prebuild script to inject extra libraries
indygreg added a comment. In https://phab.mercurial-scm.org/D6164#89915, @durin42 wrote: > In https://phab.mercurial-scm.org/D6164#89914, @indygreg wrote: > > > In https://phab.mercurial-scm.org/D6164#89913, @durin42 wrote: > > > > > > > > > > > How about we add an argument to define the path(s) to the pip requirements file(s) to use? By default, it can use the `requirements.txt` in the repo. Would that solve your use case? > > > No, because I have some stuff which (out of tragic necessity at the moment) isn't `pip` installable, and I have to install it into the virtualenv by banging some rocks together. :( Bleh. So you do need the power of a full script here. I'll queue with the naming change to "virtualenv populate script" or something along those lines. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6164 To: durin42, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6164: wix: add a hook for a prebuild script to inject extra libraries
durin42 added a comment. In https://phab.mercurial-scm.org/D6164#89914, @indygreg wrote: > In https://phab.mercurial-scm.org/D6164#89913, @durin42 wrote: > > > > > > How about we add an argument to define the path(s) to the pip requirements file(s) to use? By default, it can use the `requirements.txt` in the repo. Would that solve your use case? No, because I have some stuff which (out of tragic necessity at the moment) isn't `pip` installable, and I have to install it into the virtualenv by banging some rocks together. :( REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6164 To: durin42, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6164: wix: add a hook for a prebuild script to inject extra libraries
indygreg added a comment. In https://phab.mercurial-scm.org/D6164#89913, @durin42 wrote: > How about we add an argument to define the path(s) to the pip requirements file(s) to use? By default, it can use the `requirements.txt` in the repo. Would that solve your use case? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6164 To: durin42, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6164: wix: add a hook for a prebuild script to inject extra libraries
durin42 added a comment. In https://phab.mercurial-scm.org/D6164#89881, @indygreg wrote: > I like the flexibility. But I'm not super keen about the interface here. Using a script to inject custom options seems like it could be useful. But as it is currently implemented, the script simply prints out `\0` delimited package names. So one UI wart is `--extra-prebuild-script` being a somewhat generic name but that script only emits package names. `--extra-packages-script` would be a better name. The script also has to install packages into the virtualenv so they're findable. > What do you think about defining an `--extra-package` CLI argument that takes `nargs=*` or an `--extra-packages` that takes a comma-delimited list and then thread that through to the existing `extra_packages` keyword argument? That seems a bit simpler and easier to extend than scripts. I'm open to having both an --extra-package *and* a script argument, if that's what you're proposing. Does that sound workable? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6164 To: durin42, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 6 "] tests: use "perf" as a the extension name in test-contrib-perf.t
On Mon, Mar 25, 2019 at 7:25 AM Pierre-Yves David < pierre-yves.da...@ens-lyon.org> wrote: > # HG changeset patch > # User Pierre-Yves David > # Date 1553516213 -3600 > # Mon Mar 25 13:16:53 2019 +0100 > # Node ID 2af270b21d11836dbfc3b693c152616f5493cab3 > # Parent e1ceefab9bcad1bb472e261d73a5e3fda74fdf18 > # EXP-Topic perf-run > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > 2af270b21d11 > tests: use "perf" as a the extension name in test-contrib-perf.t > Queued this series. Thanks for the feature! > > This is simpler and seems more "inline" with the name people usually use > for > this extensions. > > diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t > --- a/tests/test-contrib-perf.t > +++ b/tests/test-contrib-perf.t > @@ -32,14 +32,14 @@ perfstatus > >$ cat >> $HGRCPATH << EOF >> [extensions] > - > perfstatusext=$CONTRIBDIR/perf.py > + > perf=$CONTRIBDIR/perf.py >> [perf] >> presleep=0 >> stub=on >> parentscount=1 >> EOF > - $ hg help perfstatusext > - perfstatusext extension - helper extension to measure performance > + $ hg help -e perf > + perf extension - helper extension to measure performance > >list of commands: > > @@ -142,7 +142,7 @@ perfstatus > perfwalk (no help text available) > perfwrite microbenchmark ui.write > > - (use 'hg help -v perfstatusext' to show built-in aliases and global > options) > + (use 'hg help -v perf' to show built-in aliases and global options) >$ hg perfaddremove >$ hg perfancestors >$ hg perfancestorset 2 > ___ > 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
[PATCH 6 of 6 "] perf: introduce a `perf.run-limits` options
# HG changeset patch # User Pierre-Yves David # Date 1552825852 0 # Sun Mar 17 12:30:52 2019 + # Node ID 93eae0de9e6f31089cde3dde13a7a70d0a9d4f91 # Parent 3ec42dcfe522d2d72c65874e97b0c7ef67f46685 # EXP-Topic perf-run # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 93eae0de9e6f perf: introduce a `perf.run-limits` options This options make it possible to configure the number of run that the extensions will perform. This is useful for automated benchmark or for performance measurement that need better accuracy. diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -15,6 +15,16 @@ Configurations ``presleep`` number of second to wait before any group of run (default: 1) +``run-limits`` + Control the number of run each benchmark will perform. The option value + should be a list of `-` pairs. After each run the + condition are considered in order with the following logic: + + If benchmark have been running for seconds, and we have performed + iterations, stop the benchmark, + + The default value is: `3.0-100, 10.0-3` + ``stub`` When set, benchmark will only be run once, useful for testing (default: off) ''' @@ -225,6 +235,9 @@ try: configitem(b'perf', b'all-timing', default=mercurial.configitems.dynamicdefault, ) +configitem(b'perf', b'run-limits', +default=mercurial.configitems.dynamicdefault, +) except (ImportError, AttributeError): pass @@ -297,7 +310,34 @@ def gettimer(ui, opts=None): # experimental config: perf.all-timing displayall = ui.configbool(b"perf", b"all-timing", False) -return functools.partial(_timer, fm, displayall=displayall), fm + +# experimental config: perf.run-limits +limitspec = ui.configlist(b"perf", b"run-limits", []) +limits = [] +for item in limitspec: +parts = item.split('-', 1) +if len(parts) < 2: +ui.warn(('malformatted run limit entry, missing "-": %s\n' + % item)) +continue +try: +time_limit = float(parts[0]) +except ValueError as e: +ui.warn(('malformatted run limit entry, %s: %s\n' + % (e, item))) +continue +try: +run_limit = int(parts[1]) +except ValueError as e: +ui.warn(('malformatted run limit entry, %s: %s\n' + % (e, item))) +continue +limits.append((time_limit, run_limit)) +if not limits: +limits = DEFAULTLIMITS + +t = functools.partial(_timer, fm, displayall=displayall, limits=limits) +return t, fm def stub_timer(fm, func, setup=None, title=None): if setup is not None: diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t --- a/tests/test-contrib-perf.t +++ b/tests/test-contrib-perf.t @@ -55,6 +55,16 @@ perfstatus "presleep" number of second to wait before any group of run (default: 1) + "run-limits" +Control the number of run each benchmark will perform. The option value +should be a list of '-' pairs. After each run the +condition are considered in order with the following logic: + +If benchmark have been running for seconds, and we have performed + iterations, stop the benchmark, + +The default value is: '3.0-100, 10.0-3' + "stub" When set, benchmark will only be run once, useful for testing (default: off) @@ -231,6 +241,31 @@ perfstatus $ hg perfparents $ hg perfdiscovery -q . +Test run control + + +Simple single entry + + $ hg perfparents --config perf.stub=no --config perf.run-limits='0.1-15' + ! wall * comb * user * sys * (best of 15) (glob) + +Multiple entries + + $ hg perfparents --config perf.stub=no --config perf.run-limits='50-1, 0.1-5' + ! wall * comb * user * sys * (best of 5) (glob) + +error case are ignored + + $ hg perfparents --config perf.stub=no --config perf.run-limits='500, 0.1-5' + malformatted run limit entry, missing "-": 500 + ! wall * comb * user * sys * (best of 5) (glob) + $ hg perfparents --config perf.stub=no --config perf.run-limits='aaa-12, 0.1-5' + malformatted run limit entry, could not convert string to float: aaa: aaa-12 + ! wall * comb * user * sys * (best of 5) (glob) + $ hg perfparents --config perf.stub=no --config perf.run-limits='12-aa, 0.1-5' + malformatted run limit entry, invalid literal for int() with base 10: 'aa': 12-aa + ! wall * comb * user * sys * (best of 5) (glob) + test actual output -- ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 5 of 6 "] perf: pass limits as a function argument
# HG changeset patch # User Pierre-Yves David # Date 1552763479 0 # Sat Mar 16 19:11:19 2019 + # Node ID 3ec42dcfe522d2d72c65874e97b0c7ef67f46685 # Parent 89dba0ac07a2c581f527c807c61c36883013d323 # EXP-Topic perf-run # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 3ec42dcfe522 perf: pass limits as a function argument The function applying the limit has no access to the configuration. Therefore, some higher layer will have to pass it as argument. We do this in an independent change to clarify the next change. diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -322,7 +322,8 @@ DEFAULTLIMITS = ( (10.0, 3), ) -def _timer(fm, func, setup=None, title=None, displayall=False): +def _timer(fm, func, setup=None, title=None, displayall=False, + limits=DEFAULTLIMITS): gc.collect() results = [] begin = util.timer() @@ -338,7 +339,7 @@ def _timer(fm, func, setup=None, title=N cstop = util.timer() # Look for a stop condition. elapsed = cstop - begin -for t, mincount in DEFAULTLIMITS: +for t, mincount in limits: if elapsed >= t and count >= mincount: keepgoing = False break ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 4 of 6 "] perf: more flexible implementation for checking stop conditions
# HG changeset patch # User Pierre-Yves David # Date 1552763307 0 # Sat Mar 16 19:08:27 2019 + # Node ID 89dba0ac07a2c581f527c807c61c36883013d323 # Parent 0f03ddf89818a3561dcd9b7a186ba7bcd2d10ed3 # EXP-Topic perf-run # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 89dba0ac07a2 perf: more flexible implementation for checking stop conditions We want to make this logic simpler to configure. The first step is to stop hard-coding every values. diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -315,12 +315,20 @@ def timeone(): a, b = ostart, ostop r.append((cstop - cstart, b[0] - a[0], b[1]-a[1])) + +# list of stop condition (elapsed time, minimal run count) +DEFAULTLIMITS = ( +(3.0, 100), +(10.0, 3), +) + def _timer(fm, func, setup=None, title=None, displayall=False): gc.collect() results = [] begin = util.timer() count = 0 -while True: +keepgoing = True +while keepgoing: if setup is not None: setup() with timeone() as item: @@ -328,10 +336,12 @@ def _timer(fm, func, setup=None, title=N count += 1 results.append(item[0]) cstop = util.timer() -if cstop - begin > 3 and count >= 100: -break -if cstop - begin > 10 and count >= 3: -break +# Look for a stop condition. +elapsed = cstop - begin +for t, mincount in DEFAULTLIMITS: +if elapsed >= t and count >= mincount: +keepgoing = False +break formatone(fm, results, title=title, result=r, displayall=displayall) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 3 of 6 "] perf: document perfparents
# HG changeset patch # User Pierre-Yves David # Date 1553517838 -3600 # Mon Mar 25 13:43:58 2019 +0100 # Node ID 0f03ddf89818a3561dcd9b7a186ba7bcd2d10ed3 # Parent 9ba4809996b5ce769376a86cf88ef8f2b844b806 # EXP-Topic perf-run # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 0f03ddf89818 perf: document perfparents diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -1164,6 +1164,13 @@ def perfstartup(ui, repo, **opts): @command(b'perfparents', formatteropts) def perfparents(ui, repo, **opts): +"""benchmark the time necessary to fetch one changesets parents. + +The fetch is done using the `node identifier`, traversing all object layer +from the repository object. The N first revision will be used for this +benchmark. N is controlled by the ``perf.parentscount`` config option +(default: 1000). +""" opts = _byteskwargs(opts) timer, fm = gettimer(ui, opts) # control the number of commits perfparents iterates over diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t --- a/tests/test-contrib-perf.t +++ b/tests/test-contrib-perf.t @@ -129,7 +129,7 @@ perfstatus (no help text available) perfnodemap benchmark the time necessary to look up revision from a cold nodemap - perfparents (no help text available) + perfparents benchmark the time necessary to fetch one changesets parents. perfpathcopies benchmark the copy tracing logic perfphasesbenchmark phasesets computation ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 6 "] perf: document config options
# HG changeset patch # User Pierre-Yves David # Date 1553517820 -3600 # Mon Mar 25 13:43:40 2019 +0100 # Node ID 9ba4809996b5ce769376a86cf88ef8f2b844b806 # Parent 2af270b21d11836dbfc3b693c152616f5493cab3 # EXP-Topic perf-run # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 9ba4809996b5 perf: document config options We have configuration, so we better document it. diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -1,5 +1,23 @@ # perf.py - performance test routines -'''helper extension to measure performance''' +'''helper extension to measure performance + +Configurations +== + +``perf`` + + +``all-timing`` +When set, additional statistic will be reported for each benchmark: best, +worst, median average. If not set only the best timing is reported +(default: off). + +``presleep`` + number of second to wait before any group of run (default: 1) + +``stub`` +When set, benchmark will only be run once, useful for testing (default: off) +''' # "historical portability" policy of perf.py: # diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t --- a/tests/test-contrib-perf.t +++ b/tests/test-contrib-perf.t @@ -41,6 +41,24 @@ perfstatus $ hg help -e perf perf extension - helper extension to measure performance + Configurations + == + + "perf" + -- + + "all-timing" + When set, additional statistic will be reported for each benchmark: best, + worst, median average. If not set only the best timing is reported + (default: off). + + "presleep" +number of second to wait before any group of run (default: 1) + + "stub" + When set, benchmark will only be run once, useful for testing (default: + off) + list of commands: perfaddremove ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 6 "] tests: use "perf" as a the extension name in test-contrib-perf.t
# HG changeset patch # User Pierre-Yves David # Date 1553516213 -3600 # Mon Mar 25 13:16:53 2019 +0100 # Node ID 2af270b21d11836dbfc3b693c152616f5493cab3 # Parent e1ceefab9bcad1bb472e261d73a5e3fda74fdf18 # EXP-Topic perf-run # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 2af270b21d11 tests: use "perf" as a the extension name in test-contrib-perf.t This is simpler and seems more "inline" with the name people usually use for this extensions. diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t --- a/tests/test-contrib-perf.t +++ b/tests/test-contrib-perf.t @@ -32,14 +32,14 @@ perfstatus $ cat >> $HGRCPATH << EOF > [extensions] - > perfstatusext=$CONTRIBDIR/perf.py + > perf=$CONTRIBDIR/perf.py > [perf] > presleep=0 > stub=on > parentscount=1 > EOF - $ hg help perfstatusext - perfstatusext extension - helper extension to measure performance + $ hg help -e perf + perf extension - helper extension to measure performance list of commands: @@ -142,7 +142,7 @@ perfstatus perfwalk (no help text available) perfwrite microbenchmark ui.write - (use 'hg help -v perfstatusext' to show built-in aliases and global options) + (use 'hg help -v perf' to show built-in aliases and global options) $ hg perfaddremove $ hg perfancestors $ hg perfancestorset 2 ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 6105] New: add equivalent of `git pull --autostash` to mercurial
https://bz.mercurial-scm.org/show_bug.cgi?id=6105 Bug ID: 6105 Summary: add equivalent of `git pull --autostash` to mercurial Product: Mercurial Version: unspecified Hardware: PC OS: Mac OS Status: UNCONFIRMED Severity: feature Priority: wish Component: rebase Assignee: bugzi...@mercurial-scm.org Reporter: slippyche...@google.com CC: mercurial-devel@mercurial-scm.org Git gained at some point the extremely convenient command, and wrapper: ] git rebase --autostash ] git pull --rebase --autostash These will automatically stash (hg shelve) changes in a dirty working copy, perform the operation, then apply the content of the stash, and discard it. As git note, "this may cause non-trivial merge conflicts", but it means that the rebase operation can be done with a dirty working directory. This turns out to be a shockingly common operation for me, example workflow: - create a new chain of 2-5 commits implementing something in small, logical steps - identify a bug that blocks further progress - create a commit fixing it, and rebase to shuffle it to the bottom of the chain - send that upstream for review, etc - it is committed - `hg pull --rebase` my chain to get it incorporated This is hardly an impossible situation: I can work on the non-committed version, or commit current work fully and then rebase, or `hg commit -m blah` and rebase, but ... the git option is rather nice. -- 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
D6169: unshelve: disable unshelve during merge (issue5123)
navaneeth.suresh created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY As stated in the issue5123, unshelve can destroy the second parent of the context when tried to unshelve with an uncommitted merge. This patch makes unshelve to abort when called with an uncommitted merge. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6169 AFFECTED FILES hgext/shelve.py tests/test-shelve.t CHANGE DETAILS diff --git a/tests/test-shelve.t b/tests/test-shelve.t --- a/tests/test-shelve.t +++ b/tests/test-shelve.t @@ -1087,3 +1087,46 @@ test (4|13):33f7f61e6c5e (re) $ cd .. + +Abort unshelve while merging (issue5123) +- + $ hg init issue5123 + $ cd issue5123 + $ echo > a + $ hg ci -Am a + adding a + $ hg co null + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ echo > b + $ hg ci -Am b + adding b + created new head + $ echo > c + $ hg add c + $ hg shelve + shelved as default + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg co 1 + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg merge 0 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) +-- successful merge with two parents + $ hg log -G + @ changeset: 1:406bf70c274f + tag: tip + parent: -1: + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: b + + @ changeset: 0:ada8c9eb8252 + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: a + +-- trying to pull in the shelve bits +-- unshelve should abort otherwise, it'll eat my second parent. + $ hg unshelve + abort: cannot unshelve while merging + [255] diff --git a/hgext/shelve.py b/hgext/shelve.py --- a/hgext/shelve.py +++ b/hgext/shelve.py @@ -988,6 +988,12 @@ return unshelvecontinue(ui, repo, state, opts) elif len(shelved) > 1: raise error.Abort(_('can only unshelve one change at a time')) + +# abort unshelve while merging (issue5123) +parents = repo[None].parents() +if len(parents) > 1: +raise error.Abort(_('cannot unshelve while merging')) + elif not shelved: shelved = listshelves(repo) if not shelved: To: navaneeth.suresh, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel