D6693: fix: ignore fixer tool configurations that are missing patterns

2019-07-25 Thread hooper (Danny Hooper)
hooper added inline comments.

INLINE COMMENTS

> martinvonz wrote in fix.py:738-739
> Is this change needed given the change above?

It makes this function more robust. It might be called by someone who actually 
tries to use a Fixer with no pattern.

> martinvonz wrote in test-fix.t:1280
> nit: The `--debug` seems unnecessary, unless we want to make sure that we 
> *don't* get any output.

Yes, it will show a "subprocess: " line if we go ahead and use the fixer. 
The file also exists to make it possible to observe that kind of regression.

Keep in mind the fix command has no output until you set up hooks or something.

REPOSITORY
  rHG Mercurial

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

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

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


mercurial@42649: 5 new changesets (5 on stable)

2019-07-25 Thread Mercurial Commits
5 new changesets (5 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/8c5a36805d5d
changeset:   42645:8c5a36805d5d
branch:  stable
user:Martin von Zweigbergk 
date:Mon Jul 22 17:44:19 2019 -0700
summary: copies: fix crash on in changeset-centric tracing from commit to 
itself

https://www.mercurial-scm.org/repo/hg/rev/92a99822e731
changeset:   42646:92a99822e731
branch:  stable
user:Gregory Szorc 
date:Mon Jul 22 18:52:58 2019 -0700
summary: automation: use newer Windows base image

https://www.mercurial-scm.org/repo/hg/rev/8804aa6c07a0
changeset:   42647:8804aa6c07a0
branch:  stable
user:Gregory Szorc 
date:Mon Jul 22 18:55:52 2019 -0700
summary: automation: extract strings to constants

https://www.mercurial-scm.org/repo/hg/rev/d80edcb0b30c
changeset:   42648:d80edcb0b30c
branch:  stable
user:Gregory Szorc 
date:Mon Jul 22 19:06:20 2019 -0700
summary: automation: make Windows base image name configurable

https://www.mercurial-scm.org/repo/hg/rev/7fae3b0bd893
changeset:   42649:7fae3b0bd893
branch:  stable
bookmark:@
tag: tip
user:Gregory Szorc 
date:Mon Jul 22 19:10:59 2019 -0700
summary: contrib: install Python 3.8b2 instead of 3.8a2

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


D6670: relnotes: empty to prepare for next release

2019-07-25 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.
martinvonz added a subscriber: durin42.


  In D6670#97968 , @yuja wrote:
  
  > Might be better to rename next to 5.1, and recreate new next file.
  > The old next file in stable branch could theoretically be edited and
  > merged back to default.
  
  Yeah, that was what I had originally planned. @durin42  didn't like the idea 
of keeping the old versions around (because that's version control's job), but 
thanks for the reminder about merging (which I had considered months ago and 
then forgotten). @durin42, is that argument enough to convince you? I'll drop 
this patch from the repo for now so it's not blocking.

REPOSITORY
  rHG Mercurial

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

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

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


D6670: relnotes: empty to prepare for next release

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


  Might be better to rename next to 5.1, and recreate new next file.
  The old next file in stable branch could theoretically be edited and
  merged back to default.

REPOSITORY
  rHG Mercurial

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

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

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


Re: D6670: relnotes: empty to prepare for next release

2019-07-25 Thread Yuya Nishihara
Might be better to rename next to 5.1, and recreate new next file.
The old next file in stable branch could theoretically be edited and
merged back to default.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6695: transplant: added support for --abort flag

2019-07-25 Thread taapas1128 (Taapas Agrawal)
taapas1128 created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This adds fuctionality for `--abort` flag to `transplant`.
  A new method `abort` is added to `transplanter` class
  containing logic to abort transplant.
  
  Tests are updated as shown.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/transplant.py
  tests/test-transplant.t

CHANGE DETAILS

diff --git a/tests/test-transplant.t b/tests/test-transplant.t
--- a/tests/test-transplant.t
+++ b/tests/test-transplant.t
@@ -2,6 +2,7 @@
   $ cat <> $HGRCPATH
   > [extensions]
   > transplant=
+  > graphlog=
   > EOF
 
 #if continueflag
@@ -19,6 +20,9 @@
   $ hg transplant --continue --all
   abort: --continue is incompatible with --branch, --all and --merge
   [255]
+  $ hg transplant --abort --all
+  abort: --abort is incompatible with --branch, --all and --merge
+  [255]
   $ hg transplant --all tip
   abort: --all requires a branch revision
   [255]
@@ -376,7 +380,8 @@
   applying 722f4667af76
   722f4667af76 transplanted to 76e321915884
 
-transplant --continue
+
+transplant --continue and --abort behaviour
 
   $ hg init ../tc
   $ cd ../tc
@@ -416,6 +421,36 @@
   $ echo foobar > foo
   $ hg ci -mfoobar
   created new head
+
+Repo log before transplant
+  $ hg glog
+  @  changeset:   4:e8643552fde5
+  |  tag: tip
+  |  parent:  0:493149fa1541
+  |  user:test
+  |  date:Thu Jan 01 00:00:00 1970 +
+  |  summary: foobar
+  |
+  | o  changeset:   3:1dab759070cf
+  | |  user:test
+  | |  date:Thu Jan 01 00:00:00 1970 +
+  | |  summary: bar2
+  | |
+  | o  changeset:   2:9d6d6b5a8275
+  | |  user:test
+  | |  date:Thu Jan 01 00:00:00 1970 +
+  | |  summary: bar
+  | |
+  | o  changeset:   1:46ae92138f3c
+  |/   user:test
+  |date:Thu Jan 01 00:00:00 1970 +
+  |summary: foo2
+  |
+  o  changeset:   0:493149fa1541
+ user:test
+ date:Thu Jan 01 00:00:00 1970 +
+ summary: foo
+  
   $ hg transplant 1:3
   applying 46ae92138f3c
   patching file foo
@@ -425,6 +460,49 @@
   abort: fix up the working directory and run hg transplant --continue
   [255]
 
+  $ hg transplant --abort
+  transplant aborted
+  working directory is now at e8643552fde5
+Repo log after abort
+  $ hg glog
+  @  changeset:   4:e8643552fde5
+  |  tag: tip
+  |  parent:  0:493149fa1541
+  |  user:test
+  |  date:Thu Jan 01 00:00:00 1970 +
+  |  summary: foobar
+  |
+  | o  changeset:   3:1dab759070cf
+  | |  user:test
+  | |  date:Thu Jan 01 00:00:00 1970 +
+  | |  summary: bar2
+  | |
+  | o  changeset:   2:9d6d6b5a8275
+  | |  user:test
+  | |  date:Thu Jan 01 00:00:00 1970 +
+  | |  summary: bar
+  | |
+  | o  changeset:   1:46ae92138f3c
+  |/   user:test
+  |date:Thu Jan 01 00:00:00 1970 +
+  |summary: foo2
+  |
+  o  changeset:   0:493149fa1541
+ user:test
+ date:Thu Jan 01 00:00:00 1970 +
+ summary: foo
+  
+  $ hg transplant 1:3
+  applying 46ae92138f3c
+  file added already exists
+  1 out of 1 hunks FAILED -- saving rejects to file added.rej
+  patching file foo
+  Hunk #1 FAILED at 0
+  1 out of 1 hunks FAILED -- saving rejects to file foo.rej
+  patch failed to apply
+  abort: fix up the working directory and run hg transplant --continue
+  [255]
+
 transplant -c shouldn't use an old changeset
 
   $ hg up -C
@@ -436,6 +514,9 @@
   abort: no transplant to continue (continueflag !)
   abort: no operation in progress (no-continueflag !)
   [255]
+  $ hg transplant --abort
+  abort: no transplant to abort
+  [255]
   $ hg transplant 1
   applying 46ae92138f3c
   patching file foo
@@ -493,6 +574,7 @@
   [255]
   $ hg status -v
   A bar
+  ? added.rej
   ? baz.rej
   ? foo.rej
   # The repository is in an unfinished *transplant* state.
@@ -505,7 +587,6 @@
   9d6d6b5a8275 transplanted as d80c49962290
   applying 1dab759070cf
   1dab759070cf transplanted to aa0ffe6bd5ae
-
   $ cd ..
 
 Issue: Test transplant --merge
diff --git a/hgext/transplant.py b/hgext/transplant.py
--- a/hgext/transplant.py
+++ b/hgext/transplant.py
@@ -119,6 +119,7 @@
 class transplanter(object):
 def __init__(self, ui, repo, opts):
 self.ui = ui
+self.repo = repo
 self.path = repo.vfs.join('transplant')
 self.opener = vfsmod.vfs(self.path)
 self.transplants = transplants(self.path, 'transplants',
@@ -412,6 +413,23 @@
 # this is kept only to reduce changes in a patch.
 pass
 
+def clear(self):
+"""clear the state file if it exists"""
+util.unlinkpath(self.repo.vfs.join('transplant/journal'),
+ ignoremissing=True)
+
+def abort(self, ui ,repo):
+

[Bug 6177] New: [5.1rc0] ImportError: No module named concurrent. Worked fine with 5.0.

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

Bug ID: 6177
   Summary: [5.1rc0] ImportError: No module named concurrent.
Worked fine with 5.0.
   Product: Mercurial
   Version: 5.1rc0
  Hardware: PC
OS: Other
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: i...@juanfra.info
CC: mercurial-devel@mercurial-scm.org

I'm trying to clone a repo with the python2 version of mercurial 5.1rc0. Fails
with the error "ImportError: No module named concurrent". 5.0 worked without
the extra module installed.

I've https://pypi.org/project/futures/ installed. I've included a couple of
import lines with python2 as example.


current-amd64$ python2 -c 'import concurrent.futures'
current-amd64$ python2 -c 'from concurrent import futures'
current-amd64$ hg clone https://www.mercurial-scm.org/repo/hg
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 43, in 
dispatch.run()
  File
"/usr/local/lib/python2.7/site-packages/hgdemandimport/demandimportpy2.py",
line 150, in __getattr__
self._load()
  File
"/usr/local/lib/python2.7/site-packages/hgdemandimport/demandimportpy2.py",
line 94, in _load
_origimport, head, globals, locals, None, level)
  File
"/usr/local/lib/python2.7/site-packages/hgdemandimport/demandimportpy2.py",
line 43, in _hgextimport
return importfunc(name, globals, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 22,
in 
from .i18n import _
  File
"/usr/local/lib/python2.7/site-packages/hgdemandimport/demandimportpy2.py",
line 248, in _demandimport
level=level)
  File
"/usr/local/lib/python2.7/site-packages/hgdemandimport/demandimportpy2.py",
line 43, in _hgextimport
return importfunc(name, globals, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial/i18n.py", line 24, in

module = pycompat.fsencode(__file__)
  File
"/usr/local/lib/python2.7/site-packages/hgdemandimport/demandimportpy2.py",
line 150, in __getattr__
self._load()
  File
"/usr/local/lib/python2.7/site-packages/hgdemandimport/demandimportpy2.py",
line 94, in _load
_origimport, head, globals, locals, None, level)
  File
"/usr/local/lib/python2.7/site-packages/hgdemandimport/demandimportpy2.py",
line 43, in _hgextimport
return importfunc(name, globals, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial/pycompat.py", line 31,
in 
from .thirdparty.concurrent import futures
  File
"/usr/local/lib/python2.7/site-packages/hgdemandimport/demandimportpy2.py",
line 248, in _demandimport
level=level)
  File
"/usr/local/lib/python2.7/site-packages/hgdemandimport/demandimportpy2.py",
line 43, in _hgextimport
return importfunc(name, globals, *args, **kwargs)
ImportError: No module named concurrent

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


D6686: unshelve: handle stripping changesets on interactive mode

2019-07-25 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh added a comment.


  I just found that this change is not required while creating D6694 
. We will be needing the nodes which we 
are removing for later in case of a partial unshelve.
  The stripbased approach of unshelve failed on the change in D6694 
 on having this change. Should I abandon 
this?

REPOSITORY
  rHG Mercurial

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

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

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


D6694: unshelve: fix bug on a partial unshelve with --continue

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

REVISION SUMMARY
  `unshelve --continue` after a partial unshelve was not working
  before. This patch makes that to work.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/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
@@ -1355,7 +1355,7 @@
   > y
   > y
   > y
-  > y
+  > n
   > EOF
   diff --git a/bar1 b/bar1
   1 hunks, 1 lines changed
@@ -1379,6 +1379,23 @@
   +B
C
   record change 2/2 to 'bar2'?
+  (enter ? for help) [Ynesfdaq?] n
+  
+  unshelve of 'default-01' complete
+  $ hg unshelve --continue < y
+  > y
+  > EOF
+  diff --git a/bar1 b/bar1
+  1 hunks, 1 lines changed
+  examine changes to 'bar1'?
+  (enter ? for help) [Ynesfdaq?] y
+  
+  @@ -1,2 +1,3 @@
+   A
+  +B
+   C
+  record this change to 'bar1'?
   (enter ? for help) [Ynesfdaq?] y
   
   unshelve of 'default-01' complete
diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -753,6 +753,15 @@
 topic='shelve')
 shelvedstate.clear(repo)
 unshelvecleanup(ui, repo, state.name, opts)
