D6659: graft: split graft code to avoid duplication

2019-07-18 Thread taapas1128 (Taapas Agrawal)
taapas1128 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  To avoid duplication of code due to `cmdutil.continuegraft()`; `graft()`
  is split into `cmdutil.finishgraft()` which deals with the execution of graft
  once `revs` are generated and `cmdutil.continuegraftstate()` which updates 
opts
  from `graftstate` file when graft is continued from an interrupted state.
  
  Further tests for issue1175 are updated to show the behaviour of `hg 
continue`.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6659

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/commands.py
  tests/test-issue1175.t

CHANGE DETAILS

diff --git a/tests/test-issue1175.t b/tests/test-issue1175.t
--- a/tests/test-issue1175.t
+++ b/tests/test-issue1175.t
@@ -1,3 +1,11 @@
+#testcases continueflag continuecommand
+#if continueflag
+  $ cat >> $HGRCPATH < [alias]
+  > continue = graft --continue
+  > EOF
+#endif
+
 https://bz.mercurial-scm.org/1175
 
   $ hg init
@@ -80,7 +88,7 @@
   $ hg resolve --mark b
   (no more unresolved files)
   continue: hg graft --continue
-  $ hg graft --continue
+  $ hg continue
   grafting 1:5974126fad84 "b1"
   warning: can't find ancestor for 'b' copied from 'a'!
   $ hg log -f b -T 'changeset:   {rev}:{node|short}\nsummary: {desc}\n\n'
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2474,9 +2474,6 @@
 if not opts.get('date') and opts.get('currentdate'):
 opts['date'] = "%d %d" % dateutil.makedate()
 
-editor = cmdutil.getcommiteditor(editform='graft',
- **pycompat.strkwargs(opts))
-
 cont = False
 if opts.get('no_commit'):
 if opts.get('edit'):
@@ -2522,17 +2519,7 @@
 raise error.Abort(_("can't specify --continue and revisions"))
 # read in unfinished revisions
 if graftstate.exists():
-statedata = cmdutil.readgraftstate(repo, graftstate)
-if statedata.get('date'):
-opts['date'] = statedata['date']
-if statedata.get('user'):
-opts['user'] = statedata['user']
-if statedata.get('log'):
-opts['log'] = True
-if statedata.get('no_commit'):
-opts['no_commit'] = statedata.get('no_commit')
-nodes = statedata['nodes']
-revs = [repo[node].rev() for node in nodes]
+revs = cmdutil.continuegraftstate(repo, graftstate, opts)
 else:
 cmdutil.wrongtooltocontinue(repo, _('graft'))
 else:
@@ -2623,69 +2610,8 @@
 
 if opts.get('no_commit'):
 statedata['no_commit'] = True
-for pos, ctx in enumerate(repo.set("%ld", revs)):
-desc = '%d:%s "%s"' % (ctx.rev(), ctx,
-   ctx.description().split('\n', 1)[0])
-names = repo.nodetags(ctx.node()) + repo.nodebookmarks(ctx.node())
-if names:
-desc += ' (%s)' % ' '.join(names)
-ui.status(_('grafting %s\n') % desc)
-if opts.get('dry_run'):
-continue
-
-source = ctx.extra().get('source')
-extra = {}
-if source:
-extra['source'] = source
-extra['intermediate-source'] = ctx.hex()
-else:
-extra['source'] = ctx.hex()
-user = ctx.user()
-if opts.get('user'):
-user = opts['user']
-statedata['user'] = user
-date = ctx.date()
-if opts.get('date'):
-date = opts['date']
-statedata['date'] = date
-message = ctx.description()
-if opts.get('log'):
-message += '\n(grafted from %s)' % ctx.hex()
-statedata['log'] = True
-
-# we don't merge the first commit when continuing
-if not cont:
-# perform the graft merge with p1(rev) as 'ancestor'
-overrides = {('ui', 'forcemerge'): opts.get('tool', '')}
-base = ctx.p1() if basectx is None else basectx
-with ui.configoverride(overrides, 'graft'):
-stats = mergemod.graft(repo, ctx, base, ['local', 'graft'])
-# report any conflicts
-if stats.unresolvedcount > 0:
-# write out state for --continue
-nodes = [repo[rev].hex() for rev in revs[pos:]]
-statedata['nodes'] = nodes
-stateversion = 1
-graftstate.save(stateversion, statedata)
-hint = _("use 'hg resolve' and 'hg graft --continue'")
-raise error.Abort(
-_("unresolved conflicts, can't continue"),
-hint=hint)
-else:
-cont = False
-
-# commit if --no-commit is false
-if not opts.get('no_commit'):
-node = repo.commit(text=message, user=user, date=date, extra=extra,
-  

D6660: commands: removed part of description from abort and continue

2019-07-18 Thread taapas1128 (Taapas Agrawal)
taapas1128 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The description for registration of new `continuefunc` or `abortfunc`
  is removed as it is not required from user perspective.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6660

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -141,8 +141,6 @@
 and unshelve if they are in an unfinished state.
 
 use --dry-run/-n to dry run the command.
-A new operation can be added to this by registering the operation and
-abort logic in the unfinishedstates list under statemod.
 """
 dryrun = opts.get(r'dry_run')
 abortstate = cmdutil.getunfinishedstate(repo)
@@ -1903,8 +1901,6 @@
 and unshelve if they are in an interrupted state.
 
 use --dry-run/-n to dry run the command.
-A new operation can be added to this by registering the operation and
-continue logic in the unfinishedstates list under statemod.
 """
 dryrun = opts.get(r'dry_run')
 contstate = cmdutil.getunfinishedstate(repo)



To: taapas1128, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@42623: 12 new changesets

2019-07-18 Thread Mercurial Commits
12 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/3c16b9c0b099
changeset:   42612:3c16b9c0b099
user:Taapas Agrawal 
date:Mon Jul 15 22:23:31 2019 +0530
summary: continue: added logic for hg continue

https://www.mercurial-scm.org/repo/hg/rev/35ebdbb38efb
changeset:   42613:35ebdbb38efb
user:Taapas Agrawal 
date:Tue Jul 16 01:59:28 2019 +0530
summary: continue: added support for rebase

https://www.mercurial-scm.org/repo/hg/rev/117437f3f541
changeset:   42614:117437f3f541
user:Taapas Agrawal 
date:Wed Jul 17 22:24:17 2019 +0530
summary: continue: added support for unshelve

https://www.mercurial-scm.org/repo/hg/rev/56132ebd14c6
changeset:   42615:56132ebd14c6
user:Valentin Gatien-Baron 
date:Sun Jul 07 10:54:41 2019 -0400
summary: blackbox: disable extremely verbose logging (issue6110)

https://www.mercurial-scm.org/repo/hg/rev/5162753c4c14
changeset:   42616:5162753c4c14
user:Navaneeth Suresh 
date:Tue Jul 02 18:02:12 2019 +0530
summary: unshelve: add interactive mode

https://www.mercurial-scm.org/repo/hg/rev/7629eb87e7f2
changeset:   42617:7629eb87e7f2
user:Ian Moody 
date:Tue Jul 16 18:38:38 2019 +0100
summary: phabricator: demonstrate broken phabread on string local:commit 
times

https://www.mercurial-scm.org/repo/hg/rev/c17e6a3e7356
changeset:   42618:c17e6a3e7356
user:Ian Moody 
date:Tue Jul 16 19:18:16 2019 +0100
summary: phabricator: handle local:commits time being string or int

https://www.mercurial-scm.org/repo/hg/rev/20d0e59be79b
changeset:   42619:20d0e59be79b
user:Valentin Gatien-Baron 
date:Tue Jul 02 12:55:51 2019 -0400
summary: tests: show the files fields of changelogs for many merges

https://www.mercurial-scm.org/repo/hg/rev/d98ec36be808
changeset:   42620:d98ec36be808
user:Valentin Gatien-Baron 
date:Sat Jul 13 23:45:32 2019 -0400
summary: convert: add a config option to help doing identity hg->hg 
conversion

https://www.mercurial-scm.org/repo/hg/rev/99ebde4fec99
changeset:   42621:99ebde4fec99
user:Valentin Gatien-Baron 
date:Tue Jul 02 12:59:58 2019 -0400
summary: commit: improve the files field of changelog for merges

https://www.mercurial-scm.org/repo/hg/rev/74ba82abbf29
changeset:   42622:74ba82abbf29
user:Navaneeth Suresh 
date:Thu Jul 18 20:54:26 2019 +0530
summary: unshelve: mark unshelve interactive as experimental

https://www.mercurial-scm.org/repo/hg/rev/9eace8d6d537
changeset:   42623:9eace8d6d537
bookmark:@
tag: tip
user:Navaneeth Suresh 
date:Thu Jul 18 21:10:17 2019 +0530
summary: shelve: modify help text on --interactive

-- 
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


D6655: continue: added support for graft

2019-07-18 Thread taapas1128 (Taapas Agrawal)
taapas1128 added a comment.


  @martinvonz I will send a patch doing that.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6655/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6655

To: taapas1128, #hg-reviewers
Cc: martinvonz, durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[Bug 6174] New: merge could probably be smarter and produce more correct results in some obscure cases

2019-07-18 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6174

Bug ID: 6174
   Summary: merge could probably be smarter and produce more
correct results in some obscure cases
   Product: Mercurial
   Version: stable branch
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: duri...@gmail.com
CC: mercurial-devel@mercurial-scm.org

Consider the below as a .t-test:

Test case taken from
https://tahoe-lafs.org/~zooko/badmerge/concrete-good-semantics.html

  $ hg init badmerge
  $ cd badmerge
  $ cat >main.c < int square(int x) {
  > int y = x;
  > /* Update y to equal the result. */
  > /* Question: what is the order of magnitude of this algorithm with
respect to x? */
  > for (int i = 0; i < x; i++) y += x;
  > return y;
  > }
  > EOF
  $ hg addr
  adding main.c
  $ hg ci -m a
  $ cat > main.c < int very_slow_square(int x) {
  > int y = 0;
  > /* Update y to equal the result. */
  > /* Question: what is the order of magnitude of this algorithm with
respect to x? */
  > for (int i = 0; i < x; i++)
  > for (int j = 0; j < x; j++)
  > y += 1;
  > return y;
  > }
  > 
  > int square(int x) {
  > int y = x;
  > /* Update y to equal the result. */
  > /* Question: what is the order of magnitude of this algorithm with
respect to x? */
  > for (int i = 0; i < x; i++) y += x;
  > return y;
  > }
  > EOF
  $ hg ci -m b1
  $ cat > main.c < int square(int x) {
  > int y = x;
  > /* Update y to equal the result. */
  > /* Question: what is the order of magnitude of this algorithm with
respect to x? */
  > return y * x;
  > }
  > 
  > int very_slow_square(int x) {
  > int y = 0;
  > /* Update y to equal the result. */
  > /* Question: what is the order of magnitude of this algorithm with
respect to x? */
  > for (int i = 0; i < x; i++)
  > for (int j = 0; j < x; j++)
  > y += 1;
  > return y;
  > }
  > 
  > int slow_square(int x) {
  > int y = x;
  > /* Update y to equal the result. */
  > /* Question: what is the order of magnitude of this algorithm with
respect to x? */
  > for (int i = 0; i < x; i++) y += x;
  > return y;
  > }
  > EOF
  $ hg ci -m b2
  $ hg co 0
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cat > main.c < int square(int x) {
  > int y = 0;
  > /* Update y to equal the result. */
  > /* Question: what is the order of magnitude of this algorithm with
respect to x? */
  > for (int i = 0; i < x; i++) y += x;
  > return y;
  > }
  > EOF
  $ hg ci -m c1
  created new head
  $ hg merge
  merging main.c
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
  (branch merge, don't forget to commit)
  $ hg ci -m merge
  $ cat > main.c < int square(int x) {
  > int y = x;
  > /* Update y to equal the result. */
  > /* Question: what is the order of magnitude of this algorithm with
respect to x? */
  > return y * x;
  > }
  > 
  > int very_slow_square(int x) {
  > int y = 0;
  > /* Update y to equal the result. */
  > /* Question: what is the order of magnitude of this algorithm with
respect to x? */
  > for (int i = 0; i < x; i++)
  > for (int j = 0; j < x; j++)
  > y += 1;
  > return y;
  > }
  > 
  > int slow_square(int x) {
  > int y = 0;
  > /* Update y to equal the result. */
  > /* Question: what is the order of magnitude of this algorithm with
respect to x? */
  > for (int i = 0; i < x; i++) y += x;
  > return y;
  > }
  > EOF
BUG: `hg diff` should be empty here, but we resolve the merge "wrong":
  $ hg diff
  diff -r 0a91f3f63b84 main.c
  --- a/main.c  Thu Jan 01 00:00:00 1970 +
  +++ b/main.c  Thu Jan 01 00:00:00 1970 +
  @@ -1,5 +1,5 @@
   int square(int x) {
  - int y = 0;
  + int y = x;
/* Update y to equal the result. */
/* Question: what is the order of magnitude of this algorithm with
respect to x? */
return y * x;
  @@ -16,7 +16,7 @@
   }

   int slow_square(int x) {
  - int y = x;
  + int y = 0;
/* Update y to equal the result. */
/* Question: what is the order of magnitude of this algorithm with
respect to x? */
for (int i = 0; i < x; i++) y += x;

It's pretty clear that the merged text as produced by hg is wrong (cat it if
you don't see the bug in the resulting .c file). zooko's doc claims we should
be able to do better, and I don't really have any reason to disagree. Filing
this mostly as a way to hang on to the test case, as I wrote it mostly to see
if we'd fixed this or not.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Re: An extension to log through standard logging module

2019-07-18 Thread Georges Racinet
On 7/18/19 8:24 PM, Kyle Lippincott wrote:
>
>
> On Thu, Jul 18, 2019 at 11:16 AM Augie Fackler  > wrote:
>
>
>
> > On Jul 16, 2019, at 13:27, Georges Racinet
> mailto:georges.raci...@octobus.net>>
> wrote:
> >
> > Hi there,
> >
> > for the needs of Heptapod [1], I ended up writing a small
> extension to
> > divert all possible console output to the standard logging
> module, with
> > the option to send the logs to a Sentry application.
> >
> > The source is at
> https://dev.heptapod.net/heptapod/hgext-loggingmod and
> > its README provides a fairly complete documentation.
> >
> > I think this extension would be useful in many more general server
> > settings, and should therefore probably be versioned with
> hg-core. Some
> > polishing would have to be made to bring it up to standard, and
> I'd be
> > happy to do that if people are interested.
> >
> > A short rationale:
> (...)
> >
> > What do you think ?
>
> I think it makes sense. Kyle, I think we might want this for some
> of our hg API servers too? Having it in core seems sensible to me.
>
>
> Having it in core seems fine to me. I can see possible ways we can use
> it, yes :)

Great, I'll submit patches for this during the 5.2 cycle, then.

Cheers.


>
> >
> > Cheers,
> >
> > [1] That is, our modified GitLab CE that supports Mercurial
> >
> > [2] with `ui.debug` set to True, some of that debugging info
> actually
> > spills into the HTTP responses, making them incorrect.
> >
> >
> > --
> > Georges Racinet
> > https://octobus.net
> > GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics
> >
> >
> > ___
> > Mercurial-devel mailing list
> > Mercurial-devel@mercurial-scm.org
> 
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
>
>
> -- 
> --Kyle
>
> Note:
> If I've asked a question, and you're responding to me, please use
> *respond all*, so that other people can read any solutions we come to!
>

-- 
Georges Racinet
https://octobus.net
GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics



signature.asc
Description: OpenPGP digital signature
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: Last call for 5.1 changes

2019-07-18 Thread Georges Racinet
On 7/18/19 8:15 PM, Augie Fackler wrote:
>
>> On Jul 16, 2019, at 14:21, Georges Racinet  
>> wrote:
>>
>>
>> On 7/16/19 2:58 PM, Augie Fackler wrote:
>>> I'll cut the rc later this week, maybe tomorrow, definitely no later than 
>>> Friday evening America/New_York. Am I missing anything people are burning 
>>> to see in 5.1? Are there any loose ends?
>> Well, I would be glad if my series on discovery could make it (the last
>> one is D6430).
> My week is full enough that I'm going to promise to look at this for you 
> early in the 5.2 cycle (probably the last week of July/first week of August). 
> If you don't hear from me then about it please bug me off-list.
ok, thanks, and I should be active around that time (I'm off next week).
>> Probably everything has been said about it in the comments about the
>> pros and cons.
> It sounds like there's some disagreement if it's enough of a win for its 
> complexity, which I'll try and weigh when I get to it. Looks like a long 
> conversation to read...

and I'd certainly be partial if I tried to summarize it :-) Anyway, I'll
be happy to provide more clarifications when you look at it.

>> It needs rebasing and conversion to the 2018 edition to go in, but that
>> would take me one hour at most.
Raphaël took care of that, for the record.
>>
>> Regards,
>>
>>
>> -- 
>> Georges Racinet
>> https://octobus.net
>> GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics
>>
>>
>> ___
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


-- 
Georges Racinet
https://octobus.net
GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics




signature.asc
Description: OpenPGP digital signature
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH evolve-ext] evolve: further clarify that update is performed only when requested

2019-07-18 Thread Pierre-Yves David

I pushed the result, thanks !

On 7/18/19 7:03 PM, Kevin Peng wrote:

I see. Thanks!

On Thu, Jul 18, 2019 at 2:51 AM Anton Shestakov  wrote:


On Wed, 17 Jul 2019 12:06:14 -0700
Kevin Peng via Mercurial-devel 
wrote:


Here is an updated patch:

# HG changeset patch
# User kevp...@google.com
# Date 1560563083 25200
#  Fri Jun 14 18:44:43 2019 -0700
# Node ID 8716e0b2ff1cf09efa79dca6303a83600ee42824
# Parent  8195452be71d446eff972ea128199f943731b7fb
evolve: further clarify when update is performed

diff --git a/hgext3rd/evolve/evolvecmd.py b/hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py
+++ b/hgext3rd/evolve/evolvecmd.py
@@ -1536,9 +1536,9 @@ def evolve(ui, repo, **opts):
  If so, evolve rebases that changeset. If not, evolve refuses to guess your
  intention, and gives a hint about what you might want to do next.

-Any time evolve creates a changeset, it updates the working copy to the new
-changeset. Using ``--update`` will make evolve perform an update after any
-successful evolve operation.
+When ``--update`` is set, a successful evolve operation will update the
+working copy to the newly created changeset. Moreover, an update will
+always be performed if the current working directory parent is obsolete.

  Automatic mode only handles common use cases. For example, it avoids 
taking
  action in the case of ambiguity, and it ignores orphan changesets that are


We already pushed your previous patch after some copy editing, so I
took the liberty of amending this one to apply it cleanly. It can be
seen and reviewed (if you have bitbucket account) at:
https://bitbucket.org/octobus/evolve-devel/commits/d0965c5c5335d14ea0bcb4e0bf336f43ba4fe381

And it looks good to me.


--
Pierre-Yves David
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: An extension to log through standard logging module

2019-07-18 Thread Kyle Lippincott via Mercurial-devel
On Thu, Jul 18, 2019 at 11:16 AM Augie Fackler  wrote:

>
>
> > On Jul 16, 2019, at 13:27, Georges Racinet 
> wrote:
> >
> > Hi there,
> >
> > for the needs of Heptapod [1], I ended up writing a small extension to
> > divert all possible console output to the standard logging module, with
> > the option to send the logs to a Sentry application.
> >
> > The source is at https://dev.heptapod.net/heptapod/hgext-loggingmod and
> > its README provides a fairly complete documentation.
> >
> > I think this extension would be useful in many more general server
> > settings, and should therefore probably be versioned with hg-core. Some
> > polishing would have to be made to bring it up to standard, and I'd be
> > happy to do that if people are interested.
> >
> > A short rationale:
> >
> > - blackbox only registers to `ui.log`, which itself doesn't have much,
> > unless `ui.debug` is True [2]. Also, it insists on outputting the logs
> > into the `.hg` directory, and that's pretty much useless for a multi
> > repo server
> >
> > - logtoprocess also registers to `ui.log`.
> >
> > - I wanted to make it easy to use Sentry, especially since GitLab has an
> > option to send its logs to Sentry by default, unsurprisingly covering
> > everything but Mercurial
> >
> > - I wanted to make it easily configurable, and to provide repository
> > information to use in the format. Together with the PID, that makes it
> > possible to extract only log lines pertaining to a given request.
> >
> > What do you think ?
>
> I think it makes sense. Kyle, I think we might want this for some of our
> hg API servers too? Having it in core seems sensible to me.
>

Having it in core seems fine to me. I can see possible ways we can use it,
yes :)

>
> > Cheers,
> >
> > [1] That is, our modified GitLab CE that supports Mercurial
> >
> > [2] with `ui.debug` set to True, some of that debugging info actually
> > spills into the HTTP responses, making them incorrect.
> >
> >
> > --
> > Georges Racinet
> > https://octobus.net
> > GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics
> >
> >
> > ___
> > Mercurial-devel mailing list
> > Mercurial-devel@mercurial-scm.org
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
>

-- 
--Kyle

Note:
If I've asked a question, and you're responding to me, please use *respond
all*, so that other people can read any solutions we come to!
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6658: py3: fix test-setdiscovery.t on Python 3 by conditionalizing two lines

2019-07-18 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I'm not clear why this behaves very slightly differently on Python 3,
  but I'm also not concerned about it.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6658

AFFECTED FILES
  tests/test-setdiscovery.t

CHANGE DETAILS

diff --git a/tests/test-setdiscovery.t b/tests/test-setdiscovery.t
--- a/tests/test-setdiscovery.t
+++ b/tests/test-setdiscovery.t
@@ -980,10 +980,12 @@
   query 3; still undecided: 980, sample size is: 200
   sampling from both directions
   searching: 4 queries
-  query 4; still undecided: 435, sample size is: 210
+  query 4; still undecided: 435, sample size is: 210 (no-py3 !)
+  query 4; still undecided: 430, sample size is: 210 (py3 !)
   sampling from both directions
   searching: 5 queries
-  query 5; still undecided: 185, sample size is: 185
+  query 5; still undecided: 185, sample size is: 185 (no-py3 !)
+  query 5; still undecided: 187, sample size is: 185 (py3 !)
   5 total queries in *.s (glob)
   elapsed time:  * seconds (glob)
   heads summary:



To: durin42, #hg-reviewers
Cc: mjpieters, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6657: cleanup: remove redundant import

2019-07-18 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  For some reason the import checker only caught this on py3.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6657

AFFECTED FILES
  tests/test-bookmarks-corner-case.t

CHANGE DETAILS

diff --git a/tests/test-bookmarks-corner-case.t 
b/tests/test-bookmarks-corner-case.t
--- a/tests/test-bookmarks-corner-case.t
+++ b/tests/test-bookmarks-corner-case.t
@@ -119,7 +119,6 @@
   > import atexit
   > import os
   > import time
-  > import atexit
   > from mercurial import error, extensions, bookmarks
   > 
   > def wait(repo):



To: durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6655: continue: added support for graft

2019-07-18 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  There is a lot of duplication here. Can you try to extract common parts?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6655/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6655

To: taapas1128, #hg-reviewers
Cc: martinvonz, durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6656: py3: another passing test

2019-07-18 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: pulkit.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6656

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -130,6 +130,7 @@
 test-convert-tagsbranch-topology.t
 test-convert.t
 test-copies-in-changeset.t
+test-copies-unrelated.t
 test-copies.t
 test-copy-move-merge.t
 test-copy.t



To: durin42, pulkit, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: An extension to log through standard logging module

2019-07-18 Thread Augie Fackler


> On Jul 16, 2019, at 13:27, Georges Racinet  
> wrote:
> 
> Hi there,
> 
> for the needs of Heptapod [1], I ended up writing a small extension to
> divert all possible console output to the standard logging module, with
> the option to send the logs to a Sentry application.
> 
> The source is at https://dev.heptapod.net/heptapod/hgext-loggingmod and
> its README provides a fairly complete documentation.
> 
> I think this extension would be useful in many more general server
> settings, and should therefore probably be versioned with hg-core. Some
> polishing would have to be made to bring it up to standard, and I'd be
> happy to do that if people are interested.
> 
> A short rationale:
> 
> - blackbox only registers to `ui.log`, which itself doesn't have much,
> unless `ui.debug` is True [2]. Also, it insists on outputting the logs
> into the `.hg` directory, and that's pretty much useless for a multi
> repo server
> 
> - logtoprocess also registers to `ui.log`.
> 
> - I wanted to make it easy to use Sentry, especially since GitLab has an
> option to send its logs to Sentry by default, unsurprisingly covering
> everything but Mercurial
> 
> - I wanted to make it easily configurable, and to provide repository
> information to use in the format. Together with the PID, that makes it
> possible to extract only log lines pertaining to a given request.
> 
> What do you think ?

I think it makes sense. Kyle, I think we might want this for some of our hg API 
servers too? Having it in core seems sensible to me.

> 
> Cheers,
> 
> [1] That is, our modified GitLab CE that supports Mercurial
> 
> [2] with `ui.debug` set to True, some of that debugging info actually
> spills into the HTTP responses, making them incorrect.
> 
> 
> -- 
> Georges Racinet
> https://octobus.net
> GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics
> 
> 
> ___
> 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: Last call for 5.1 changes

2019-07-18 Thread Augie Fackler


> On Jul 16, 2019, at 14:21, Georges Racinet  
> wrote:
> 
> 
> On 7/16/19 2:58 PM, Augie Fackler wrote:
>> I'll cut the rc later this week, maybe tomorrow, definitely no later than 
>> Friday evening America/New_York. Am I missing anything people are burning to 
>> see in 5.1? Are there any loose ends?
> 
> Well, I would be glad if my series on discovery could make it (the last
> one is D6430).

My week is full enough that I'm going to promise to look at this for you early 
in the 5.2 cycle (probably the last week of July/first week of August). If you 
don't hear from me then about it please bug me off-list.

> Probably everything has been said about it in the comments about the
> pros and cons.

It sounds like there's some disagreement if it's enough of a win for its 
complexity, which I'll try and weigh when I get to it. Looks like a long 
conversation to read...

> 
> It needs rebasing and conversion to the 2018 edition to go in, but that
> would take me one hour at most.
> 
> Regards,
> 
> 
> -- 
> Georges Racinet
> https://octobus.net
> GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics
> 
> 
> ___
> 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


D6440: fix: let fixer tools inherit hg's cwd so they can look at the working copy

2019-07-18 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I still think we should fix the cwd for fixers, but it seems Martin and I 
agree that repo-root is more consistent. Would you be willing to reroll with 
repo-root instead of cwd?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6440/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6440

To: hooper, #hg-reviewers
Cc: martinvonz, durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6655: continue: added support for graft

2019-07-18 Thread taapas1128 (Taapas Agrawal)
Closed by commit rHG0fff3cc9098c: continue: added support for graft (authored 
by taapas1128).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs 
Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6655?vs=15966=15969

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6655/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6655

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/commands.py
  tests/test-graft.t

CHANGE DETAILS

diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -1,4 +1,4 @@
-#testcases abortcommand abortflag
+#testcases abortcommand abortflag continueflag continuecommand
 
   $ cat >> $HGRCPATH < [extdiff]
@@ -13,6 +13,13 @@
   > EOF
 #endif
 
+#if continueflag
+  $ cat >> $HGRCPATH < [alias]
+  > continue = graft --continue
+  > EOF
+#endif
+
 Create a repo with some stuff in it:
 
   $ hg init a
@@ -92,9 +99,11 @@
 
   $ hg -q up -cr tip
   $ hg rm -q e
-  $ hg graft --continue
-  abort: no graft in progress
+  $ hg continue
+  abort: no graft in progress (continueflag !)
+  abort: no operation in progress (no-continueflag !)
   [255]
+
   $ hg revert -r . -q e
 
 Need to specify a rev:
@@ -1697,7 +1706,13 @@
   $ hg resolve -m
   (no more unresolved files)
   continue: hg graft --continue
-  $ hg graft --continue
+
+#if continuecommand
+  $ hg continue --dry-run
+  graft in progress, will be resumed
+#endif
+
+  $ hg continue
   grafting 1:80e6d2c47cfe "added b"
   grafting 2:8be98ac1a569 "added c"
 
@@ -1754,7 +1769,7 @@
   (no more unresolved files)
   continue: hg graft --continue
 
-  $ hg graft --continue
+  $ hg continue
   grafting 1:80e6d2c47cfe "added b"
   grafting 2:8be98ac1a569 "added c"
 
@@ -1803,7 +1818,7 @@
   $ hg resolve -m
   (no more unresolved files)
   continue: hg graft --continue
-  $ hg graft --continue
+  $ hg continue
   grafting 1:80e6d2c47cfe "added b"
   grafting 2:8be98ac1a569 "added c"
 
@@ -1843,7 +1858,7 @@
   (no more unresolved files)
   continue: hg graft --continue
 
-  $ hg graft --continue
+  $ hg continue
   grafting 1:80e6d2c47cfe "added b"
   grafting 2:8be98ac1a569 "added c"
 
@@ -1997,7 +2012,7 @@
 
   $ hg abort
   abort: no interrupted graft to abort (abortflag !)
-  abort: no operation in progress (abortcommand !)
+  abort: no operation in progress (no-abortflag !)
   [255]
 
 when stripping is required
@@ -2273,7 +2288,7 @@
   (no more unresolved files)
   continue: hg graft --continue
 
-  $ hg graft --continue
+  $ hg continue
   grafting 3:09e253b87e17 "A in file a"
   $ hg log -GT "{rev}:{node|short} {desc}\n"
   @  4:2aa9ad1006ff B in file a
@@ -2350,7 +2365,7 @@
   $ hg resolve --mark
   (no more unresolved files)
   continue: hg graft --continue
-  $ hg graft --continue
+  $ hg continue
   grafting 3:09e253b87e17 "A in file a"
   $ hg diff
   diff -r 2aa9ad1006ff a
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2706,6 +2706,7 @@
 statemod.addunfinished(
 'graft', fname='graftstate', clearable=True, stopflag=True,
 continueflag=True, abortfunc=cmdutil.hgabortgraft,
+continuefunc=cmdutil.continuegraft,
 cmdhint=_("use 'hg graft --continue' or 'hg graft --stop' to stop")
 )
 
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -3425,3 +3425,90 @@
 with repo.wlock():
 graftstate = statemod.cmdstate(repo, 'graftstate')
 return abortgraft(ui, repo, graftstate)
+
+def continuegraft(ui, repo):
+"""logic to resume interrupted graft using 'hg continue'"""
+with repo.wlock():
+graftstate = statemod.cmdstate(repo, 'graftstate')
+statedata = readgraftstate(repo, graftstate)
+opts = {}
+cont = True
+if statedata.get('date'):
+opts['date'] = statedata['date']
+if statedata.get('user'):
+opts['user'] = statedata['user']
+if statedata.get('log'):
+opts['log'] = True
+if statedata.get('no_commit'):
+opts['no_commit'] = statedata.get('no_commit')
+nodes = statedata['nodes']
+revs = [repo[node].rev() for node in nodes]
+
+skipped = set()
+for rev in repo.revs('%ld and merge()', revs):
+ui.warn(_('skipping ungraftable merge revision %d\n') % rev)
+skipped.add(rev)
+revs = [r for r in revs if r not in skipped]
+if not revs:
+return -1
+
+for pos, ctx in enumerate(repo.set("%ld", revs)):
+desc = '%d:%s "%s"' % (ctx.rev(), ctx,
+   ctx.description().split('\n', 1)[0])
+names = repo.nodetags(ctx.node()) + repo.nodebookmarks(ctx.node())
+if names:
+desc += ' (%s)' % ' '.join(names)
+

D6654: shelve: modify help text on --interactive

2019-07-18 Thread navaneeth.suresh (Navaneeth Suresh)
Closed by commit rHG9eace8d6d537: shelve: modify help text on --interactive 
(authored by navaneeth.suresh).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs 
Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6654?vs=15965=15968

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6654/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6654

AFFECTED FILES
  mercurial/commands.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
@@ -79,7 +79,7 @@
-n --name NAME   use the given name for the shelved commit
-p --patch   output patches for changes (provide the names of 
the
 shelved changes as positional arguments)
-   -i --interactive interactive mode, only works while creating a 
shelve
+   -i --interactive interactive mode
   --statoutput diffstat-style summary of changes (provide
 the names of the shelved changes as positional
 arguments)
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5360,7 +5360,7 @@
_('output patches for changes (provide the names of the shelved '
  'changes as positional arguments)')),
   ('i', 'interactive', None,
-   _('interactive mode, only works while creating a shelve')),
+   _('interactive mode')),
   ('', 'stat', None,
_('output diffstat-style summary of changes (provide the names of '
  'the shelved changes as positional arguments)')



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


D6653: unshelve: mark unshelve interactive as experimental

2019-07-18 Thread navaneeth.suresh (Navaneeth Suresh)
Closed by commit rHG74ba82abbf29: unshelve: mark unshelve interactive as 
experimental (authored by navaneeth.suresh).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs 
Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6653?vs=15964=15967

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6653/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6653

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6169,7 +6169,7 @@
   ('c', 'continue', None,
_('continue an incomplete unshelve operation')),
   ('i', 'interactive', None,
-   _('use interactive mode')),
+   _('use interactive mode (EXPERIMENTAL)')),
   ('k', 'keep', None,
_('keep shelve after unshelving')),
   ('n', 'name', '',



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


D6655: continue: added support for graft

2019-07-18 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I'm landing this, but in the future I suspect we should make sure we just 
have a mix of `hg graft --continue` and `hg graft` rather than run the whole 
test twice, as it'll severely bloat the already-slow testsuite to do that for 
many tests.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6655/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6655

To: taapas1128, #hg-reviewers
Cc: durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6655: continue: added support for graft

2019-07-18 Thread taapas1128 (Taapas Agrawal)
taapas1128 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This adds support of graft to hg continue plan.
  
  The patch creates a seperate function `cmdutil.continuegraft`
  so that continue logic for graft can be called independently.
  This logic is registered to the statedetection API as `continuefunc`.
  
  Results are shown as tests.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6655

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/commands.py
  tests/test-graft.t

CHANGE DETAILS

diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -1,4 +1,4 @@
-#testcases abortcommand abortflag
+#testcases abortcommand abortflag continueflag continuecommand
 
   $ cat >> $HGRCPATH < [extdiff]
@@ -13,6 +13,13 @@
   > EOF
 #endif
 
+#if continueflag
+  $ cat >> $HGRCPATH < [alias]
+  > continue = graft --continue
+  > EOF
+#endif
+
 Create a repo with some stuff in it:
 
   $ hg init a
@@ -92,9 +99,11 @@
 
   $ hg -q up -cr tip
   $ hg rm -q e
-  $ hg graft --continue
-  abort: no graft in progress
-  [255]
+  $ hg continue
+  abort: no graft in progress (continueflag !)
+  abort: no operation in progress (no-continueflag !)
+  [255]
+
   $ hg revert -r . -q e
 
 Need to specify a rev:
@@ -1697,7 +1706,13 @@
   $ hg resolve -m
   (no more unresolved files)
   continue: hg graft --continue
-  $ hg graft --continue
+
+#if continuecommand
+  $ hg continue --dry-run
+  graft in progress, will be resumed
+#endif
+
+  $ hg continue
   grafting 1:80e6d2c47cfe "added b"
   grafting 2:8be98ac1a569 "added c"
 
@@ -1754,7 +1769,7 @@
   (no more unresolved files)
   continue: hg graft --continue
 
-  $ hg graft --continue
+  $ hg continue
   grafting 1:80e6d2c47cfe "added b"
   grafting 2:8be98ac1a569 "added c"
 
@@ -1803,7 +1818,7 @@
   $ hg resolve -m
   (no more unresolved files)
   continue: hg graft --continue
-  $ hg graft --continue
+  $ hg continue
   grafting 1:80e6d2c47cfe "added b"
   grafting 2:8be98ac1a569 "added c"
 
@@ -1843,7 +1858,7 @@
   (no more unresolved files)
   continue: hg graft --continue
 
-  $ hg graft --continue
+  $ hg continue
   grafting 1:80e6d2c47cfe "added b"
   grafting 2:8be98ac1a569 "added c"
 
@@ -1997,7 +2012,7 @@
 
   $ hg abort
   abort: no interrupted graft to abort (abortflag !)
-  abort: no operation in progress (abortcommand !)
+  abort: no operation in progress (no-abortflag !)
   [255]
 
 when stripping is required
@@ -2273,7 +2288,7 @@
   (no more unresolved files)
   continue: hg graft --continue
 
-  $ hg graft --continue
+  $ hg continue
   grafting 3:09e253b87e17 "A in file a"
   $ hg log -GT "{rev}:{node|short} {desc}\n"
   @  4:2aa9ad1006ff B in file a
@@ -2350,7 +2365,7 @@
   $ hg resolve --mark
   (no more unresolved files)
   continue: hg graft --continue
-  $ hg graft --continue
+  $ hg continue
   grafting 3:09e253b87e17 "A in file a"
   $ hg diff
   diff -r 2aa9ad1006ff a
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2706,6 +2706,7 @@
 statemod.addunfinished(
 'graft', fname='graftstate', clearable=True, stopflag=True,
 continueflag=True, abortfunc=cmdutil.hgabortgraft,
+continuefunc=cmdutil.continuegraft,
 cmdhint=_("use 'hg graft --continue' or 'hg graft --stop' to stop")
 )
 
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -3425,3 +3425,90 @@
 with repo.wlock():
 graftstate = statemod.cmdstate(repo, 'graftstate')
 return abortgraft(ui, repo, graftstate)
+
+def continuegraft(ui, repo):
+"""logic to resume interrupted graft using 'hg continue'"""
+with repo.wlock():
+graftstate = statemod.cmdstate(repo, 'graftstate')
+statedata = readgraftstate(repo, graftstate)
+opts = {}
+cont = True
+if statedata.get('date'):
+opts['date'] = statedata['date']
+if statedata.get('user'):
+opts['user'] = statedata['user']
+if statedata.get('log'):
+opts['log'] = True
+if statedata.get('no_commit'):
+opts['no_commit'] = statedata.get('no_commit')
+nodes = statedata['nodes']
+revs = [repo[node].rev() for node in nodes]
+
+skipped = set()
+for rev in repo.revs('%ld and merge()', revs):
+ui.warn(_('skipping ungraftable merge revision %d\n') % rev)
+skipped.add(rev)
+revs = [r for r in revs if r not in skipped]
+if not revs:
+return -1
+
+for pos, ctx in enumerate(repo.set("%ld", revs)):
+desc = '%d:%s "%s"' % (ctx.rev(), ctx,
+   ctx.description().split('\n', 1)[0])
+names = repo.nodetags(ctx.node()) + repo.nodebookmarks(ctx.node())
+if names:
+desc += ' (%s)' % ' 

[Bug 6173] New: Allow `share` to specify sparse profiles and a revision to checkout.

2019-07-18 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6173

Bug ID: 6173
   Summary: Allow `share` to specify sparse profiles and a
revision to checkout.
   Product: Mercurial
   Version: unspecified
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: share
  Assignee: bugzi...@mercurial-scm.org
  Reporter: mozi...@hocat.ca
CC: mercurial-devel@mercurial-scm.org

I often use `hg share` when I need to check out very divergent branch in a
large repo[1]. I usually only need to touch a handful of files, so it would
nice if I could specify those files in the share command and avoid checking out
the entire repository first.

[1] https://hg.mozilla.org/mozilla-central

-- 
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


D6596: unshelve: add interactive mode

2019-07-18 Thread pulkit (Pulkit Goyal)
pulkit added inline comments.

INLINE COMMENTS

> navaneeth.suresh wrote in test-shelve.t:1354
> We only pass `-i` if we want to do the unshelve interactively again. It's not 
> mandatory to do that. After an interactive shelve, the stored remaining 
> shelve is same as a normal shelve. We can unshelve it without the `-i`. So, I 
> don't think we have to do that.

Looking at the test case:

User wants to interactively unshelve, runs `hg unshelve -i`. They hit 
conflicts, resolve conflicts, and then run `hg unshelve --continue`.

Here, user intended to do an interactive unshelve, and having conflicts should 
not change what user wanted. Also this is similar to other commands. We 
preserve the flags which user passed and follow them when the operation is 
continued.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6596/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6596

To: navaneeth.suresh, #hg-reviewers
Cc: pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH evolve-ext] evolve: further clarify that update is performed only when requested