+else:
+# This is tricky. The function call might seems to be not useful.
+# But, we do update state.parents here. Otherwise, checkparents()
+# will fail.
+shelvedstate.save(repo, basename, shelvectx.p1(),
+  state.pendingctx, state.nodestoremove,
+  state.branchtorestore, state.keep,
+  state.activebookmark,
+  interactive)
 _restoreactivebookmark(repo, state.activebookmark)
 ui.status(_("unshelve of '%s' complete\n") % state.name)
 
@@ -812,6 +821,12 @@
 bool to know whether the shelve is partly done or completely done.
 """
 opts['message'] = shelvectx.description()
+if not opts['message']:
+# On doing a parial unshelve with --continue interactive, the commit
+# description is empty. To avoid aborting on that, we set a commit
+# message.
+opts['message'] = ('changes to: %s' %
+   shelvectx.p1().description().split('\n', 1)[0])
 opts['interactive-unshelve'] = True
 pats = []
 if not interactive:



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


D6693: fix: ignore fixer tool configurations that are missing patterns

2019-07-25 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> fix.py:738-739
>  """Should this fixer run on the file at the given path and 
> context?"""
> -return scmutil.match(fixctx, [self._pattern], opts)(path)
> +return (self._pattern is not None and
> +scmutil.match(fixctx, [self._pattern], opts)(path))
>  

Is this change needed given the change above?

> test-fix.t:1280
> +  $ hg add -q
> +  $ hg fix --debug --working-dir --config "fix.nopattern:command=echo fixed"
> +  fixer tool has no pattern configuration: nopattern

nit: The `--debug` seems unnecessary, unless we want to make sure that we 
*don't* get any output.

REPOSITORY
  rHG Mercurial

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

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

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


D6686: unshelve: handle stripping changesets on interactive mode

2019-07-25 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh updated this revision to Diff 16065.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6686?vs=16040=16065

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

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

AFFECTED FILES
  mercurial/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
@@ -1351,11 +1351,33 @@
   A
   B
   C
+
+#if stripbased
+  $ hg log -r 3:: -G
+  @  changeset:   5:506510493902
+  |  tag: tip
+  |  parent:  3:adfeba9a1ac4
+  |  user:shelve@localhost
+  |  date:Thu Jan 01 00:00:00 1970 +
+  |  summary: changes to: add A to bars
+  |
+  | @  changeset:   4:8b023952e29c
+  |/   user:test
+  |date:Thu Jan 01 00:00:00 1970 +
+  |summary: add C to bars
+  |
+  o  changeset:   3:adfeba9a1ac4
+  |  user:test
+  ~  date:Thu Jan 01 00:00:00 1970 +
+ summary: add A to bars
+  
+#endif
+
   $ hg unshelve --continue < y
   > y
   > y
-  > y
+  > n
   > EOF
   diff --git a/bar1 b/bar1
   1 hunks, 1 lines changed
@@ -1379,6 +1401,21 @@
   +B
C
   record change 2/2 to 'bar2'?
-  (enter ? for help) [Ynesfdaq?] y
+  (enter ? for help) [Ynesfdaq?] n
   
   unshelve of 'default-01' complete
+
+#if stripbased
+  $ hg log -r 3:: -G
+  @  changeset:   4:8b023952e29c
+  |  tag: tip
+  |  user:test
+  |  date:Thu Jan 01 00:00:00 1970 +
+  |  summary: add C to bars
+  |
+  o  changeset:   3:adfeba9a1ac4
+  |  user:test
+  ~  date:Thu Jan 01 00:00:00 1970 +
+ summary: add A to bars
+  
+#endif
diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -747,10 +747,10 @@
 mergefiles(ui, repo, state.wctx, shelvectx)
 restorebranch(ui, repo, state.branchtorestore)
 
+if not phases.supportinternal(repo):
+repair.strip(ui, repo, state.nodestoremove, backup=False,
+ topic='shelve')
 if not ispartialunshelve:
-if not phases.supportinternal(repo):
-repair.strip(ui, repo, state.nodestoremove, backup=False,
-topic='shelve')
 shelvedstate.clear(repo)
 unshelvecleanup(ui, repo, state.name, opts)
 _restoreactivebookmark(repo, state.activebookmark)



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


[PATCH STABLE] curses: do not setlocale() at import time (issue5261)

2019-07-25 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1564057709 -32400
#  Thu Jul 25 21:28:29 2019 +0900
# Branch stable
# Node ID 315e0c8b8e63addcbfebedfa4e832cf265cca203
# Parent  7fae3b0bd893b75e0fb65ad3032b7532089e2341
curses: do not setlocale() at import time (issue5261)

setlocale() can break date formatting/parsing functions because they are
locale dependent. We should avoid doing setlocale() as possible.

This patch moves setlocale() just before curses.wrapper(), which function
is documented to "initialize curses." I don't know the details about the
curses initialization, but I *think* this would work as well.

Maybe we can extract a curses setup function later.

https://www.mercurial-scm.org/pipermail/mercurial-devel/2019-February/128788.html

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -201,6 +201,7 @@ except ImportError:
 termios = None
 
 import functools
+import locale
 import os
 import struct
 
@@ -947,12 +948,6 @@ def findoutgoing(ui, repo, remote=None, 
 # Curses Support
 try:
 import curses
-
-# Curses requires setting the locale or it will default to the C
-# locale. This sets the locale to the user's default system
-# locale.
-import locale
-locale.setlocale(locale.LC_ALL, r'')
 except ImportError:
 curses = None
 
@@ -1538,6 +1533,10 @@ def _chistedit(ui, repo, *freeargs, **op
 ctxs = []
 for i, r in enumerate(revs):
 ctxs.append(histeditrule(repo[r], i))
+# Curses requires setting the locale or it will default to the C
+# locale. This sets the locale to the user's default system
+# locale.
+locale.setlocale(locale.LC_ALL, r'')
 rc = curses.wrapper(functools.partial(_chisteditmain, repo, ctxs))
 curses.echo()
 curses.endwin()
@@ -2323,4 +2322,3 @@ def extsetup(ui):
 cmdutil.summaryhooks.add('histedit', summaryhook)
 statemod.addunfinished('histedit', fname='histedit-state', 
allowcommit=True,
 continueflag=True, abortfunc=hgaborthistedit)
-
diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -29,10 +29,6 @@ from .utils import (
 )
 stringio = util.stringio
 
-# This is required for ncurses to display non-ASCII characters in default user
-# locale encoding correctly.  --immerrr
-locale.setlocale(locale.LC_ALL, r'')
-
 # patch comments based on the git one
 diffhelptext = _("""# To remove '-' lines, make them ' ' lines (context).
 # To remove '+' lines, delete them.
@@ -530,6 +526,9 @@ def chunkselector(ui, headerlist, operat
 """
 ui.write(_('starting interactive selection\n'))
 chunkselector = curseschunkselector(headerlist, ui, operation)
+# This is required for ncurses to display non-ASCII characters in
+# default user locale encoding correctly.  --immerrr
+locale.setlocale(locale.LC_ALL, r'')
 origsigtstp = sentinel = object()
 if util.safehasattr(signal, 'SIGTSTP'):
 origsigtstp = signal.getsignal(signal.SIGTSTP)
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6684: unshelve: modify --continue on interactive unshelve

2019-07-25 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh added a comment.


  In D6684#97930 , @pulkit wrote:
  
  > Sorry for getting this and the parent patch split before, after the recent 
improvements, it looks like they should be folded into one.
  
  Cool. Changes from this patch is folded to affect in D6679 
. Abandoning this.

REPOSITORY
  rHG Mercurial

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

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

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


D6679: unshelve: store information about interactive mode in shelvedstate

2019-07-25 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh updated this revision to Diff 16064.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6679?vs=16057=16064

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

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

AFFECTED FILES
  mercurial/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
@@ -1351,13 +1351,12 @@
   A
   B
   C
-  $ hg unshelve --continue -i < y
   > y
   > y
   > y
   > EOF
-  unshelving change 'default-01'
   diff --git a/bar1 b/bar1
   1 hunks, 1 lines changed
   examine changes to 'bar1'?
diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -177,6 +177,7 @@
 _nokeep = 'nokeep'
 # colon is essential to differentiate from a real bookmark name
 _noactivebook = ':no-active-bookmark'
+_interactive = 'interactive'
 
 @classmethod
 def _verifyandtransform(cls, d):
@@ -247,6 +248,7 @@
 obj.activebookmark = ''
 if d.get('activebook', '') != cls._noactivebook:
 obj.activebookmark = d.get('activebook', '')
+obj.interactive = d.get('interactive') == cls._interactive
 except (error.RepoLookupError, KeyError) as err:
 raise error.CorruptedState(pycompat.bytestr(err))
 
@@ -254,7 +256,7 @@
 
 @classmethod
 def save(cls, repo, name, originalwctx, pendingctx, nodestoremove,
- branchtorestore, keep=False, activebook=''):
+ branchtorestore, keep=False, activebook='', interactive=False):
 info = {
 "name": name,
 "originalwctx": nodemod.hex(originalwctx.node()),
@@ -267,6 +269,8 @@
 "keep": cls._keep if keep else cls._nokeep,
 "activebook": activebook or cls._noactivebook
 }
+if interactive:
+info['interactive'] = cls._interactive
 scmutil.simplekeyvaluefile(
 repo.vfs, cls._filename).write(info,
firstline=("%d" % cls._version))
@@ -694,11 +698,12 @@
 if shfile.exists():
 shfile.movetobackup()
 cleanupoldbackups(repo)
-def unshelvecontinue(ui, repo, state, opts, basename=None):
+def unshelvecontinue(ui, repo, state, opts):
 """subcommand to continue an in-progress unshelve"""
 # We're finishing off a merge. First parent is our original
 # parent, second is the temporary "fake" commit we're unshelving.
-interactive = opts.get('interactive')
+interactive = state.interactive
+basename = state.name
 with repo.lock():
 checkparents(repo, state)
 ms = merge.mergestate.read(repo)
@@ -854,7 +859,8 @@
 nodestoremove = [repo.changelog.node(rev)
  for rev in pycompat.xrange(oldtiprev, len(repo))]
 shelvedstate.save(repo, basename, pctx, tmpwctx, nodestoremove,
-  branchtorestore, opts.get('keep'), 
activebookmark)
+  branchtorestore, opts.get('keep'), 
activebookmark,
+  interactive)
 raise error.InterventionRequired(
 _("unresolved conflicts (see 'hg resolve', then "
   "'hg unshelve --continue')"))
@@ -928,7 +934,7 @@
 if opts.get("name"):
 shelved.append(opts["name"])
 
-if abortf or continuef and not interactive:
+if abortf or continuef:
 if abortf and continuef:
 raise error.Abort(_('cannot use both abort and continue'))
 if shelved:
@@ -950,11 +956,8 @@
 raise error.Abort(_('no shelved changes to apply!'))
 basename = util.split(shelved[0][1])[1]
 ui.status(_("unshelving change '%s'\n") % basename)
-elif shelved:
+else:
 basename = shelved[0]
-if continuef and interactive:
-state = _loadshelvedstate(ui, repo, opts)
-return unshelvecontinue(ui, repo, state, opts, basename)
 
 if not shelvedfile(repo, basename, patchextension).exists():
 raise error.Abort(_("shelved change '%s' not found") % basename)



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


D6688: unshelve: make basename as a mandatory argument for unshelvecontinue()

2019-07-25 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh added a comment.
navaneeth.suresh abandoned this revision.


  Abandoning since changes in D6679  will 
make this obsolete.

REPOSITORY
  rHG Mercurial

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

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

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


D6685: unshelve: changes how date is set on interactive mode

2019-07-25 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh updated this revision to Diff 16063.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6685?vs=16059=16063

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

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

AFFECTED FILES
  mercurial/shelve.py

CHANGE DETAILS

diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -827,8 +827,7 @@
**pycompat.strkwargs(opts))
 snode = repo.commit(text=shelvectx.description(),
 extra=shelvectx.extra(),
-user=shelvectx.user(),
-date=shelvectx.date())
+user=shelvectx.user())
 m = scmutil.matchfiles(repo, repo[snode].files())
 if snode:
 _shelvecreatedcommit(repo, snode, basename, m)



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 v2] py3: broad pass for python3 compatibility

2019-07-25 Thread Pierre-Yves David

For those following at home:

* We now have a evolve + py3 build https://ci.octobus.net/job/EvolvePy3/

* Martin's patch that apply most of the py3 compatibility changes have 
been merged (and should be in the next evolve version).


* Raphaƫl is now looking into using format-source + the 
`byteify-strings.py` script to produce the last necessary patch.


There are a couple of reasons why we would like to take that route. 
First, code-formatting is becoming an important topic, we need features 
like format-source to work smoothly. Having more dog fooding in 
repositories closer to core-developer is important. Second, there will 
be more important extensions to convert (eg: hg-git, hg-subversion, 
etc). Investing in making the tooling (both format-source and 
byteify-string) simpler to use should help with their migrations.


On 7/2/19 4:58 PM, Ludovic Chabant wrote:



I'm curious to hear what Ludovic thinks, but I'm doubtful that saves
other contributors more time than it costs for Ludovic, so it's a net
negative.

I assume you know that Python 2's end of life is Jan 1 2020, so this
is getting urgent. I don't know about others, but my team will need to
have Mercurial and extensions on Python 3 by then.


At this point it's not too costly for me to update the patch (although
it's a bit annoying), especially since I'm not even running any tests
yet at this point: I just need a py3 mercurial that doesn't crash when
evolve is enabled, and seems to run ok for pull/push.

However, I would indeed prefer if someone from Octobus was to take it
away from me and deal with it ASAP. It's blocking several new features
for sourcehut, and, indeed, py3 EOL is approaching fast and both Drew
(lead dev on sourcehut) and Alpine (the distro on which sourcehut runs)
have aggressive timelines to completely remove any trace of py2 before
that date.

Plus, if someone from Octobus was to take this, it could also be part of
a broader "kickstart py3 support" task that would include setting up py3
builds on the CI, and other related tasks.

Cheers!



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


D6684: unshelve: modify --continue on interactive unshelve

2019-07-25 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  Sorry for getting this and the parent patch split before, after the recent 
improvements, it looks like they should be folded into one.

REPOSITORY
  rHG Mercurial

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

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

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


D6688: unshelve: make basename as a mandatory argument for unshelvecontinue()

2019-07-25 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  In D6688#97899 , 
@navaneeth.suresh wrote:
  
  > In D6688#97859 , @pulkit wrote:
  >
  >> Can you explain in commit description as why this is done?
  >
  > This patch will become obsolete after D6684 
. Should I abandon this?
  
  Yes.

REPOSITORY
  rHG Mercurial

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

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

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


D6685: unshelve: changes how date is set on interactive mode

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

INLINE COMMENTS

> shelve.py:831
>  user=shelvectx.user(),
> -date=shelvectx.date())
> +date=dateutil.makedate())
>  m = scmutil.matchfiles(repo, repo[snode].files())

We can just skip passing the date and it will automatically use the current 
date.

REPOSITORY
  rHG Mercurial

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

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

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