2019-07-18 Thread Kevin Peng via Mercurial-devel
I see. Thanks!

On Thu, Jul 18, 2019 at 2:51 AM Anton Shestakov  wrote:
>
> On Wed, 17 Jul 2019 12:06:14 -0700
> Kevin Peng via Mercurial-devel 
> wrote:
>
> > Here is an updated patch:
> >
> > # HG changeset patch
> > # User kevp...@google.com
> > # Date 1560563083 25200
> > #  Fri Jun 14 18:44:43 2019 -0700
> > # Node ID 8716e0b2ff1cf09efa79dca6303a83600ee42824
> > # Parent  8195452be71d446eff972ea128199f943731b7fb
> > evolve: further clarify when update is performed
> >
> > diff --git a/hgext3rd/evolve/evolvecmd.py b/hgext3rd/evolve/evolvecmd.py
> > --- a/hgext3rd/evolve/evolvecmd.py
> > +++ b/hgext3rd/evolve/evolvecmd.py
> > @@ -1536,9 +1536,9 @@ def evolve(ui, repo, **opts):
> >  If so, evolve rebases that changeset. If not, evolve refuses to guess 
> > your
> >  intention, and gives a hint about what you might want to do next.
> >
> > -Any time evolve creates a changeset, it updates the working copy to 
> > the new
> > -changeset. Using ``--update`` will make evolve perform an update after 
> > any
> > -successful evolve operation.
> > +When ``--update`` is set, a successful evolve operation will update the
> > +working copy to the newly created changeset. Moreover, an update will
> > +always be performed if the current working directory parent is 
> > obsolete.
> >
> >  Automatic mode only handles common use cases. For example, it avoids 
> > taking
> >  action in the case of ambiguity, and it ignores orphan changesets that 
> > are
>
> We already pushed your previous patch after some copy editing, so I
> took the liberty of amending this one to apply it cleanly. It can be
> seen and reviewed (if you have bitbucket account) at:
> https://bitbucket.org/octobus/evolve-devel/commits/d0965c5c5335d14ea0bcb4e0bf336f43ba4fe381
>
> And it looks good to me.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6654: shelve: modify help text on --interactive

2019-07-18 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We now have `unshelve --interactive` after rHG5162753c4c14 
.
  So, the help text on `shelve --interactive` suggesting that it
  only works for `shelve` can be removed.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6654

AFFECTED FILES
  mercurial/commands.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
@@ -79,7 +79,7 @@
-n --name NAME   use the given name for the shelved commit
-p --patch   output patches for changes (provide the names of 
the
 shelved changes as positional arguments)
-   -i --interactive interactive mode, only works while creating a 
shelve
+   -i --interactive interactive mode
   --statoutput diffstat-style summary of changes (provide
 the names of the shelved changes as positional
 arguments)
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5334,7 +5334,7 @@
_('output patches for changes (provide the names of the shelved '
  'changes as positional arguments)')),
   ('i', 'interactive', None,
-   _('interactive mode, only works while creating a shelve')),
+   _('interactive mode')),
   ('', 'stat', None,
_('output diffstat-style summary of changes (provide the names of '
  'the shelved changes as positional arguments)')



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


D6653: unshelve: mark unshelve interactive as experimental

2019-07-18 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We have the logic for interactive unshelve under `_rebaserestorecommit()`.
  So, we might get conflicts even if there are conflicting changes other than
  selected changes by the user.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6653

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6143,7 +6143,7 @@
   ('c', 'continue', None,
_('continue an incomplete unshelve operation')),
   ('i', 'interactive', None,
-   _('use interactive mode')),
+   _('use interactive mode (EXPERIMENTAL)')),
   ('k', 'keep', None,
_('keep shelve after unshelving')),
   ('n', 'name', '',



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


D6596: unshelve: add interactive mode

2019-07-18 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh added inline comments.

INLINE COMMENTS

> pulkit wrote in commands.py:6172
> Can you mark this as `EXPERIMENTAL` because right now we rebases the whole 
> commit, which leads to conflicts in files which the user might not want to 
> unshelve.

Doing that right away! Will solve this issue later.

> pulkit wrote in test-shelve.t:1354
> We should store information about `--interacive` in shelve state, which will 
> help us to prevent passing `-i` here again.

We only pass `-i` if we want to do the unshelve interactively again. It's not 
mandatory to do that. After an interactive shelve, the stored remaining shelve 
is same as a normal shelve. We can unshelve it without the `-i`. So, I don't 
think we have to do that.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6596/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6596

To: navaneeth.suresh, #hg-reviewers
Cc: pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@42611: 3 new changesets

2019-07-18 Thread Mercurial Commits
3 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/326fdce22fb2
changeset:   42609:326fdce22fb2
user:Raphaël Gomès 
date:Tue Jul 02 17:15:03 2019 +0200
summary: rust: switch hg-core and hg-cpython to rust 2018 edition

https://www.mercurial-scm.org/repo/hg/rev/5672bb73f61e
changeset:   42610:5672bb73f61e
user:Raphaël Gomès 
date:Wed Jul 10 17:41:07 2019 +0200
summary: rust-utils: add docstrings and doctests for utils.rs

https://www.mercurial-scm.org/repo/hg/rev/2f760da140ee
changeset:   42611:2f760da140ee
bookmark:@
tag: tip
user:Raphaël Gomès 
date:Wed Jul 17 18:15:51 2019 +0200
summary: rust-utils: remove buggy assertion

-- 
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


D6651: rust-utils: remove buggy assertion

2019-07-18 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   While this assertion had good intentions, it broke existing behavior with 
a
  >   nasty panic.
  
  So the hgignore parser doesn't handle `\#` correctly?
  
  
https://www.mercurial-scm.org/repo/hg-committed/file/5672bb73f61e/rust/hg-core/src/filepatterns.rs#l251

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6651/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6651

To: Alphare, #hg-reviewers
Cc: yuja, durin42, kevincox, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D6651: rust-utils: remove buggy assertion

2019-07-18 Thread Yuya Nishihara
>   While this assertion had good intentions, it broke existing behavior with a
>   nasty panic.

So the hgignore parser doesn't handle `\#` correctly?

https://www.mercurial-scm.org/repo/hg-committed/file/5672bb73f61e/rust/hg-core/src/filepatterns.rs#l251
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition

2019-07-18 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   I fixed the renames. The amended changeset is available at, 
bitbucket.org/octobus/mercurial-devel, rev 
d4bbf54624e14ac2913d452a8a7cb32823227c16. If you want me to send you the patch 
some other way, please tell me.
  
  Pushed as 326fdce22fb2 
, 
thanks.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6597/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6597

To: Alphare, #hg-reviewers, kevincox
Cc: yuja, pulkit, durin42, kevincox, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition

2019-07-18 Thread Yuya Nishihara
>   I fixed the renames. The amended changeset is available at, 
> bitbucket.org/octobus/mercurial-devel, rev 
> d4bbf54624e14ac2913d452a8a7cb32823227c16. If you want me to send you the 
> patch some other way, please tell me.

Pushed as 326fdce22fb2, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6612: tests: show the files fields of changelogs for many merges

2019-07-18 Thread valentin.gatienbaron (Valentin Gatien-Baron)
valentin.gatienbaron added a comment.


  Thanks! I didn't expect this would make it for 5.1.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6612/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6612

To: valentin.gatienbaron, #hg-reviewers, durin42
Cc: durin42, martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH evolve-ext] evolve: further clarify that update is performed only when requested

2019-07-18 Thread Anton Shestakov
On Wed, 17 Jul 2019 12:06:14 -0700
Kevin Peng via Mercurial-devel 
wrote:

> Here is an updated patch:
> 
> # HG changeset patch
> # User kevp...@google.com
> # Date 1560563083 25200
> #  Fri Jun 14 18:44:43 2019 -0700
> # Node ID 8716e0b2ff1cf09efa79dca6303a83600ee42824
> # Parent  8195452be71d446eff972ea128199f943731b7fb
> evolve: further clarify when update is performed
> 
> diff --git a/hgext3rd/evolve/evolvecmd.py b/hgext3rd/evolve/evolvecmd.py
> --- a/hgext3rd/evolve/evolvecmd.py
> +++ b/hgext3rd/evolve/evolvecmd.py
> @@ -1536,9 +1536,9 @@ def evolve(ui, repo, **opts):
>  If so, evolve rebases that changeset. If not, evolve refuses to guess 
> your
>  intention, and gives a hint about what you might want to do next.
> 
> -Any time evolve creates a changeset, it updates the working copy to the 
> new
> -changeset. Using ``--update`` will make evolve perform an update after 
> any
> -successful evolve operation.
> +When ``--update`` is set, a successful evolve operation will update the
> +working copy to the newly created changeset. Moreover, an update will
> +always be performed if the current working directory parent is obsolete.
> 
>  Automatic mode only handles common use cases. For example, it avoids 
> taking
>  action in the case of ambiguity, and it ignores orphan changesets that 
> are

We already pushed your previous patch after some copy editing, so I
took the liberty of amending this one to apply it cleanly. It can be
seen and reviewed (if you have bitbucket account) at:
https://bitbucket.org/octobus/evolve-devel/commits/d0965c5c5335d14ea0bcb4e0bf336f43ba4fe381

And it looks good to me.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6597: rust-2018: switch hg-core and hg-cpython to rust 2018 edition

2019-07-18 Thread Raphaël Gomès
Alphare added a comment.


  In D6597#97348 , @yuja wrote:
  
  >> diff --git a/rust/hg-core/src/utils/mod.rs b/rust/hg-core/src/utils/mod.rs
  >> deleted file mode 100644
  >
  > Can you rename these instead of adding new files? Last time I fixed that
  > manually, and I don't wanna do that again.
  
  I fixed the renames. The amended changeset is available at, 
bitbucket.org/octobus/mercurial-devel, rev 
d4bbf54624e14ac2913d452a8a7cb32823227c16. If you want me to send you the patch 
some other way, please tell me.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6597/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6597

To: Alphare, #hg-reviewers, kevincox
Cc: yuja, pulkit, durin42, kevincox, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel