D7506: phabricator: add a "phabstatus" show view

2019-12-11 Thread dlax (Denis Laxalde)
dlax added a comment.


  In D7506#111947 , @spectral 
wrote:
  
  > I don't think `from . import show` works generally.
  
  I did that because `test-check-module-imports.t` complained otherwise when 
using `from hgext import show`:
  
hgext/phabricator.py:89: import should be relative: hgext
  
  Also, there's already a similar `from . import rebase` in `hgext/split.py` so 
I thought that relative import was fine.
  
  I'm happy to change if there's a solution, though.

REPOSITORY
  rHG Mercurial

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

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

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


D7595: status: outputting structured unfinished-operation information

2019-12-11 Thread rdamazio (Rodrigo Damazio Bovendorp)
rdamazio edited the summary of this revision.
rdamazio marked an inline comment as done.
rdamazio updated this revision to Diff 18625.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7595?vs=18588=18625

BRANCH
  default

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

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

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

CHANGE DETAILS

diff --git a/tests/test-status.t b/tests/test-status.t
--- a/tests/test-status.t
+++ b/tests/test-status.t
@@ -254,35 +254,43 @@
   $ hg status -A -Tjson
   [
{
+"itemtype": "file",
 "path": "added",
 "status": "A"
},
{
+"itemtype": "file",
 "path": "copied",
 "source": "modified",
 "status": "A"
},
{
+"itemtype": "file",
 "path": "removed",
 "status": "R"
},
{
+"itemtype": "file",
 "path": "deleted",
 "status": "!"
},
{
+"itemtype": "file",
 "path": "unknown",
 "status": "?"
},
{
+"itemtype": "file",
 "path": "ignored",
 "status": "I"
},
{
+"itemtype": "file",
 "path": ".hgignore",
 "status": "C"
},
{
+"itemtype": "file",
 "path": "modified",
 "status": "C"
}
@@ -558,6 +566,7 @@
   $ hg status --config ui.formatdebug=True --rev 1 1
   status = [
   {
+  'itemtype': 'file',
   'path': '1/2/3/4/5/b.txt',
   'status': 'R'
   },
diff --git a/tests/test-conflict.t b/tests/test-conflict.t
--- a/tests/test-conflict.t
+++ b/tests/test-conflict.t
@@ -63,13 +63,20 @@
   $ hg status -Tjson
   [
{
+"itemtype": "file",
 "path": "a",
 "status": "M",
 "unresolved": true
},
{
+"itemtype": "file",
 "path": "a.orig",
 "status": "?"
+   },
+   {
+"itemtype": "morestatus",
+"unfinished": "merge",
+"unfinishedmsg": "To continue:hg commit\nTo abort:   hg merge 
--abort"
}
   ]
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6884,7 +6884,7 @@
 for f in files:
 fm.startitem()
 fm.context(ctx=ctx2)
-fm.data(path=f)
+fm.data(itemtype=b'file', path=f)
 fm.condwrite(showchar, b'status', b'%s ', char, label=label)
 fm.plain(fmt % uipathfn(f), label=label)
 if f in copy:
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -793,6 +793,10 @@
 fm.data(unresolved=True)
 
 def formatfooter(self, fm):
+fm.startitem()
+fm.data(itemtype=b'morestatus', unfinished=self.unfinishedop,
+unfinishedmsg=self.unfinishedmsg)
+
 statemsg = _(b'The repository is in an unfinished *%s* state.'
  ) % self.unfinishedop
 fm.plain(b'%s\n' % _commentlines(statemsg), label=self._label)



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


D7608: phabricator: color the status in the "phabstatus" view

2019-12-11 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added subscribers: mercurial-devel, Kwan.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I couldn't figure out strikethrough for "abandoned" like I've see with word
  diff.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -130,6 +130,12 @@
 b'phabricator.desc': b'',
 b'phabricator.drev': b'bold',
 b'phabricator.node': b'',
+b'phabricator.status.abandoned': b'magenta dim',
+b'phabricator.status.accepted': b'green bold',
+b'phabricator.status.closed': b'green',
+b'phabricator.status.needsreview': b'yellow',
+b'phabricator.status.needsrevision': b'red',
+b'phabricator.status.changesplanned': b'red',
 }
 
 _VCR_FLAGS = [
@@ -1728,7 +1734,11 @@
 
 def phabstatus(ctx):
 drev = drevsbyrev[ctx.rev()]
-ui.write(b"\n%(uri)s %(statusName)s\n" % drev)
+status = ui.label(
+b'%(statusName)s' % drev,
+b'phabricator.status.%s' % _getstatusname(drev),
+)
+ui.write(b"\n%s %s\n" % (drev[b'uri'], status))
 
 revs -= smartset.baseset(unknownrevs)
 revdag = graphmod.dagwalker(repo, revs)



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


D7607: phabricator: add the "Changes Planned" status name

2019-12-11 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added subscribers: mercurial-devel, Kwan.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I noticed this when coloring the status output.  But it looks like status 
names
  are also used in the pseudo revset language as well, and abort when parsing a
  name not in this list.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -1268,6 +1268,7 @@
 b'needsrevision',
 b'closed',
 b'abandoned',
+b'changesplanned',
 }
 
 



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


D7506: phabricator: add a "phabstatus" show view

2019-12-11 Thread spectral (Kyle Lippincott)
spectral added a comment.


  I don't think `from . import show` works generally. I received errors because 
I imported phabricator via a path (pointing directly at the .py file, something 
like `[extensions] phabricator = /home/spectral/src/hg/hgext/phabricator.py`), 
not by doing something like `extensions.phabricator=`. I received the following 
errors:
  
$ hg co 70060915c3f2
$ make local
$ ./hg st
*** failed to import extension phabricator from 
/usr/local/google/home/spectral/src/hg/hg/hgext/phabricator.py: Attempted 
relative import in non-package
$ make local PYTHON=python3
$ python3 ./hg st
*** failed to import extension phabricator from 
/usr/local/google/home/spectral/src/hg/hg/hgext/phabricator.py: attempted 
relative import with no known parent package

REPOSITORY
  rHG Mercurial

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

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

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


D7606: fuzz: fix mpatch_corpus to not have an overridden __repr__ on py3

2019-12-11 Thread spectral (Kyle Lippincott)
spectral created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/fuzz/mpatch_corpus.py

CHANGE DETAILS

diff --git a/contrib/fuzz/mpatch_corpus.py b/contrib/fuzz/mpatch_corpus.py
--- a/contrib/fuzz/mpatch_corpus.py
+++ b/contrib/fuzz/mpatch_corpus.py
@@ -2,6 +2,7 @@
 
 import argparse
 import struct
+import sys
 import zipfile
 
 from mercurial import (
@@ -14,16 +15,22 @@
 args = ap.parse_args()
 
 
-class deltafrag(object):
+if sys.version_info[0] < 3:
+class py2reprhack(object):
+def __repr__(self):
+"""Py2 calls __repr__ for `bytes(foo)`, forward to __bytes__"""
+return self.__bytes__()
+else:
+class py2reprhack(object):
+"""Not needed on py3."""
+
+
+class deltafrag(py2reprhack):
 def __init__(self, start, end, data):
 self.start = start
 self.end = end
 self.data = data
 
-def __repr__(self):
-# py2 calls __repr__ when you do `bytes(foo)`
-return self.__bytes__()
-
 def __bytes__(self):
 return (
 struct.pack(">lll", self.start, self.end, len(self.data))
@@ -31,27 +38,19 @@
 )
 
 
-class delta(object):
+class delta(py2reprhack):
 def __init__(self, frags):
 self.frags = frags
 
-def __repr__(self):
-# py2 calls __repr__ when you do `bytes(foo)`
-return self.__bytes__()
-
 def __bytes__(self):
 return b''.join(bytes(f) for f in self.frags)
 
 
-class corpus(object):
+class corpus(py2reprhack):
 def __init__(self, base, deltas):
 self.base = base
 self.deltas = deltas
 
-def __repr__(self):
-# py2 calls __repr__ when you do `bytes(foo)`
-return self.__bytes__()
-
 def __bytes__(self):
 deltas = [bytes(d) for d in self.deltas]
 parts = (



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


D7550: chg: fix chg to work with py3.7+ "coercing" the locale

2019-12-11 Thread spectral (Kyle Lippincott)
spectral added a comment.


  In D7550#111235 , @yuja wrote:
  
  >>   When the environment is empty (specifically: it doesn't contain LC_ALL,
  >>   LC_CTYPE, or LANG), Python will "coerce" the locale environment 
variables to be
  >>   a UTF-8 capable one. It sets LC_CTYPE in the environment, and this 
breaks chg,
  >>   since chg operates by:
  >>   - start hg, using whatever environment the user has when chg starts
  >>   - hg stores a hash of this "original" environment, but python has 
already set LC_CTYPE even though the user doesn't have it in their environment
  >>   - chg calls setenv over the commandserver. This clears the environment 
inside of hg and sets it to be exactly what the environment in chg is (without 
LC_CTYPE).
  >>   - chg calls validate to ensure that the environment hg is using (after 
the setenv call) is the one that the chg process has - if not, it is assumed 
the user changed their environment and we should use a different server. This 
will *never* be true in this situation because LC_CTYPE was removed.
  >
  > Sigh. Can we work around this weird behavior by making chg do
  > `putenv("PYTHONCOERCECLOCALE=0")`? I think it's simple and more desired
  > behavior than the default of Python 3.
  
  I had considered that and was concerned it would create an observable, 
surprising/confusing difference between chg and non-chg: if chg sets 
PYTHONCOERCECLOCALE=0, hg won't have LC_CTYPE in the environment, and it WILL 
have PYTHONCOERCECLOCALE in the environment. When it starts external tools 
(like merge tools), this may change behavior in some observable fashion, and if 
the user stops using chg and uses just plain hg, it will have LC_CTYPE in the 
environment. This would probably be difficult to debug - users (at least the 
ones I interact with) often don't tell us they're using chg, if they even know 
that they are. (Sometimes users don't even know they're using chg, such as via 
their IDE's Mercurial integration, but that's probably not actually a problem 
here - the IDE would be responsible for making this work, not end users).
  
  I don't know the reason why Python is doing this at all, so maybe my concern 
is purely hypothetical and not really a problem?

REPOSITORY
  rHG Mercurial

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

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

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


D7517: filemerge: byteify the open() mode

2019-12-11 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  In D7517#111885 , @durin42 wrote:
  
  > I'm a little fuzzy on this: should I see some test failures? or...?
  
  It looks like not.  I glossed over the fact that `pycompat.sysstr()` will 
simply return `str` if given one, before trying to decode it.  So it will take 
either `bytes` or `str`.
  
  I looks like the VSCode complaint about passing bytes as the mode is only 
flagged when used in a context manager (several lines below), even though 
clicking through to the definition brings it to pycompat.  I don't remember if 
this particular thing was flagged by static analysis, or it just caught my eye 
because 99% of the modes in other uses (outside tests/, contrib/ and setup.py) 
are bytes.  But the latest version of PyCharm isn't complaining, nor is pytype. 
 So I can abandon it if you'd prefer.

REPOSITORY
  rHG Mercurial

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

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

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


D7594: status: add template/json data about whether a file has unresolved conflicts

2019-12-11 Thread rdamazio (Rodrigo Damazio Bovendorp)
rdamazio added inline comments.

INLINE COMMENTS

> martinvonz wrote in cmdutil.py:792
> That's an O(n) lookup. Probably fine since you very rarely have thousands of 
> conflicts...

Yes, I thought of storing it as a set, but then thought that it either didn't 
matter or would be slower because there are so few items.

REPOSITORY
  rHG Mercurial

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

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

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


mercurial@43847: new changeset

2019-12-11 Thread Mercurial Commits
New changeset in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/49fa0b31ee1d
changeset:   43847:49fa0b31ee1d
bookmark:@
tag: tip
user:Georges Racinet 
date:Thu Dec 05 20:41:23 2019 +0100
summary: cext-revlog: fixed  __delitem__ for uninitialized nodetree

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


[Bug 6239] New: qrefresh exclude option does not use regex

2019-12-11 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6239

Bug ID: 6239
   Summary: qrefresh exclude option does not use regex
   Product: Mercurial
   Version: unspecified
  Hardware: All
OS: Linux
Status: UNCONFIRMED
  Severity: bug
  Priority: urgent
 Component: mq
  Assignee: bugzi...@mercurial-scm.org
  Reporter: mues...@gmail.com
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

Whenever I try to exclude files with a regex it simply doesn't work at all. All
files that should be excluded are kept in the patch. Single file works though.
See the following example:

>>> touch bar.xml baz.txt foo.xml
>>> hg init
>>> hg qnew test
>>> hg qser -v
0 A test
> hg st
? bar.xml
? baz.txt
? foo.xml
>>> hg add 
Füge bar.xml hinzu
Füge baz.txt hinzu
Füge foo.xml hinzu
>>> hg qrefresh --exclude '*.xml'
>>> hg st
A bar.xml
A foo.xml
>>> hg diff
>>> hg qdiff
diff --git a/bar.xml b/bar.xml
new file mode 100644
diff --git a/baz.txt b/baz.txt
new file mode 100644
diff --git a/foo.xml b/foo.xml
new file mode 100644

The documentation clearly mentions that it expects a pattern. The version is
5.1.2 from Archlinux repo (but I also have this bug at work with CentOS).

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


mercurial@43846: 2 new changesets

2019-12-11 Thread Mercurial Commits
2 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/1ffbd03c8d75
changeset:   43845:1ffbd03c8d75
user:Matt Harbison 
date:Wed Nov 20 13:01:56 2019 -0500
summary: filemerge: drop a default argument to appease pytype

https://www.mercurial-scm.org/repo/hg/rev/d5ce99a6db52
changeset:   43846:d5ce99a6db52
bookmark:@
tag: tip
user:Matt Harbison 
date:Wed Nov 20 13:03:22 2019 -0500
summary: filemerge: fix a missing attribute usage

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


D7603: cext-revlog: fixed __delitem__ for uninitialized nodetree

2019-12-11 Thread gracinet (Georges Racinet)
Closed by commit rHG49fa0b31ee1d: cext-revlog: fixed  __delitem__ for 
uninitialized nodetree (authored by gracinet).
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/D7603?vs=18598=18621

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

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

AFFECTED FILES
  mercurial/cext/revlog.c
  tests/test-parseindex2.py

CHANGE DETAILS

diff --git a/tests/test-parseindex2.py b/tests/test-parseindex2.py
--- a/tests/test-parseindex2.py
+++ b/tests/test-parseindex2.py
@@ -247,6 +247,32 @@
 got = index[-1]
 self.assertEqual(want, got)  # no inline data
 
+def testdelitemwithoutnodetree(self):
+index, _junk = parsers.parse_index2(data_non_inlined, False)
+
+def hexrev(rev):
+if rev == nullrev:
+return b'\xff\xff\xff\xff'
+else:
+return nodemod.bin('%08x' % rev)
+
+def appendrev(p1, p2=nullrev):
+# node won't matter for this test, let's just make sure
+# they don't collide. Other data don't matter either.
+node = hexrev(p1) + hexrev(p2) + b'.' * 12
+index.append((0, 0, 12, 1, 34, p1, p2, node))
+
+appendrev(4)
+appendrev(5)
+appendrev(6)
+self.assertEqual(len(index), 7)
+
+del index[1:7]
+
+# assertions that failed before correction
+self.assertEqual(len(index), 1)  # was 4
+self.assertEqual(index.headrevs(), [0])  # gave ValueError
+
 
 if __name__ == '__main__':
 import silenttestrunner
diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -2522,7 +2522,10 @@
index_invalidate_added(self, 0);
if (self->ntrev > start)
self->ntrev = (int)start;
+   } else if (self->added) {
+   Py_CLEAR(self->added);
}
+
self->length = start;
if (start < self->raw_length) {
if (self->cache) {



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


D7522: rust-dirs: handle forgotten `Result`s

2019-12-11 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> dirstate_map.rs:355
>  
>  assert_eq!(false, map.has_dir(HgPath::new(b"nope")));
>  assert!(map.all_dirs.is_some());

Have to update at this test and probably others

REPOSITORY
  rHG Mercurial

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

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

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


mercurial@43844: 21 new changesets

2019-12-11 Thread Mercurial Commits
21 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/a6483107a07a
changeset:   43824:a6483107a07a
user:Augie Fackler 
date:Thu Dec 05 16:18:44 2019 -0500
summary: annotate: describe --skip as taking a revset

https://www.mercurial-scm.org/repo/hg/rev/8f26dd09aa78
changeset:   43825:8f26dd09aa78
user:Julien Cristau 
date:Mon Dec 02 14:44:26 2019 +0100
summary: mail: use procutil.shellsplit instead of bytes.split to parse 
command

https://www.mercurial-scm.org/repo/hg/rev/5ac243a92e37
changeset:   43826:5ac243a92e37
user:Raphaël Gomès 
date:Mon Oct 14 13:57:30 2019 +0200
summary: rust-performance: introduce FastHashMap type alias for HashMap

https://www.mercurial-scm.org/repo/hg/rev/c27e688fcdc3
changeset:   43827:c27e688fcdc3
user:Raphaël Gomès 
date:Fri Nov 29 17:15:24 2019 +0100
summary: rust-hg-path: implement `Display` for `HgPath` and `HgPathBuf`

https://www.mercurial-scm.org/repo/hg/rev/36444dddaeb4
changeset:   43828:36444dddaeb4
user:Augie Fackler 
date:Tue Dec 10 10:31:18 2019 -0500
summary: tests: replace [[]] bashism with portable [] invocation

https://www.mercurial-scm.org/repo/hg/rev/16b607e9f714
changeset:   43829:16b607e9f714
user:Denis Laxalde 
date:Thu Nov 21 18:10:12 2019 +0100
summary: phabricator: fix processing of tags/desc in getoldnodedrevmap()

https://www.mercurial-scm.org/repo/hg/rev/6331a6fc3304
changeset:   43830:6331a6fc3304
user:Denis Laxalde 
date:Thu Nov 21 16:48:34 2019 +0100
summary: logcmdutil: call _exthook() in changesettemplater

https://www.mercurial-scm.org/repo/hg/rev/088ba9d94079
changeset:   43831:088ba9d94079
user:Raphaël Gomès 
date:Fri Nov 29 17:19:34 2019 +0100
summary: rust-dirs-multiset: use `AsRef` instead of concrete types when 
possible

https://www.mercurial-scm.org/repo/hg/rev/1bb4e9b02984
changeset:   43832:1bb4e9b02984
user:Raphaël Gomès 
date:Fri Nov 29 18:33:56 2019 +0100
summary: rust-matchers: improve `Matcher` trait ergonomics

https://www.mercurial-scm.org/repo/hg/rev/4f1543a2f5c3
changeset:   43833:4f1543a2f5c3
user:Raphaël Gomès 
date:Fri Nov 29 17:24:40 2019 +0100
summary: rust-hg-path: add method to get part of a path relative to a prefix

https://www.mercurial-scm.org/repo/hg/rev/542c8b277261
changeset:   43834:542c8b277261
user:Raphaël Gomès 
date:Fri Nov 29 18:53:52 2019 +0100
summary: rust-matchers: add doctests for `AlwaysMatcher`

https://www.mercurial-scm.org/repo/hg/rev/94670e124d29
changeset:   43835:94670e124d29
user:Kyle Lippincott 
date:Tue Dec 10 15:29:58 2019 -0800
summary: py3: fix a bytes vs str issue in remotefilelog extension

https://www.mercurial-scm.org/repo/hg/rev/ba84a1ae4ae5
changeset:   43836:ba84a1ae4ae5
user:Kyle Lippincott 
date:Tue Dec 10 16:17:36 2019 -0800
summary: fuzz: fix test-fuzz-targets.t to run with python3

https://www.mercurial-scm.org/repo/hg/rev/8377570a36a9
changeset:   43837:8377570a36a9
user:Pierre-Yves David 
date:Wed Dec 11 11:16:12 2019 +0100
summary: manifestcache: add some test involving shares

https://www.mercurial-scm.org/repo/hg/rev/a47ccdcce4f9
changeset:   43838:a47ccdcce4f9
user:Martin von Zweigbergk 
date:Tue Dec 10 14:40:44 2019 -0800
summary: dirs: fix out-of-bounds access in Py3

https://www.mercurial-scm.org/repo/hg/rev/70060915c3f2
changeset:   43839:70060915c3f2
user:Denis Laxalde 
date:Sat Nov 23 11:04:19 2019 +0100
summary: phabricator: add a "phabstatus" show view

https://www.mercurial-scm.org/repo/hg/rev/79c0121220e3
changeset:   43840:79c0121220e3
user:Denis Laxalde 
date:Thu Nov 21 16:54:00 2019 +0100
summary: phabricator: add a "phabstatus" template keyword

https://www.mercurial-scm.org/repo/hg/rev/fb4a6d584756
changeset:   43841:fb4a6d584756
user:Rodrigo Damazio Bovendorp 
date:Mon Dec 09 18:15:38 2019 -0800
summary: status: split morestatus data loading from display

https://www.mercurial-scm.org/repo/hg/rev/7315464f0613
changeset:   43842:7315464f0613
user:Rodrigo Damazio Bovendorp 
date:Mon Dec 09 22:06:55 2019 -0800
summary: status: add template/json data about whether a file has unresolved 
conflicts

https://www.mercurial-scm.org/repo/hg/rev/d74d78aa74e9
changeset:   43843:d74d78aa74e9
user:Augie Fackler 
date:Tue Dec 10 19:04:08 2019 -0500
summary: fuzz: clean up production of seed corpora

https://www.mercurial-scm.org/repo/hg/rev/b7af8a02a304
changeset:   43844:b7af8a02a304
bookmark:@
tag: tip
user:Augie Fackler 
date:Tue Dec 10 19:04:53 2019 -0500
summary: fuzz: add a seed corpus for the dirs fuzzer

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___

D7465: filemerge: fix a missing attribute usage

2019-12-11 Thread mharbison72 (Matt Harbison)
Closed by commit rHGd5ce99a6db52: filemerge: fix a missing attribute usage 
(authored by mharbison72).
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/D7465?vs=18415=18620

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

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -119,7 +119,7 @@
 """
 return not (
 fctx.isabsent()
-and fctx.ctx() == self.ctx()
+and fctx.changectx() == self.changectx()
 and fctx.path() == self.path()
 )
 



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


D7464: filemerge: drop a default argument to appease pytype

2019-12-11 Thread mharbison72 (Matt Harbison)
Closed by commit rHG1ffbd03c8d75: filemerge: drop a default argument to appease 
pytype (authored by mharbison72).
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/D7464?vs=18254=18619

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

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -693,7 +693,7 @@
 ui.status(t.renderdefault(props))
 
 
-def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
+def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels):
 tool, toolpath, binary, symlink, scriptfn = toolconf
 uipathfn = scmutil.getuipathfn(repo)
 if fcd.isabsent() or fco.isabsent():



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


D7604: rust-hg-path: implement more readable custom Debug for HgPath{, Buf}

2019-12-11 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> kevincox wrote in hg_path.rs:186
> I would recommend `"HgPath({:?})"` so that the result is unambiguous and 
> nicely escaped.

Good point.

REPOSITORY
  rHG Mercurial

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

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

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


D7604: rust-hg-path: implement more readable custom Debug for HgPath{, Buf}

2019-12-11 Thread martinvonz (Martin von Zweigbergk)
martinvonz marked an inline comment as done.
martinvonz updated this revision to Diff 18618.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7604?vs=18616=18618

BRANCH
  default

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

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

AFFECTED FILES
  rust/hg-core/src/utils/hg_path.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/utils/hg_path.rs 
b/rust/hg-core/src/utils/hg_path.rs
--- a/rust/hg-core/src/utils/hg_path.rs
+++ b/rust/hg-core/src/utils/hg_path.rs
@@ -77,7 +77,7 @@
 // `#[repr(transparent)]`.
 // Anyway, `Slice` representation and layout are considered implementation
 // detail, are not documented and must not be relied upon.
-#[derive(Eq, Ord, PartialEq, PartialOrd, Debug, Hash)]
+#[derive(Eq, Ord, PartialEq, PartialOrd, Hash)]
 pub struct HgPath {
 inner: [u8],
 }
@@ -181,13 +181,19 @@
 }
 }
 
+impl fmt::Debug for HgPath {
+fn fmt(, f:  fmt::Formatter<'_>) -> fmt::Result {
+write!(f, "HgPath({:?})", String::from_utf8_lossy())
+}
+}
+
 impl fmt::Display for HgPath {
 fn fmt(, f:  fmt::Formatter<'_>) -> fmt::Result {
 write!(f, "{}", String::from_utf8_lossy())
 }
 }
 
-#[derive(Eq, Ord, Clone, PartialEq, PartialOrd, Debug, Hash)]
+#[derive(Eq, Ord, Clone, PartialEq, PartialOrd, Hash)]
 pub struct HgPathBuf {
 inner: Vec,
 }
@@ -210,6 +216,12 @@
 }
 }
 
+impl fmt::Debug for HgPathBuf {
+fn fmt(, f:  fmt::Formatter<'_>) -> fmt::Result {
+write!(f, "HgPathBuf({:?})", String::from_utf8_lossy())
+}
+}
+
 impl fmt::Display for HgPathBuf {
 fn fmt(, f:  fmt::Formatter<'_>) -> fmt::Result {
 write!(f, "{}", String::from_utf8_lossy())



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


D7605: formatting: fix some recent formatting regressions

2019-12-11 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/fuzz/mpatch_corpus.py
  mercurial/cmdutil.py

CHANGE DETAILS

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -793,14 +793,17 @@
 fm.data(unresolved=True)
 
 def formatfooter(self, fm):
-statemsg = _(b'The repository is in an unfinished *%s* state.'
- ) % self.unfinishedop
+statemsg = (
+_(b'The repository is in an unfinished *%s* state.')
+% self.unfinishedop
+)
 fm.plain(b'%s\n' % _commentlines(statemsg), label=self._label)
 
 self._formatconflicts(fm)
 if self.unfinishedmsg:
-fm.plain(b'%s\n' % _commentlines(self.unfinishedmsg),
- label=self._label)
+fm.plain(
+b'%s\n' % _commentlines(self.unfinishedmsg), label=self._label
+)
 
 def _formatconflicts(self, fm):
 if not self.inmergestate:
@@ -809,8 +812,8 @@
 if self.unresolvedpaths:
 mergeliststr = b'\n'.join(
 [
-b'%s' % util.pathto(self.reporoot, encoding.getcwd(),
-path)
+b'%s'
+% util.pathto(self.reporoot, encoding.getcwd(), path)
 for path in self.unresolvedpaths
 ]
 )
@@ -841,8 +844,13 @@
 unresolved = None
 if mergestate.active():
 unresolved = sorted(mergestate.unresolved())
-return morestatus(repo.root, unfinishedop, unfinishedmsg,
-  unresolved is not None, unresolved)
+return morestatus(
+repo.root,
+unfinishedop,
+unfinishedmsg,
+unresolved is not None,
+unresolved,
+)
 
 
 def findpossible(cmd, table, strict=False):
diff --git a/contrib/fuzz/mpatch_corpus.py b/contrib/fuzz/mpatch_corpus.py
--- a/contrib/fuzz/mpatch_corpus.py
+++ b/contrib/fuzz/mpatch_corpus.py
@@ -70,15 +70,15 @@
 # Manually constructed entries
 zf.writestr(
 "one_delta_applies",
-bytes(corpus(b'a', [delta([deltafrag(0, 1, b'b')])]))
+bytes(corpus(b'a', [delta([deltafrag(0, 1, b'b')])])),
 )
 zf.writestr(
 "one_delta_starts_late",
-bytes(corpus(b'a', [delta([deltafrag(3, 1, b'b')])]))
+bytes(corpus(b'a', [delta([deltafrag(3, 1, b'b')])])),
 )
 zf.writestr(
 "one_delta_ends_late",
-bytes(corpus(b'a', [delta([deltafrag(0, 20, b'b')])]))
+bytes(corpus(b'a', [delta([deltafrag(0, 20, b'b')])])),
 )
 
 try:



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


D7604: rust-hg-path: implement more readable custom Debug for HgPath{, Buf}

2019-12-11 Thread kevincox (Kevin Cox)
kevincox added inline comments.
kevincox accepted this revision.

INLINE COMMENTS

> hg_path.rs:186
> +fn fmt(, f:  fmt::Formatter<'_>) -> fmt::Result {
> +write!(f, "HgPath({})", String::from_utf8_lossy())
> +}

I would recommend `"HgPath({:?})"` so that the result is unambiguous and nicely 
escaped.

REPOSITORY
  rHG Mercurial

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

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

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


D7604: rust-hg-path: implement more readable custom Debug for HgPath{, Buf}

2019-12-11 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added subscribers: mercurial-devel, kevincox, durin42.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The default prints the vector of bytes as a list of integers. I
  considered instead getting rid of the Debug trait, but we use the
  Debug format in lots of derived Debug instances, so we probably do
  want to implement it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/utils/hg_path.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/utils/hg_path.rs 
b/rust/hg-core/src/utils/hg_path.rs
--- a/rust/hg-core/src/utils/hg_path.rs
+++ b/rust/hg-core/src/utils/hg_path.rs
@@ -77,7 +77,7 @@
 // `#[repr(transparent)]`.
 // Anyway, `Slice` representation and layout are considered implementation
 // detail, are not documented and must not be relied upon.
-#[derive(Eq, Ord, PartialEq, PartialOrd, Debug, Hash)]
+#[derive(Eq, Ord, PartialEq, PartialOrd, Hash)]
 pub struct HgPath {
 inner: [u8],
 }
@@ -181,13 +181,19 @@
 }
 }
 
+impl fmt::Debug for HgPath {
+fn fmt(, f:  fmt::Formatter<'_>) -> fmt::Result {
+write!(f, "HgPath({})", String::from_utf8_lossy())
+}
+}
+
 impl fmt::Display for HgPath {
 fn fmt(, f:  fmt::Formatter<'_>) -> fmt::Result {
 write!(f, "{}", String::from_utf8_lossy())
 }
 }
 
-#[derive(Eq, Ord, Clone, PartialEq, PartialOrd, Debug, Hash)]
+#[derive(Eq, Ord, Clone, PartialEq, PartialOrd, Hash)]
 pub struct HgPathBuf {
 inner: Vec,
 }
@@ -210,6 +216,12 @@
 }
 }
 
+impl fmt::Debug for HgPathBuf {
+fn fmt(, f:  fmt::Formatter<'_>) -> fmt::Result {
+write!(f, "HgPathBuf({})", String::from_utf8_lossy())
+}
+}
+
 impl fmt::Display for HgPathBuf {
 fn fmt(, f:  fmt::Formatter<'_>) -> fmt::Result {
 write!(f, "{}", String::from_utf8_lossy())



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


D7570: match: resolve filesets against the passed `cwd`, not the current one

2019-12-11 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In D7570#111892 , @durin42 wrote:
  
  > I'm happy with this, but didn't spend time figuring out if all concerns 
have been addressed (I'm mostly doing a fast triage path).
  
  I *think* they're addressed, but we there's no rush to get this in so let's 
give Yuya a chance to comment, because I'm not sure if the issue with subrepos 
is an existing or new issue.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

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


D7575: hg-core: vendor Facebook's configparser crate

2019-12-11 Thread durin42 (Augie Fackler)
durin42 added inline comments.

INLINE COMMENTS

> Alphare wrote in c_api.rs:1
> Do we need bindings to C ? I don't see what the use-case is at this stage of 
> the Rust development.

+1, I'm not sure what the use case for this would be in core.

REPOSITORY
  rHG Mercurial

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

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

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


D7522: rust-dirs: handle forgotten `Result`s

2019-12-11 Thread durin42 (Augie Fackler)
durin42 added a comment.
durin42 resigned from this revision.


  This needs a rebase that I'm not sure I can accomplish correctly. Could you 
take a look?

REPOSITORY
  rHG Mercurial

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

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

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


D7570: match: resolve filesets against the passed `cwd`, not the current one

2019-12-11 Thread durin42 (Augie Fackler)
This revision is now accepted and ready to land.
durin42 added a comment.
durin42 accepted this revision.


  I'm happy with this, but didn't spend time figuring out if all concerns have 
been addressed (I'm mostly doing a fast triage path).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

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


D7595: status: outputting structured unfinished-operation information

2019-12-11 Thread durin42 (Augie Fackler)
durin42 added inline comments.

INLINE COMMENTS

> rdamazio wrote in configitems.py:247
> I'm fine with removing the config option, but will let yuja reply first.
> About being BC or not - it depends on how people are parsing the JSON output 
> :) If they're either turning off morestatus for -Tjson calls, or they're ok 
> with an entry with no path, then it should work, but I won't be surprised if 
> it breaks some callers.

I also support not adding a second config option and just adding content that's 
from the morestatus config.

REPOSITORY
  rHG Mercurial

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

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

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


D7517: filemerge: byteify the open() mode

2019-12-11 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I'm a little fuzzy on this: should I see some test failures? or...?

REPOSITORY
  rHG Mercurial

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

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

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


D7590: remotefilelog: remove the `ensurestart` usage

2019-12-11 Thread marmoute (Pierre-Yves David)
Closed by commit rHG612b4b63fb22: remotefilelog: remove the `ensurestart` usage 
(authored by marmoute).
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/D7590?vs=18557=18615

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

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

AFFECTED FILES
  hgext/remotefilelog/__init__.py
  hgext/remotefilelog/repack.py
  hgext/remotefilelog/shallowrepo.py
  tests/test-remotefilelog-bgprefetch.t
  tests/test-remotefilelog-repack-fast.t
  tests/test-remotefilelog-repack.t

CHANGE DETAILS

diff --git a/tests/test-remotefilelog-repack.t 
b/tests/test-remotefilelog-repack.t
--- a/tests/test-remotefilelog-repack.t
+++ b/tests/test-remotefilelog-repack.t
@@ -1,11 +1,8 @@
 #require no-windows
 
   $ . "$TESTDIR/remotefilelog-library.sh"
-# devel.remotefilelog.ensurestart: reduce race condition with
-# waiton{repack/prefetch}
   $ cat >> $HGRCPATH < [devel]
-  > remotefilelog.ensurestart=True
   > remotefilelog.bg-wait=True
   > EOF
 
diff --git a/tests/test-remotefilelog-repack-fast.t 
b/tests/test-remotefilelog-repack-fast.t
--- a/tests/test-remotefilelog-repack-fast.t
+++ b/tests/test-remotefilelog-repack-fast.t
@@ -1,13 +1,11 @@
 #require no-windows
 
   $ . "$TESTDIR/remotefilelog-library.sh"
-# devel.remotefilelog.ensurestart: reduce race condition with
-# waiton{repack/prefetch}
+
   $ cat >> $HGRCPATH < [remotefilelog]
   > fastdatapack=True
   > [devel]
-  > remotefilelog.ensurestart=True
   > remotefilelog.bg-wait=True
   > EOF
 
diff --git a/tests/test-remotefilelog-bgprefetch.t 
b/tests/test-remotefilelog-bgprefetch.t
--- a/tests/test-remotefilelog-bgprefetch.t
+++ b/tests/test-remotefilelog-bgprefetch.t
@@ -1,11 +1,8 @@
 #require no-windows
 
   $ . "$TESTDIR/remotefilelog-library.sh"
-# devel.remotefilelog.ensurestart: reduce race condition with
-# waiton{repack/prefetch}
   $ cat >> $HGRCPATH < [devel]
-  > remotefilelog.ensurestart=True
   > remotefilelog.bg-wait=True
   > EOF
 
diff --git a/hgext/remotefilelog/shallowrepo.py 
b/hgext/remotefilelog/shallowrepo.py
--- a/hgext/remotefilelog/shallowrepo.py
+++ b/hgext/remotefilelog/shallowrepo.py
@@ -215,13 +215,7 @@
 )
 
 def backgroundprefetch(
-self,
-revs,
-base=None,
-repack=False,
-pats=None,
-opts=None,
-ensurestart=False,
+self, revs, base=None, repack=False, pats=None, opts=None
 ):
 """Runs prefetch in background with optional repack
 """
@@ -237,7 +231,7 @@
 kwargs['record_wait'] = repo.ui.atexit
 
 procutil.runbgcommand(
-cmd, encoding.environ, ensurestart=ensurestart, **kwargs
+cmd, encoding.environ, ensurestart=False, **kwargs
 )
 
 def prefetch(self, revs, base=None, pats=None, opts=None):
diff --git a/hgext/remotefilelog/repack.py b/hgext/remotefilelog/repack.py
--- a/hgext/remotefilelog/repack.py
+++ b/hgext/remotefilelog/repack.py
@@ -36,9 +36,7 @@
 pass
 
 
-def backgroundrepack(
-repo, incremental=True, packsonly=False, ensurestart=False
-):
+def backgroundrepack(repo, incremental=True, packsonly=False):
 cmd = [procutil.hgexecutable(), b'-R', repo.origroot, b'repack']
 msg = _(b"(running background repack)\n")
 if incremental:
@@ -52,9 +50,7 @@
 if repo.ui.configbool(b'devel', b'remotefilelog.bg-wait'):
 kwargs['record_wait'] = repo.ui.atexit
 
-procutil.runbgcommand(
-cmd, encoding.environ, ensurestart=ensurestart, **kwargs
-)
+procutil.runbgcommand(cmd, encoding.environ, ensurestart=False, **kwargs)
 
 
 def fullrepack(repo, options=None):
diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py
--- a/hgext/remotefilelog/__init__.py
+++ b/hgext/remotefilelog/__init__.py
@@ -229,7 +229,6 @@
 configitem(b'packs', b'maxpacksize', default=0)
 configitem(b'packs', b'maxchainlen', default=1000)
 
-configitem(b'devel', b'remotefilelog.ensurestart', default=False)
 configitem(b'devel', b'remotefilelog.bg-wait', default=False)
 
 #  default TTL limit is 30 days
@@ -1085,26 +1084,19 @@
 prefetchrevset = ui.config(b'remotefilelog', b'pullprefetch')
 bgrepack = repo.ui.configbool(b'remotefilelog', b'backgroundrepack')
 bgprefetch = repo.ui.configbool(b'remotefilelog', 
b'backgroundprefetch')
-ensurestart = repo.ui.configbool(b'devel', 
b'remotefilelog.ensurestart')
 
 if prefetchrevset:
 ui.status(_(b"prefetching file contents\n"))
 revs = scmutil.revrange(repo, [prefetchrevset])
 base = repo[b'.'].rev()
 if bgprefetch:
-repo.backgroundprefetch(
-prefetchrevset, 

D7589: remotefilelog: remove most of the debugwait* command in the tests

2019-12-11 Thread marmoute (Pierre-Yves David)
Closed by commit rHG4f40dc190f63: remotefilelog: remove most of the debugwait* 
command in the tests (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7589?vs=18554=18614

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

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

AFFECTED FILES
  tests/test-remotefilelog-bgprefetch.t
  tests/test-remotefilelog-gcrepack.t
  tests/test-remotefilelog-repack-fast.t
  tests/test-remotefilelog-repack.t

CHANGE DETAILS

diff --git a/tests/test-remotefilelog-repack.t 
b/tests/test-remotefilelog-repack.t
--- a/tests/test-remotefilelog-repack.t
+++ b/tests/test-remotefilelog-repack.t
@@ -153,7 +153,6 @@
 
   $ hg repack --background
   (running background repack)
-  $ hg debugwaitonrepack >/dev/null 2>&1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.dataidx
   
$TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.datapack
@@ -371,7 +370,6 @@
   searching for changes
   no changes found
   (running background incremental repack)
-  $ hg debugwaitonrepack >/dev/null 2>&1
   $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
   -r--r--r-- 303 156a6c1c83aeb69422d7936e0a46ba9bc06a71c0.datapack
   $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
diff --git a/tests/test-remotefilelog-repack-fast.t 
b/tests/test-remotefilelog-repack-fast.t
--- a/tests/test-remotefilelog-repack-fast.t
+++ b/tests/test-remotefilelog-repack-fast.t
@@ -143,7 +143,6 @@
 
   $ hg repack --background
   (running background repack)
-  $ hg debugwaitonrepack >/dev/null 2>&1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.dataidx
   
$TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.datapack
@@ -342,7 +341,6 @@
   searching for changes
   no changes found
   (running background incremental repack)
-  $ hg debugwaitonrepack >/dev/null 2>&1
   $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
   -r--r--r-- 303 156a6c1c83aeb69422d7936e0a46ba9bc06a71c0.datapack
   $ ls_l $TESTTMP/hgcache/master/packs/ | grep histpack
diff --git a/tests/test-remotefilelog-gcrepack.t 
b/tests/test-remotefilelog-gcrepack.t
--- a/tests/test-remotefilelog-gcrepack.t
+++ b/tests/test-remotefilelog-gcrepack.t
@@ -40,7 +40,6 @@
   $ hg prefetch
   2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
   $ hg repack
-  $ hg debugwaitonrepack >/dev/null 2>%1
 
   $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
   
$TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
@@ -72,7 +71,6 @@
   > EOF
 
   $ hg repack
-  $ hg debugwaitonrepack >/dev/null 2>%1
 
   $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
   
$TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
@@ -99,7 +97,6 @@
   $ hg prefetch
   2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
   $ hg repack
-  $ hg debugwaitonrepack >/dev/null 2>%1
 
   $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
   
$TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
@@ -132,7 +129,6 @@
   > EOF
 
   $ hg repack
-  $ hg debugwaitonrepack >/dev/null 2>%1
 
   $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
   
$TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
diff --git a/tests/test-remotefilelog-bgprefetch.t 
b/tests/test-remotefilelog-bgprefetch.t
--- a/tests/test-remotefilelog-bgprefetch.t
+++ b/tests/test-remotefilelog-bgprefetch.t
@@ -79,7 +79,6 @@
   new changesets 6b4b6f66ef8c
   (run 'hg update' to get a working copy)
   prefetching file contents
-  $ hg debugwaitonprefetch >/dev/null 2>&1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0
   
$TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
@@ -107,8 +106,6 @@
   new changesets 6b4b6f66ef8c
   (run 'hg update' to get a working copy)
   prefetching file contents
-  $ hg debugwaitonprefetch >/dev/null 2>&1
-  $ hg debugwaitonrepack >/dev/null 2>&1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histidx
   
$TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histpack
@@ -140,8 +137,6 @@
   $ hg up -r 0
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   * files fetched over * fetches - (* misses, 0.00% hit ratio) over *s (glob)
-  $ hg debugwaitonprefetch >/dev/null 2>&1
-  $ hg debugwaitonrepack >/dev/null 2>&1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
   

D7587: remotefilelog: remove most sleep in tests

2019-12-11 Thread marmoute (Pierre-Yves David)
Closed by commit rHGfac25de8cbec: remotefilelog: remove most sleep in tests 
(authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7587?vs=18552=18612

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

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

AFFECTED FILES
  tests/test-remotefilelog-bgprefetch.t
  tests/test-remotefilelog-gcrepack.t
  tests/test-remotefilelog-repack-fast.t
  tests/test-remotefilelog-repack.t

CHANGE DETAILS

diff --git a/tests/test-remotefilelog-repack.t 
b/tests/test-remotefilelog-repack.t
--- a/tests/test-remotefilelog-repack.t
+++ b/tests/test-remotefilelog-repack.t
@@ -153,7 +153,6 @@
 
   $ hg repack --background
   (running background repack)
-  $ sleep 0.5
   $ hg debugwaitonrepack >/dev/null 2>&1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.dataidx
@@ -372,7 +371,6 @@
   searching for changes
   no changes found
   (running background incremental repack)
-  $ sleep 0.5
   $ hg debugwaitonrepack >/dev/null 2>&1
   $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
   -r--r--r-- 303 156a6c1c83aeb69422d7936e0a46ba9bc06a71c0.datapack
diff --git a/tests/test-remotefilelog-repack-fast.t 
b/tests/test-remotefilelog-repack-fast.t
--- a/tests/test-remotefilelog-repack-fast.t
+++ b/tests/test-remotefilelog-repack-fast.t
@@ -143,7 +143,6 @@
 
   $ hg repack --background
   (running background repack)
-  $ sleep 0.5
   $ hg debugwaitonrepack >/dev/null 2>&1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.dataidx
@@ -343,7 +342,6 @@
   searching for changes
   no changes found
   (running background incremental repack)
-  $ sleep 0.5
   $ hg debugwaitonrepack >/dev/null 2>&1
   $ ls_l $TESTTMP/hgcache/master/packs/ | grep datapack
   -r--r--r-- 303 156a6c1c83aeb69422d7936e0a46ba9bc06a71c0.datapack
diff --git a/tests/test-remotefilelog-gcrepack.t 
b/tests/test-remotefilelog-gcrepack.t
--- a/tests/test-remotefilelog-gcrepack.t
+++ b/tests/test-remotefilelog-gcrepack.t
@@ -40,7 +40,6 @@
   $ hg prefetch
   2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
   $ hg repack
-  $ sleep 0.5
   $ hg debugwaitonrepack >/dev/null 2>%1
 
   $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
@@ -73,7 +72,6 @@
   > EOF
 
   $ hg repack
-  $ sleep 0.5
   $ hg debugwaitonrepack >/dev/null 2>%1
 
   $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
@@ -101,7 +99,6 @@
   $ hg prefetch
   2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
   $ hg repack
-  $ sleep 0.5
   $ hg debugwaitonrepack >/dev/null 2>%1
 
   $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
@@ -135,7 +132,6 @@
   > EOF
 
   $ hg repack
-  $ sleep 0.5
   $ hg debugwaitonrepack >/dev/null 2>%1
 
   $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
diff --git a/tests/test-remotefilelog-bgprefetch.t 
b/tests/test-remotefilelog-bgprefetch.t
--- a/tests/test-remotefilelog-bgprefetch.t
+++ b/tests/test-remotefilelog-bgprefetch.t
@@ -79,7 +79,6 @@
   new changesets 6b4b6f66ef8c
   (run 'hg update' to get a working copy)
   prefetching file contents
-  $ sleep 0.5
   $ hg debugwaitonprefetch >/dev/null 2>%1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0
@@ -108,11 +107,8 @@
   new changesets 6b4b6f66ef8c
   (run 'hg update' to get a working copy)
   prefetching file contents
-  $ sleep 0.5
   $ hg debugwaitonprefetch >/dev/null 2>%1
-  $ sleep 0.5
   $ hg debugwaitonrepack >/dev/null 2>%1
-  $ sleep 0.5
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histidx
   
$TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histpack
@@ -144,11 +140,8 @@
   $ hg up -r 0
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   * files fetched over * fetches - (* misses, 0.00% hit ratio) over *s (glob)
-  $ sleep 1
   $ hg debugwaitonprefetch >/dev/null 2>%1
-  $ sleep 1
   $ hg debugwaitonrepack >/dev/null 2>%1
-  $ sleep 1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
   
$TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
@@ -196,11 +189,8 @@
   $ hg commit -qAm b
   * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob)
   $ hg bookmark temporary
-  $ sleep 1
   $ hg debugwaitonprefetch >/dev/null 2>%1
-  $ sleep 1
   $ hg debugwaitonrepack >/dev/null 2>%1
-  $ sleep 1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
   
$TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
@@ -246,11 

D7586: remotefilelog: have command wait for background task in the tests

2019-12-11 Thread marmoute (Pierre-Yves David)
Closed by commit rHG88ab1295db4c: remotefilelog: have command wait for 
background task in the tests (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7586?vs=18551=18611

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

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

AFFECTED FILES
  tests/test-remotefilelog-bgprefetch.t
  tests/test-remotefilelog-repack-fast.t
  tests/test-remotefilelog-repack.t

CHANGE DETAILS

diff --git a/tests/test-remotefilelog-repack.t 
b/tests/test-remotefilelog-repack.t
--- a/tests/test-remotefilelog-repack.t
+++ b/tests/test-remotefilelog-repack.t
@@ -6,6 +6,7 @@
   $ cat >> $HGRCPATH < [devel]
   > remotefilelog.ensurestart=True
+  > remotefilelog.bg-wait=True
   > EOF
 
   $ hg init master
diff --git a/tests/test-remotefilelog-repack-fast.t 
b/tests/test-remotefilelog-repack-fast.t
--- a/tests/test-remotefilelog-repack-fast.t
+++ b/tests/test-remotefilelog-repack-fast.t
@@ -8,6 +8,7 @@
   > fastdatapack=True
   > [devel]
   > remotefilelog.ensurestart=True
+  > remotefilelog.bg-wait=True
   > EOF
 
   $ hg init master
diff --git a/tests/test-remotefilelog-bgprefetch.t 
b/tests/test-remotefilelog-bgprefetch.t
--- a/tests/test-remotefilelog-bgprefetch.t
+++ b/tests/test-remotefilelog-bgprefetch.t
@@ -6,6 +6,7 @@
   $ cat >> $HGRCPATH < [devel]
   > remotefilelog.ensurestart=True
+  > remotefilelog.bg-wait=True
   > EOF
 
   $ hg init master



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


D7585: remotefilelog: add a developer option to wait for background processes

2019-12-11 Thread marmoute (Pierre-Yves David)
Closed by commit rHG63bb6dc62f24: remotefilelog: add a developer option to wait 
for background processes (authored by marmoute).
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/D7585?vs=18550=18610

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

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

AFFECTED FILES
  hgext/remotefilelog/__init__.py
  hgext/remotefilelog/repack.py
  hgext/remotefilelog/shallowrepo.py

CHANGE DETAILS

diff --git a/hgext/remotefilelog/shallowrepo.py 
b/hgext/remotefilelog/shallowrepo.py
--- a/hgext/remotefilelog/shallowrepo.py
+++ b/hgext/remotefilelog/shallowrepo.py
@@ -232,8 +232,12 @@
 cmd += [b'-r', revs]
 # We know this command will find a binary, so don't block
 # on it starting.
+kwargs = {}
+if repo.ui.configbool(b'devel', b'remotefilelog.bg-wait'):
+kwargs['record_wait'] = repo.ui.atexit
+
 procutil.runbgcommand(
-cmd, encoding.environ, ensurestart=ensurestart
+cmd, encoding.environ, ensurestart=ensurestart, **kwargs
 )
 
 def prefetch(self, revs, base=None, pats=None, opts=None):
diff --git a/hgext/remotefilelog/repack.py b/hgext/remotefilelog/repack.py
--- a/hgext/remotefilelog/repack.py
+++ b/hgext/remotefilelog/repack.py
@@ -48,7 +48,13 @@
 cmd.append(b'--packsonly')
 repo.ui.warn(msg)
 # We know this command will find a binary, so don't block on it starting.
-procutil.runbgcommand(cmd, encoding.environ, ensurestart=ensurestart)
+kwargs = {}
+if repo.ui.configbool(b'devel', b'remotefilelog.bg-wait'):
+kwargs['record_wait'] = repo.ui.atexit
+
+procutil.runbgcommand(
+cmd, encoding.environ, ensurestart=ensurestart, **kwargs
+)
 
 
 def fullrepack(repo, options=None):
diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py
--- a/hgext/remotefilelog/__init__.py
+++ b/hgext/remotefilelog/__init__.py
@@ -230,6 +230,7 @@
 configitem(b'packs', b'maxchainlen', default=1000)
 
 configitem(b'devel', b'remotefilelog.ensurestart', default=False)
+configitem(b'devel', b'remotefilelog.bg-wait', default=False)
 
 #  default TTL limit is 30 days
 _defaultlimit = 60 * 60 * 24 * 30



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


D7588: remotefilelog: use the correct redirection in tests

2019-12-11 Thread marmoute (Pierre-Yves David)
Closed by commit rHGb6c7475595db: remotefilelog: use the correct redirection in 
tests (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7588?vs=18553=18613

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

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

AFFECTED FILES
  tests/test-remotefilelog-bgprefetch.t

CHANGE DETAILS

diff --git a/tests/test-remotefilelog-bgprefetch.t 
b/tests/test-remotefilelog-bgprefetch.t
--- a/tests/test-remotefilelog-bgprefetch.t
+++ b/tests/test-remotefilelog-bgprefetch.t
@@ -79,7 +79,7 @@
   new changesets 6b4b6f66ef8c
   (run 'hg update' to get a working copy)
   prefetching file contents
-  $ hg debugwaitonprefetch >/dev/null 2>%1
+  $ hg debugwaitonprefetch >/dev/null 2>&1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0
   
$TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
@@ -107,8 +107,8 @@
   new changesets 6b4b6f66ef8c
   (run 'hg update' to get a working copy)
   prefetching file contents
-  $ hg debugwaitonprefetch >/dev/null 2>%1
-  $ hg debugwaitonrepack >/dev/null 2>%1
+  $ hg debugwaitonprefetch >/dev/null 2>&1
+  $ hg debugwaitonrepack >/dev/null 2>&1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histidx
   
$TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histpack
@@ -140,8 +140,8 @@
   $ hg up -r 0
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   * files fetched over * fetches - (* misses, 0.00% hit ratio) over *s (glob)
-  $ hg debugwaitonprefetch >/dev/null 2>%1
-  $ hg debugwaitonrepack >/dev/null 2>%1
+  $ hg debugwaitonprefetch >/dev/null 2>&1
+  $ hg debugwaitonrepack >/dev/null 2>&1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
   
$TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
@@ -189,8 +189,8 @@
   $ hg commit -qAm b
   * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob)
   $ hg bookmark temporary
-  $ hg debugwaitonprefetch >/dev/null 2>%1
-  $ hg debugwaitonrepack >/dev/null 2>%1
+  $ hg debugwaitonprefetch >/dev/null 2>&1
+  $ hg debugwaitonrepack >/dev/null 2>&1
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
   
$TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
@@ -228,16 +228,16 @@
 # background prefetch with repack on rebase when wcprevset configured
 
   $ hg up -r 2
-  3 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  3 files updated, 0 files merged, 2 files removed, 0 files unresolved
   (leaving bookmark temporary)
   $ clearcache
   $ find $CACHEDIR -type f | sort
   $ hg rebase -s temporary -d foo
-  rebasing 3:58147a5b5242 "b" (temporary tip)
-  saved backup bundle to 
$TESTTMP/shallow/.hg/strip-backup/58147a5b5242-c3678817-rebase.hg
+  rebasing 3:d9cf06e3b5b6 "b" (temporary tip)
+  saved backup bundle to 
$TESTTMP/shallow/.hg/strip-backup/d9cf06e3b5b6-e5c3dc63-rebase.hg
   3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
-  $ hg debugwaitonprefetch >/dev/null 2>%1
-  $ hg debugwaitonrepack >/dev/null 2>%1
+  $ hg debugwaitonprefetch >/dev/null 2>&1
+  $ hg debugwaitonrepack >/dev/null 2>&1
 
 # Ensure that file 'y' was prefetched - it was not part of the rebase 
operation and therefore
 # could only be downloaded by the background prefetch
@@ -269,7 +269,7 @@
 # Check that foregound prefetch with no arguments blocks until background 
prefetches finish
 
   $ hg up -r 3
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ clearcache
   $ hg prefetch --repack
   waiting for lock on prefetching in $TESTTMP/shallow held by process * on 
host * (glob) (?)
@@ -277,7 +277,7 @@
   (running background incremental repack)
   * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) 
(?)
 
-  $ hg debugwaitonrepack >/dev/null 2>%1
+  $ hg debugwaitonrepack >/dev/null 2>&1
 
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
@@ -319,7 +319,7 @@
   got lock after * seconds (glob) (?)
   (running background incremental repack)
   * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) 
(?)
-  $ hg debugwaitonrepack >/dev/null 2>%1
+  $ hg debugwaitonrepack >/dev/null 2>&1
 
   $ find $CACHEDIR -type f | sort
   
$TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx



To: marmoute, #hg-reviewers, durin42
Cc: mercurial-devel

D7584: procutil: add a option to not fully detach background process

2019-12-11 Thread marmoute (Pierre-Yves David)
Closed by commit rHG15a6c6783060: procutil: add a option to not fully detach 
background process (authored by marmoute).
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/D7584?vs=18556=18609

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

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

AFFECTED FILES
  mercurial/utils/procutil.py

CHANGE DETAILS

diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py
--- a/mercurial/utils/procutil.py
+++ b/mercurial/utils/procutil.py
@@ -548,12 +548,18 @@
 _creationflags = DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP
 
 def runbgcommand(
-script, env, shell=False, stdout=None, stderr=None, ensurestart=True
+script,
+env,
+shell=False,
+stdout=None,
+stderr=None,
+ensurestart=True,
+record_wait=None,
 ):
 '''Spawn a command without waiting for it to finish.'''
 # we can't use close_fds *and* redirect stdin. I'm not sure that we
 # need to because the detached process has no console connection.
-subprocess.Popen(
+p = subprocess.Popen(
 tonativestr(script),
 shell=shell,
 env=tonativeenv(env),
@@ -562,46 +568,64 @@
 stdout=stdout,
 stderr=stderr,
 )
+if record_wait is not None:
+record_wait(p.wait)
 
 
 else:
 
 def runbgcommand(
-cmd, env, shell=False, stdout=None, stderr=None, ensurestart=True
+cmd,
+env,
+shell=False,
+stdout=None,
+stderr=None,
+ensurestart=True,
+record_wait=None,
 ):
-'''Spawn a command without waiting for it to finish.'''
+'''Spawn a command without waiting for it to finish.
+
+
+When `record_wait` is not None, the spawned process will not be fully
+detached and the `record_wait` argument will be called with a the
+`Subprocess.wait` function for the spawned process.  This is mostly
+useful for developers that need to make sure the spawned process
+finished before a certain point. (eg: writing test)'''
 # double-fork to completely detach from the parent process
 # based on http://code.activestate.com/recipes/278731
-pid = os.fork()
-if pid:
-if not ensurestart:
+if record_wait is None:
+pid = os.fork()
+if pid:
+if not ensurestart:
+return
+# Parent process
+(_pid, status) = os.waitpid(pid, 0)
+if os.WIFEXITED(status):
+returncode = os.WEXITSTATUS(status)
+else:
+returncode = -(os.WTERMSIG(status))
+if returncode != 0:
+# The child process's return code is 0 on success, an errno
+# value on failure, or 255 if we don't have a valid errno
+# value.
+#
+# (It would be slightly nicer to return the full exception 
info
+# over a pipe as the subprocess module does.  For now it
+# doesn't seem worth adding that complexity here, though.)
+if returncode == 255:
+returncode = errno.EINVAL
+raise OSError(
+returncode,
+b'error running %r: %s'
+% (cmd, os.strerror(returncode)),
+)
 return
-# Parent process
-(_pid, status) = os.waitpid(pid, 0)
-if os.WIFEXITED(status):
-returncode = os.WEXITSTATUS(status)
-else:
-returncode = -(os.WTERMSIG(status))
-if returncode != 0:
-# The child process's return code is 0 on success, an errno
-# value on failure, or 255 if we don't have a valid errno
-# value.
-#
-# (It would be slightly nicer to return the full exception info
-# over a pipe as the subprocess module does.  For now it
-# doesn't seem worth adding that complexity here, though.)
-if returncode == 255:
-returncode = errno.EINVAL
-raise OSError(
-returncode,
-b'error running %r: %s' % (cmd, os.strerror(returncode)),
-)
-return
 
 returncode = 255
 try:
-# Start a new session
-os.setsid()
+if record_wait is None:
+# Start a new session
+os.setsid()
 
 

D7529: rust-dirstate-status: add `walk_explicit` implementation, use `Matcher` trait

2019-12-11 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  This no longer applies cleanly (and doesn't build when applied with fuzz)

REPOSITORY
  rHG Mercurial

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

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

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


mercurial@43823: 5 new changesets

2019-12-11 Thread Mercurial Commits
5 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/e8a3bbffdc7d
changeset:   43819:e8a3bbffdc7d
user:Gregory Szorc 
date:Sat Dec 07 13:07:25 2019 -0800
summary: tests: add test for Rust formatting

https://www.mercurial-scm.org/repo/hg/rev/072b745936f1
changeset:   43820:072b745936f1
user:Martin von Zweigbergk 
date:Mon Dec 09 09:50:39 2019 -0800
summary: status: remove pointless filtering by alwaysmatcher in morestatus

https://www.mercurial-scm.org/repo/hg/rev/ea97cd64c500
changeset:   43821:ea97cd64c500
user:Matt Harbison 
date:Sat Dec 07 22:09:43 2019 -0500
summary: exchange: fix an attempt to format a list into bytes

https://www.mercurial-scm.org/repo/hg/rev/fb03cd716f50
changeset:   43822:fb03cd716f50
user:Matt Harbison 
date:Fri Dec 06 23:49:03 2019 -0500
summary: tests: stabilize test-extdiff.t on Windows

https://www.mercurial-scm.org/repo/hg/rev/3d53f9cc73ab
changeset:   43823:3d53f9cc73ab
bookmark:@
tag: tip
user:Gregory Szorc 
date:Thu Dec 05 17:42:38 2019 -0800
summary: automation: use latest Windows AMI as base

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


D7594: status: add template/json data about whether a file has unresolved conflicts

2019-12-11 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> cmdutil.py:792
> +def formatfile(self, path, fm):
> +if self.inmergestate and path in self.unresolvedpaths:
> +fm.data(unresolved=True)

That's an O(n) lookup. Probably fine since you very rarely have thousands of 
conflicts...

REPOSITORY
  rHG Mercurial

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

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

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


Re: [PATCH 1 of 2] crecord: repurpose "a" key to toggle all selections (BC)

2019-12-11 Thread Jordi Gutiérrez Hermoso
On Wed, 2019-12-11 at 10:41 +0100, Denis Laxalde wrote:
Jordi Gutiérrez Hermoso a écrit :
> > # HG changeset patch
> > # User Jordi Gutiérrez Hermoso 
> > # Date 1576015329 18000
> > #  Tue Dec 10 17:02:09 2019 -0500
> > # Node ID bd10bc4bdb994b875040c0c58f1c341df66ddd46
> > # Parent  ce088b38f92b6d480df2072dc45fb068443758dd
> > crecord: repurpose "a" key to toggle all selections (BC)
> > 

> Also this 'amend mode' seems only useful for 'commit --interactive';
> but it's currently also available for other interactive commands
> (e.g. 'revert --interactive', which makes no sense) so it's already
> weird.

Oh, right, I forgot about that. I've amended my commit message to also
include this point.

> Does "pretty harmless" mean that you can actually toggle back to the
> previous selection?

Yeah, all selections get flipped. Just hit "a" again to the same state
before you flipped them.

Honestly, the time I would use this most is when everything is
selected so I can start from zero selections. I so very often reach
for "A" at the beginning of my hunk selecting but accidentally hit "a"
and then I panic 'cause I forget what state it's in, so I just quit
the hunk selector and start over again from the command line.

> Also, this breaks tests in test-commit-interactive-curses.t (and it'd be
> nice to have some new test for the new feature).

Oh, oops. I thought I had ran the tests. There, tests fixed, and I
wrote a new test for toggling all lines.

> > diff --git a/mercurial/crecord.py b/mercurial/crecord.py
> > --- a/mercurial/crecord.py
> > +++ b/mercurial/crecord.py
> > @@ -990,6 +990,13 @@ class curseschunkselector(object):
> >  self.toggleapply(item)
> >  self.waslasttoggleallapplied = not self.waslasttoggleallapplied
> >  
> > +def flipselections(self):
> > +b"flip all selections"
> 
> Triple " without 'b' would be nicer.

Fixed. Thanks.

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


D7601: fuzz: fix test-fuzz-targets.t to run with python3

2019-12-11 Thread pulkit (Pulkit Goyal)
pulkit added inline comments.

INLINE COMMENTS

> mharbison72 wrote in mpatch_corpus.py:53
> Doesn't `__repr__` have to return `str` on py3?  It looks like there are few 
> other instances of this.

ha, yep. @spectral can you send a follow-up for this?

REPOSITORY
  rHG Mercurial

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

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

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


[PATCH 2 of 2 V2] crecord: remove toggleamend

2019-12-11 Thread Jordi Gutiérrez Hermoso
# HG changeset patch
# User Jordi Gutiérrez Hermoso 
# Date 1576015629 18000
#  Tue Dec 10 17:07:09 2019 -0500
# Node ID 80c8a53c2fcc2aeb510f60fee74ab25b68d59a15
# Parent  5b6b8f718cbfc70202537aa38f0179cb6f8275a8
crecord: remove toggleamend

Previous commit removed its only calling site.

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -1766,32 +1766,6 @@ are you sure you want to review/edit and
 else:
 return False
 
-def toggleamend(self, opts, test):
-"""Toggle the amend flag.
-
-When the amend flag is set, a commit will modify the most recently
-committed changeset, instead of creating a new changeset.  Otherwise, a
-new changeset will be created (the normal commit behavior).
-"""
-
-if opts.get(b'amend') is None:
-opts[b'amend'] = True
-msg = _(
-b"Amend option is turned on -- committing the currently "
-b"selected changes will not create a new changeset, but "
-b"instead update the most recently committed changeset.\n\n"
-b"Press any key to continue."
-)
-elif opts.get(b'amend') is True:
-opts[b'amend'] = None
-msg = _(
-b"Amend option is turned off -- committing the currently "
-b"selected changes will create a new changeset.\n\n"
-b"Press any key to continue."
-)
-if not test:
-self.confirmationwindow(msg)
-
 def recenterdisplayedarea(self):
 """
 once we scrolled with pg up pg down we can be pointing outside of the
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 2 V2] crecord: repurpose "a" key to toggle all selections (BC)

2019-12-11 Thread Jordi Gutiérrez Hermoso
# HG changeset patch
# User Jordi Gutiérrez Hermoso 
# Date 1576015329 18000
#  Tue Dec 10 17:02:09 2019 -0500
# Node ID 5b6b8f718cbfc70202537aa38f0179cb6f8275a8
# Parent  ce088b38f92b6d480df2072dc45fb068443758dd
crecord: repurpose "a" key to toggle all selections (BC)

I really don't like "a". I keep accidentally hitting it when I
actually want "A", and then I'm suddenly in a state I don't want to be
in. There's a big wall of text telling me that I've turned amend mode
on or off (which one was I orginally in?), and this seems very
useless.

If I wanted to amend or not, I would have chosen that from the
command-line, not change my mind after I've already started picking
hunks apart. Furthermore, for most uses of the hunk selector (revert,
uncommit, shelve/unshelve), this amend toggle doesn't make sense.

It seems much better to repurpose this key to be a "weaker" version of
"A". It toggles all selections. This is pretty harmless if hit
accidentally, (can just hit "a" again to toggle everything and undo
it), and has immediate visual feedback that something happened: all
the x's and blank spaces get switched around. And unlike with amend,
the current flipped state is also immediately visible without having
to read a wall of text.

I'm calling this a BC, however, because somewhere, someone out there
has probably really fallen in love with the old use of "a" and will
get angry that we took it away.

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -990,6 +990,16 @@ class curseschunkselector(object):
 self.toggleapply(item)
 self.waslasttoggleallapplied = not self.waslasttoggleallapplied
 
+def flipselections(self):
+"""
+Flip all selections. Every selected line is unselected and vice
+versa.
+"""
+for header in self.headerlist:
+for hunk in header.allchildren():
+for line in hunk.allchildren():
+self.toggleapply(line)
+
 def toggleallbetween(self):
 """toggle applied on or off for all items in range [lastapplied,
 current]. """
@@ -1637,7 +1647,7 @@ the following are valid keystrokes:
  ctrl-l : scroll the selected line to the top of the screen
   m : edit / resume editing the commit message
   e : edit the currently selected hunk
-  a : toggle amend mode, only with commit -i
+  a : toggle all selections
   c : confirm selected changes
   r : review/edit and confirm selected changes
   q : quit without confirming (no changes will be made)
@@ -1913,7 +1923,7 @@ are you sure you want to review/edit and
 elif keypressed in ["q"]:
 raise error.Abort(_(b'user quit'))
 elif keypressed in ['a']:
-self.toggleamend(self.opts, test)
+self.flipselections()
 elif keypressed in ["c"]:
 return True
 elif keypressed in ["r"]:
diff --git a/tests/test-commit-interactive-curses.t 
b/tests/test-commit-interactive-curses.t
--- a/tests/test-commit-interactive-curses.t
+++ b/tests/test-commit-interactive-curses.t
@@ -95,7 +95,7 @@ Committing only one hunk while aborting 
 - unfold it
 - go down to second hunk (1 for the first hunk, 1 for the first hunkline, 1 
for the second hunk, 1 for the second hunklike)
 - toggle the second hunk
-- toggle on and off the amend mode (to check that it toggles off)
+- toggle all lines twice (to check that it does nothing)
 - edit the hunk and quit the editor immediately with non-zero status
 - commit
 
@@ -193,20 +193,39 @@ Newly added files can be selected with t
   $ hg st
   ? testModeCommands
 
-Amend option works
+Test toggling all selections works
+
+- Change one line
+- Add an extra line at the end
+- Unselect all
+- Select the extra line at the end
+- Toggle all selections (so the extra line at the is unselected and the 
modified line is selected)
+- Commit
+
   $ echo "hello world" > x
-  $ hg diff -c .
-  diff -r a6735021574d -r 2b0e9be4d336 x
-  --- /dev/nullThu Jan 01 00:00:00 1970 +
+  $ echo "goodbye world" >> x
+  $ hg diff
+  diff -r 2b0e9be4d336 x
+  --- a/x  Thu Jan 01 00:00:00 1970 +
   +++ b/x  Thu Jan 01 00:00:00 1970 +
-  @@ -0,0 +1,1 @@
-  +hello
+  @@ -1,1 +1,2 @@
+  -hello
+  +hello world
+  +goodbye world
   $ cat  f
+  > j
+  > x
+  > j
+  > j
+  > j
+  > x
   > a
   > c
   > EOF
-  $ hg commit -i  -m "newly added file" -d "0 0"
+  $ hg commit -i --amend  -m "newly added file" -d "0 0" x
   saved backup bundle to 
$TESTTMP/a/.hg/strip-backup/2b0e9be4d336-3cf0bc8c-amend.hg
+  $ hg rev x --no-backup
   $ hg diff -c .
   diff -r a6735021574d -r c1d239d165ae x
   --- /dev/nullThu Jan 01 00:00:00 1970 +
___
Mercurial-devel mailing list

D7601: fuzz: fix test-fuzz-targets.t to run with python3

2019-12-11 Thread mharbison72 (Matt Harbison)
mharbison72 added inline comments.

INLINE COMMENTS

> mpatch_corpus.py:53
> +# py2 calls __repr__ when you do `bytes(foo)`
> +return self.__bytes__()
> +

Doesn't `__repr__` have to return `str` on py3?  It looks like there are few 
other instances of this.

REPOSITORY
  rHG Mercurial

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

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

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


D7570: match: resolve filesets against the passed `cwd`, not the current one

2019-12-11 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  In D7570#111783 , @martinvonz 
wrote:
  
  > In D7570#111295 , @yuja wrote:
  >
  >>>   if listsubrepos:
  >>>   for subpath in ctx.substate:
  >>>
  >>> - sm = ctx.sub(subpath).matchfileset(pat, badfn=badfn)
  >>>
  >>> +sm = ctx.sub(subpath).matchfileset(
  >>> +pat, badfn=badfn, cwd=cwd
  >>> +)
  >>
  >> Might have to adjust cwd since it may be relative to the parent's 
repo.root.
  
  Is this case any different from `hg -R path/to/repo ...`?
  
  > Do you think this patch is making it worse or can we leave it as is for now 
and let someone who cares about subrepos fix it?
  
  I'll look and see how easy it is to drop the subrepo stuff for now.  It isn't 
operative until somebody adds a `-S` or support for breaking paths on a subrepo 
boundary to the command anyway.
  
  The real trap here is catching all of the subrepo references in the parent.  
Say you have a repo that maps like this:
  
2 -> S1
1 -> S1
  
  If you `hg fix -r 2` and it edits S1, that will cause parent rev 1 to be 
dangling.  I guess we could modify `.hgsubstate` in 1 too without running 
fixers there.  But what if 1 is already public?  The preflight checks will be 
extensive.  That said, I'd like to get this sort of thing working because the 
UX with editing a subrepo is *really* bad, especially if you're editing 
anything other than the subrepo tip.
  
  >>> class matchctx(object):
  >>>
  >>> - def __init__(self, basectx, ctx, badfn=None):
  >>>
  >>> +def __init__(self, basectx, ctx, badfn=None, cwd=None):
  >>>
  >>>   self._basectx = basectx
  >>>   self.ctx = ctx
  >>>   self._badfn = badfn
  >>>   self._match = None
  >>>   self._status = None
  >>>
  >>> +self.cwd = cwd
  >>>
  >>>   def narrowed(self, match):
  >>>   """Create matchctx for a sub-tree narrowed by the given matcher"""
  >>
  >> Perhaps self.cwd would have to be copied to the matchctx objects created
  >> by itself.
  >> One option to detect this kind of bugs is to remove the default parameters.
  >
  > Good idea, I've updated Matt's patch with that suggestion.
  
  Thanks!

REPOSITORY
  rHG Mercurial

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

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

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


D7593: status: split morestatus data loading from display

2019-12-11 Thread rdamazio (Rodrigo Damazio Bovendorp)
Closed by commit rHGfb4a6d584756: status: split morestatus data loading from 
display (authored by rdamazio).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7593?vs=18586=18605

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

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

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6867,6 +6867,12 @@
 ) and not opts.get(b'no_status'):
 copy = copies.pathcopies(ctx1, ctx2, m)
 
+morestatus = None
+if (
+ui.verbose or ui.configbool(b'commands', b'status.verbose')
+) and not ui.plain():
+morestatus = cmdutil.readmorestatus(repo)
+
 ui.pager(b'status')
 fm = ui.formatter(b'status', opts)
 fmt = b'%s' + end
@@ -6888,10 +6894,8 @@
 label=b'status.copied',
 )
 
-if (
-ui.verbose or ui.configbool(b'commands', b'status.verbose')
-) and not ui.plain():
-cmdutil.morestatus(repo, fm)
+if morestatus:
+morestatus.formatfooter(fm)
 fm.end()
 
 
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -24,6 +24,7 @@
 open,
 setattr,
 )
+from .thirdparty import attr
 
 from . import (
 bookmarks,
@@ -778,47 +779,66 @@
 return b'\n'.join(commentedlines) + b'\n'
 
 
-def _conflictsmsg(repo):
-mergestate = mergemod.mergestate.read(repo)
-if not mergestate.active():
-return
-
-unresolvedlist = sorted(mergestate.unresolved())
-if unresolvedlist:
-mergeliststr = b'\n'.join(
-[
-b'%s' % util.pathto(repo.root, encoding.getcwd(), path)
-for path in unresolvedlist
-]
-)
-msg = (
-_(
-'''Unresolved merge conflicts:
+@attr.s(frozen=True)
+class morestatus(object):
+reporoot = attr.ib()
+unfinishedop = attr.ib()
+unfinishedmsg = attr.ib()
+inmergestate = attr.ib()
+unresolvedpaths = attr.ib()
+_label = b'status.morestatus'
+
+def formatfooter(self, fm):
+statemsg = _(b'The repository is in an unfinished *%s* state.'
+ ) % self.unfinishedop
+fm.plain(b'%s\n' % _commentlines(statemsg), label=self._label)
+
+self._formatconflicts(fm)
+if self.unfinishedmsg:
+fm.plain(b'%s\n' % _commentlines(self.unfinishedmsg),
+ label=self._label)
+
+def _formatconflicts(self, fm):
+if not self.inmergestate:
+return
+
+if self.unresolvedpaths:
+mergeliststr = b'\n'.join(
+[
+b'%s' % util.pathto(self.reporoot, encoding.getcwd(),
+path)
+for path in self.unresolvedpaths
+]
+)
+msg = (
+_(
+'''Unresolved merge conflicts:
 
 %s
 
 To mark files as resolved:  hg resolve --mark FILE'''
+)
+% mergeliststr
 )
-% mergeliststr
-)
-else:
-msg = _(b'No unresolved merge conflicts.')
-
-return _commentlines(msg)
-
-
-def morestatus(repo, fm):
+else:
+msg = _(b'No unresolved merge conflicts.')
+
+fm.plain(b'%s\n' % _commentlines(msg), label=self._label)
+
+
+def readmorestatus(repo):
+"""Returns a morestatus object if the repo has unfinished state."""
 statetuple = statemod.getrepostate(repo)
-label = b'status.morestatus'
-if statetuple:
-state, helpfulmsg = statetuple
-statemsg = _(b'The repository is in an unfinished *%s* state.') % state
-fm.plain(b'%s\n' % _commentlines(statemsg), label=label)
-conmsg = _conflictsmsg(repo)
-if conmsg:
-fm.plain(b'%s\n' % conmsg, label=label)
-if helpfulmsg:
-fm.plain(b'%s\n' % _commentlines(helpfulmsg), label=label)
+if not statetuple:
+return None
+
+unfinishedop, unfinishedmsg = statetuple
+mergestate = mergemod.mergestate.read(repo)
+unresolved = None
+if mergestate.active():
+unresolved = sorted(mergestate.unresolved())
+return morestatus(repo.root, unfinishedop, unfinishedmsg,
+  unresolved is not None, unresolved)
 
 
 def findpossible(cmd, table, strict=False):



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


D7594: status: add template/json data about whether a file has unresolved conflicts

2019-12-11 Thread rdamazio (Rodrigo Damazio Bovendorp)
Closed by commit rHG7315464f0613: status: add template/json data about whether 
a file has unresolved conflicts (authored by rdamazio).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7594?vs=18587=18606

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

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

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

CHANGE DETAILS

diff --git a/tests/test-conflict.t b/tests/test-conflict.t
--- a/tests/test-conflict.t
+++ b/tests/test-conflict.t
@@ -64,7 +64,8 @@
   [
{
 "path": "a",
-"status": "M"
+"status": "M",
+"unresolved": true
},
{
 "path": "a.orig",
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6893,6 +6893,8 @@
 (b'  %s' + end) % uipathfn(copy[f]),
 label=b'status.copied',
 )
+if morestatus:
+morestatus.formatfile(f, fm)
 
 if morestatus:
 morestatus.formatfooter(fm)
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -788,6 +788,10 @@
 unresolvedpaths = attr.ib()
 _label = b'status.morestatus'
 
+def formatfile(self, path, fm):
+if self.inmergestate and path in self.unresolvedpaths:
+fm.data(unresolved=True)
+
 def formatfooter(self, fm):
 statemsg = _(b'The repository is in an unfinished *%s* state.'
  ) % self.unfinishedop



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


D7600: fuzz: add a seed corpus for the dirs fuzzer

2019-12-11 Thread durin42 (Augie Fackler)
Closed by commit rHGb7af8a02a304: fuzz: add a seed corpus for the dirs fuzzer 
(authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7600?vs=18594=18608

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

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

AFFECTED FILES
  contrib/fuzz/Makefile
  contrib/fuzz/dirs_corpus.py

CHANGE DETAILS

diff --git a/contrib/fuzz/dirs_corpus.py b/contrib/fuzz/dirs_corpus.py
new file mode 100644
--- /dev/null
+++ b/contrib/fuzz/dirs_corpus.py
@@ -0,0 +1,29 @@
+from __future__ import absolute_import, print_function
+
+import argparse
+import zipfile
+
+ap = argparse.ArgumentParser()
+ap.add_argument("out", metavar="some.zip", type=str, nargs=1)
+args = ap.parse_args()
+
+with zipfile.ZipFile(args.out[0], "w", zipfile.ZIP_STORED) as zf:
+zf.writestr(
+"greek-tree",
+"\n".join(
+[
+"iota",
+"A/mu",
+"A/B/lambda",
+"A/B/E/alpha",
+"A/B/E/beta",
+"A/D/gamma",
+"A/D/G/pi",
+"A/D/G/rho",
+"A/D/G/tau",
+"A/D/H/chi",
+"A/D/H/omega",
+"A/D/H/psi",
+]
+),
+)
diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -62,7 +62,7 @@
 
 PARSERS_OBJS=parsers-manifest.o parsers-charencode.o parsers-parsers.o 
parsers-dirs.o parsers-pathencode.o parsers-revlog.o
 
-dirs_fuzzer: dirs.cc pyutil.o $(PARSERS_OBJS)
+dirs_fuzzer: dirs.cc pyutil.o $(PARSERS_OBJS) $$OUT/dirs_fuzzer_seed_corpus.zip
$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
  -Wno-register -Wno-macro-redefined \
  -I../../mercurial dirs.cc \



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


D7599: fuzz: clean up production of seed corpora

2019-12-11 Thread durin42 (Augie Fackler)
Closed by commit rHGd74d78aa74e9: fuzz: clean up production of seed corpora 
(authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7599?vs=18593=18607

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

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

AFFECTED FILES
  contrib/fuzz/Makefile

CHANGE DETAILS

diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -18,6 +18,9 @@
 
 standalone_fuzz_target_runner.o: standalone_fuzz_target_runner.cc
 
+$$OUT/%_fuzzer_seed_corpus.zip: %_corpus.py
+   python $< $@
+
 pyutil.o: pyutil.cc pyutil.h
$(CXX) $(CXXFLAGS) -g -O1 \
  `$(PYTHON_CONFIG) --cflags` \
@@ -38,14 +41,11 @@
 mpatch-oss-fuzz.o: ../../mercurial/mpatch.c
$(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c
 
-mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o 
+mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o $$OUT/mpatch_fuzzer_seed_corpus.zip
$(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \
  mpatch-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \
  $$OUT/mpatch_fuzzer
 
-mpatch_corpus.zip:
-   python mpatch_corpus.py $$OUT/mpatch_fuzzer_seed_corpus.zip
-
 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c 
../../mercurial/thirdparty/xdiff/*.h
$(CC) $(CFLAGS) -c \
  -o $@ \
@@ -86,10 +86,7 @@
  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
  -o $$OUT/jsonescapeu8fast_fuzzer
 
-manifest_corpus.zip:
-   python manifest_corpus.py $$OUT/manifest_fuzzer_seed_corpus.zip
-
-manifest_fuzzer: manifest.cc pyutil.o $(PARSERS_OBJS)
+manifest_fuzzer: manifest.cc pyutil.o $(PARSERS_OBJS) 
$$OUT/manifest_fuzzer_seed_corpus.zip
$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
  -Wno-register -Wno-macro-redefined \
  -I../../mercurial manifest.cc \
@@ -97,7 +94,7 @@
  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
  -o $$OUT/manifest_fuzzer
 
-revlog_fuzzer: revlog.cc pyutil.o $(PARSERS_OBJS)
+revlog_fuzzer: revlog.cc pyutil.o $(PARSERS_OBJS) 
$$OUT/revlog_fuzzer_seed_corpus.zip
$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
  -Wno-register -Wno-macro-redefined \
  -I../../mercurial revlog.cc \
@@ -105,10 +102,7 @@
  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
  -o $$OUT/revlog_fuzzer
 
-revlog_corpus.zip:
-   python revlog_corpus.py $$OUT/revlog_fuzzer_seed_corpus.zip
-
-dirstate_fuzzer: dirstate.cc pyutil.o $(PARSERS_OBJS)
+dirstate_fuzzer: dirstate.cc pyutil.o $(PARSERS_OBJS) 
$$OUT/dirstate_fuzzer_seed_corpus.zip
$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
  -Wno-register -Wno-macro-redefined \
  -I../../mercurial dirstate.cc \
@@ -116,10 +110,7 @@
  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
  -o $$OUT/dirstate_fuzzer
 
-dirstate_corpus.zip:
-   python dirstate_corpus.py $$OUT/dirstate_fuzzer_seed_corpus.zip
-
-fm1readmarkers_fuzzer: fm1readmarkers.cc pyutil.o $(PARSERS_OBJS)
+fm1readmarkers_fuzzer: fm1readmarkers.cc pyutil.o $(PARSERS_OBJS) 
$$OUT/fm1readmarkers_fuzzer_seed_corpus.zip
$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
  -Wno-register -Wno-macro-redefined \
  -I../../mercurial fm1readmarkers.cc \
@@ -127,15 +118,12 @@
  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
  -o $$OUT/fm1readmarkers_fuzzer
 
-fm1readmarkers_corpus.zip:
-   python fm1readmarkers_corpus.py 
$$OUT/fm1readmarkers_fuzzer_seed_corpus.zip
-
 clean:
$(RM) *.o *_fuzzer \
  bdiff \
  mpatch \
  xdiff
 
-oss-fuzz: bdiff_fuzzer mpatch_fuzzer mpatch_corpus.zip xdiff_fuzzer 
dirs_fuzzer fncache_fuzzer jsonescapeu8fast_fuzzer manifest_fuzzer 
manifest_corpus.zip revlog_fuzzer revlog_corpus.zip dirstate_fuzzer 
dirstate_corpus.zip fm1readmarkers_fuzzer fm1readmarkers_corpus.zip
+oss-fuzz: bdiff_fuzzer mpatch_fuzzer xdiff_fuzzer dirs_fuzzer fncache_fuzzer 
jsonescapeu8fast_fuzzer manifest_fuzzer revlog_fuzzer dirstate_fuzzer 
fm1readmarkers_fuzzer
 
 .PHONY: all clean oss-fuzz



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


D7506: phabricator: add a "phabstatus" show view

2019-12-11 Thread dlax (Denis Laxalde)
Closed by commit rHG70060915c3f2: phabricator: add a phabstatus 
show view (authored by dlax).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7506?vs=18589=18603

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

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -11,6 +11,10 @@
 revisions in a format suitable for :hg:`import`, and a ``phabupdate`` command
 to update statuses in batch.
 
+A "phabstatus" view for :hg:`show` is also provided; it displays status
+information of Phabricator differentials associated with unfinished
+changesets.
+
 By default, Phabricator requires ``Test Plan`` which might prevent some
 changeset from being sent. The requirement could be disabled by changing
 ``differential.require-test-plan-field`` config server side.
@@ -60,7 +64,9 @@
 encoding,
 error,
 exthelper,
+graphmod,
 httpconnection as httpconnectionmod,
+logcmdutil,
 match,
 mdiff,
 obsutil,
@@ -80,6 +86,8 @@
 procutil,
 stringutil,
 )
+from . import show
+
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' 
for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
@@ -465,6 +473,29 @@
 return result
 
 
+def getdrevmap(repo, revs):
+"""Return a dict mapping each rev in `revs` to their Differential Revision
+ID or None.
+"""
+result = {}
+for rev in revs:
+result[rev] = None
+ctx = repo[rev]
+# Check commit message
+m = _differentialrevisiondescre.search(ctx.description())
+if m:
+result[rev] = int(m.group('id'))
+continue
+# Check tags
+for tag in repo.nodetags(ctx.node()):
+m = _differentialrevisiontagre.match(tag)
+if m:
+result[rev] = int(m.group(1))
+break
+
+return result
+
+
 def getdiff(ctx, diffopts):
 """plain-text diff without header (user, commit message, etc)"""
 output = util.stringio()
@@ -1651,3 +1682,42 @@
 
 return templateutil.hybriddict({b'url': url, b'id': t,})
 return None
+
+
+@show.showview(b'phabstatus', csettopic=b'work')
+def phabstatusshowview(ui, repo, displayer):
+"""Phabricator differiential status"""
+revs = repo.revs('sort(_underway(), topo)')
+drevmap = getdrevmap(repo, revs)
+unknownrevs, drevids, revsbydrevid = [], set([]), {}
+for rev, drevid in pycompat.iteritems(drevmap):
+if drevid is not None:
+drevids.add(drevid)
+revsbydrevid.setdefault(drevid, set([])).add(rev)
+else:
+unknownrevs.append(rev)
+
+drevs = callconduit(ui, b'differential.query', {b'ids': list(drevids)})
+drevsbyrev = {}
+for drev in drevs:
+for rev in revsbydrevid[int(drev[b'id'])]:
+drevsbyrev[rev] = drev
+
+def phabstatus(ctx):
+drev = drevsbyrev[ctx.rev()]
+ui.write(b"\n%(uri)s %(statusName)s\n" % drev)
+
+revs -= smartset.baseset(unknownrevs)
+revdag = graphmod.dagwalker(repo, revs)
+
+ui.setconfig(b'experimental', b'graphshorten', True)
+displayer._exthook = phabstatus
+nodelen = show.longestshortest(repo, revs)
+logcmdutil.displaygraph(
+ui,
+repo,
+revdag,
+displayer,
+graphmod.asciiedges,
+props={b'nodelen': nodelen},
+)



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


D7507: phabricator: add a "phabstatus" template keyword

2019-12-11 Thread dlax (Denis Laxalde)
Closed by commit rHG79c0121220e3: phabricator: add a phabstatus 
template keyword (authored by dlax).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7507?vs=18590=18604

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

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -1684,6 +1684,28 @@
 return None
 
 
+@eh.templatekeyword(b'phabstatus', requires={b'ctx', b'repo', b'ui'})
+def template_status(context, mapping):
+""":phabstatus: String. Status of Phabricator differential.
+"""
+ctx = context.resource(mapping, b'ctx')
+repo = context.resource(mapping, b'repo')
+ui = context.resource(mapping, b'ui')
+
+rev = ctx.rev()
+try:
+drevid = getdrevmap(repo, [rev])[rev]
+except KeyError:
+return None
+drevs = callconduit(ui, b'differential.query', {b'ids': [drevid]})
+for drev in drevs:
+if int(drev[b'id']) == drevid:
+return templateutil.hybriddict(
+{b'url': drev[b'uri'], b'status': drev[b'statusName'],}
+)
+return None
+
+
 @show.showview(b'phabstatus', csettopic=b'work')
 def phabstatusshowview(ui, repo, displayer):
 """Phabricator differiential status"""



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


D7597: dirs: fix out-of-bounds access in Py3

2019-12-11 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHGa47ccdcce4f9: dirs: fix out-of-bounds access in Py3 
(authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7597?vs=18591=18602

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

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

AFFECTED FILES
  mercurial/cext/dirs.c

CHANGE DETAILS

diff --git a/mercurial/cext/dirs.c b/mercurial/cext/dirs.c
--- a/mercurial/cext/dirs.c
+++ b/mercurial/cext/dirs.c
@@ -14,7 +14,7 @@
 #include "util.h"
 
 #ifdef IS_PY3K
-#define PYLONG_VALUE(o) ((PyLongObject *)o)->ob_digit[1]
+#define PYLONG_VALUE(o) ((PyLongObject *)o)->ob_digit[0]
 #else
 #define PYLONG_VALUE(o) PyInt_AS_LONG(o)
 #endif



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


D7602: manifestcache: add some test involving shares

2019-12-11 Thread marmoute (Pierre-Yves David)
Closed by commit rHG8377570a36a9: manifestcache: add some test involving shares 
(authored by marmoute).
This revision was automatically updated to reflect the committed changes.

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D7602?vs=18597=18601#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7602?vs=18597=18601

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

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

AFFECTED FILES
  tests/test-manifest.t

CHANGE DETAILS

diff --git a/tests/test-manifest.t b/tests/test-manifest.t
--- a/tests/test-manifest.t
+++ b/tests/test-manifest.t
@@ -276,3 +276,103 @@
   crosschecking files in changesets and manifests
   checking files
   checked 2 changesets with 9 changes to 9 files
+  $ cd ..
+
+Test manifest cache interraction with shares
+
+
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo 'share=' >> $HGRCPATH
+
+creating some history
+
+  $ hg init share-source
+  $ hg debugbuilddag .+10 -n -R share-source
+  $ hg log --debug -r . -R share-source | grep 'manifest:'
+  manifest:-1:
+  $ hg log -r . -R share-source
+  changeset:   -1:
+  user:
+  date:Thu Jan 01 00:00:00 1970 +
+  
+  $ hg debugmanifestfulltextcache -R share-source
+  cache contains 4 manifest entries, in order of most to least recent:
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
+  id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
+  id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes
+  total cache data size 1.76 KB, on-disk 1.76 KB
+  $ hg -R share-source update 1
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg debugmanifestfulltextcache -R share-source
+  cache contains 4 manifest entries, in order of most to least recent:
+  id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
+  id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
+  total cache data size 1.50 KB, on-disk 1.50 KB
+
+making a share out of it. It should have its manifest cache updated
+
+  $ hg share share-source share-dest
+  updating working directory
+  11 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log --debug -r . -R share-dest | grep 'manifest:'
+  manifest:10:b264454d7033405774b9f353b9b37a082c1a8fba
+  $ hg debugmanifestfulltextcache -R share-dest
+  cache contains 1 manifest entries, in order of most to least recent:
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  total cache data size 520 bytes, on-disk 520 bytes
+
+update on various side should only affect the target share
+
+  $ hg update -R share-dest 4
+  0 files updated, 0 files merged, 6 files removed, 0 files unresolved
+  $ hg log --debug -r . -R share-dest | grep 'manifest:'
+  manifest:4:d45ead487afec2588272fcec88a25413c0ec7dc8
+  $ hg debugmanifestfulltextcache -R share-dest
+  cache contains 2 manifest entries, in order of most to least recent:
+  id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  total cache data size 769 bytes, on-disk 769 bytes
+  $ hg debugmanifestfulltextcache -R share-source
+  cache contains 4 manifest entries, in order of most to least recent:
+  id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
+  id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
+  total cache data size 1.50 KB, on-disk 1.50 KB
+  $ hg update -R share-source 7
+  6 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log --debug -r . -R share-source | grep 'manifest:'
+  manifest:7:7d32499319983d90f97ca02a6c2057a1030bebbb
+  $ hg debugmanifestfulltextcache -R share-dest
+  cache contains 2 manifest entries, in order of most to least recent:
+  id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  total cache data size 769 bytes, on-disk 769 bytes
+  $ hg debugmanifestfulltextcache -R share-source
+  cache contains 4 manifest entries, in order of most to least recent:
+  id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes
+  id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
+  total cache data size 1.46 KB, on-disk 1.46 KB
+  $ hg update -R share-dest 8
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log --debug -r . -R share-dest | grep 

D7601: fuzz: fix test-fuzz-targets.t to run with python3

2019-12-11 Thread spectral (Kyle Lippincott)
Closed by commit rHGba84a1ae4ae5: fuzz: fix test-fuzz-targets.t to run with 
python3 (authored by spectral).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7601?vs=18595=18600

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

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

AFFECTED FILES
  contrib/fuzz/dirstate_corpus.py
  contrib/fuzz/mpatch_corpus.py
  contrib/fuzz/revlog_corpus.py

CHANGE DETAILS

diff --git a/contrib/fuzz/revlog_corpus.py b/contrib/fuzz/revlog_corpus.py
--- a/contrib/fuzz/revlog_corpus.py
+++ b/contrib/fuzz/revlog_corpus.py
@@ -18,8 +18,8 @@
 
 with zipfile.ZipFile(args.out[0], "w", zipfile.ZIP_STORED) as zf:
 if os.path.exists(changelog):
-with open(changelog) as f:
+with open(changelog, 'rb') as f:
 zf.writestr("00changelog.i", f.read())
 if os.path.exists(contributing):
-with open(contributing) as f:
+with open(contributing, 'rb') as f:
 zf.writestr("contributing.i", f.read())
diff --git a/contrib/fuzz/mpatch_corpus.py b/contrib/fuzz/mpatch_corpus.py
--- a/contrib/fuzz/mpatch_corpus.py
+++ b/contrib/fuzz/mpatch_corpus.py
@@ -20,7 +20,11 @@
 self.end = end
 self.data = data
 
-def __str__(self):
+def __repr__(self):
+# py2 calls __repr__ when you do `bytes(foo)`
+return self.__bytes__()
+
+def __bytes__(self):
 return (
 struct.pack(">lll", self.start, self.end, len(self.data))
 + self.data
@@ -31,8 +35,12 @@
 def __init__(self, frags):
 self.frags = frags
 
-def __str__(self):
-return ''.join(str(f) for f in self.frags)
+def __repr__(self):
+# py2 calls __repr__ when you do `bytes(foo)`
+return self.__bytes__()
+
+def __bytes__(self):
+return b''.join(bytes(f) for f in self.frags)
 
 
 class corpus(object):
@@ -40,8 +48,12 @@
 self.base = base
 self.deltas = deltas
 
-def __str__(self):
-deltas = [str(d) for d in self.deltas]
+def __repr__(self):
+# py2 calls __repr__ when you do `bytes(foo)`
+return self.__bytes__()
+
+def __bytes__(self):
+deltas = [bytes(d) for d in self.deltas]
 parts = (
 [
 struct.pack(">B", len(deltas) + 1),
@@ -51,300 +63,301 @@
 + [self.base]
 + deltas
 )
-return "".join(parts)
+return b''.join(parts)
 
 
 with zipfile.ZipFile(args.out[0], "w", zipfile.ZIP_STORED) as zf:
 # Manually constructed entries
 zf.writestr(
-"one_delta_applies", str(corpus('a', [delta([deltafrag(0, 1, 'b')])]))
+"one_delta_applies",
+bytes(corpus(b'a', [delta([deltafrag(0, 1, b'b')])]))
 )
 zf.writestr(
 "one_delta_starts_late",
-str(corpus('a', [delta([deltafrag(3, 1, 'b')])])),
+bytes(corpus(b'a', [delta([deltafrag(3, 1, b'b')])]))
 )
 zf.writestr(
 "one_delta_ends_late",
-str(corpus('a', [delta([deltafrag(0, 20, 'b')])])),
+bytes(corpus(b'a', [delta([deltafrag(0, 20, b'b')])]))
 )
 
 try:
 # Generated from repo data
-r = hg.repository(uimod.ui(), '../..')
-fl = r.file('mercurial/manifest.py')
+r = hg.repository(uimod.ui(), b'../..')
+fl = r.file(b'mercurial/manifest.py')
 rl = getattr(fl, '_revlog', fl)
 bins = rl._chunks(rl._deltachain(10)[0])
-zf.writestr('manifest_py_rev_10', str(corpus(bins[0], bins[1:])))
+zf.writestr('manifest_py_rev_10', bytes(corpus(bins[0], bins[1:])))
 except:  # skip this, so no re-raises
 print('skipping seed file from repo data')
 # Automatically discovered by running the fuzzer
 zf.writestr(
-"mpatch_decode_old_overread", "\x02\x00\x00\x00\x02\x00\x00\x00"
+"mpatch_decode_old_overread", b"\x02\x00\x00\x00\x02\x00\x00\x00"
 )
 # https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8876
 zf.writestr(
 "mpatch_ossfuzz_getbe32_ubsan",
-"\x02\x00\x00\x00\x0c\xff\xff\xff\xff",
+b"\x02\x00\x00\x00\x0c\xff\xff\xff\xff",
 )
 zf.writestr(
 "mpatch_apply_over_memcpy",
-'\x13\x01\x00\x05\xd0\x00\x00\x00\x00\x00\x00\x00\x00\n \x00\x00\x00'
-'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00'
-'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-

D7598: py3: fix a bytes vs str issue in remotefilelog extension

2019-12-11 Thread spectral (Kyle Lippincott)
Closed by commit rHG94670e124d29: py3: fix a bytes vs str issue in 
remotefilelog extension (authored by spectral).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7598?vs=18592=18599

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

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

AFFECTED FILES
  hgext/remotefilelog/fileserverclient.py

CHANGE DETAILS

diff --git a/hgext/remotefilelog/fileserverclient.py 
b/hgext/remotefilelog/fileserverclient.py
--- a/hgext/remotefilelog/fileserverclient.py
+++ b/hgext/remotefilelog/fileserverclient.py
@@ -663,5 +663,5 @@
 self.ui.log(
 b'remotefilelog',
 b'excess remotefilelog fetching:\n%s\n',
-b''.join(traceback.format_stack()),
+b''.join(pycompat.sysbytes(traceback.format_stack())),
 )



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


D7603: cext-revlog: fixed __delitem__ for uninitialized nodetree

2019-12-11 Thread gracinet (Georges Racinet)
gracinet created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is a bug in a code path that's seldom used, because in practice
  (at least in the whole test suite), calls to `del index[i:j]` currently
  just don't happen before the nodetree has been initialized.
  However, in our current work to replace the nodetree by a Rust implementation,
  this is of course systematic.
  
  In `index_slice_del()`, if the slice start is smaller than `self->length`,
  the whole of `self->added` has to be cleared.
  
  Before this change, the clearing was done only by the call to
  `index_invalidate_added(self, 0)`, that happens only for initialized
  nodetrees. Hence the removal was effective only from `start` to 
`self->length`.
  
  The consequence is index corruption, with bogus results in subsequent calls,
  and in particular errors such as `ValueError("parent out of range")`, due to
  the fact that parents of entries in `self->added` are now just invalid.
  
  This is detected by the rebase tests, under conditions that the nodetree
  of revlog.c is never initialized. The provided specific test is more direct.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/cext/revlog.c
  tests/test-parseindex2.py

CHANGE DETAILS

diff --git a/tests/test-parseindex2.py b/tests/test-parseindex2.py
--- a/tests/test-parseindex2.py
+++ b/tests/test-parseindex2.py
@@ -247,6 +247,32 @@
 got = index[-1]
 self.assertEqual(want, got)  # no inline data
 
+def testdelitemwithoutnodetree(self):
+index, _junk = parsers.parse_index2(data_non_inlined, False)
+
+def hexrev(rev):
+if rev == nullrev:
+return b'\xff\xff\xff\xff'
+else:
+return nodemod.bin('%08x' % rev)
+
+def appendrev(p1, p2=nullrev):
+# node won't matter for this test, let's just make sure
+# they don't collide. Other data don't matter either.
+node = hexrev(p1) + hexrev(p2) + b'.' * 12
+index.append((0, 0, 12, 1, 34, p1, p2, node))
+
+appendrev(4)
+appendrev(5)
+appendrev(6)
+self.assertEqual(len(index), 7)
+
+del index[1:7]
+
+# assertions that failed before correction
+self.assertEqual(len(index), 1)  # was 4
+self.assertEqual(index.headrevs(), [0])  # gave ValueError
+
 
 if __name__ == '__main__':
 import silenttestrunner
diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -2522,7 +2522,10 @@
index_invalidate_added(self, 0);
if (self->ntrev > start)
self->ntrev = (int)start;
+   } else if (self->added) {
+   Py_CLEAR(self->added);
}
+
self->length = start;
if (start < self->raw_length) {
if (self->cache) {



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


D7586: remotefilelog: have command wait for background task in the tests

2019-12-11 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  For those who wants to see the test misbehaving, your just need to run it in 
a loop on heavy load:
  `python run-tests.py --runs-per-test 1 --loop -j 90 
test-remotefilelog-bgprefetch.t`

REPOSITORY
  rHG Mercurial

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

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

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


D7602: manifestcache: add some test involving shares

2019-12-11 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Some issue around shares have been reported. I am adding tests to better cover
  the share case. The test show that the code behave as expected so far.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-manifest.t

CHANGE DETAILS

diff --git a/tests/test-manifest.t b/tests/test-manifest.t
--- a/tests/test-manifest.t
+++ b/tests/test-manifest.t
@@ -276,3 +276,103 @@
   crosschecking files in changesets and manifests
   checking files
   checked 2 changesets with 9 changes to 9 files
+  $ cd ..
+
+Test manifest cache interraction with shares
+
+
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo 'share=' >> $HGRCPATH
+
+creating some history
+
+  $ hg init share-source
+  $ hg debugbuilddag .+10 -n -R share-source
+  $ hg log --debug -r . -R share-source | grep 'manifest:'
+  manifest:-1:
+  $ hg log -r . -R share-source 
+  changeset:   -1:
+  user:
+  date:Thu Jan 01 00:00:00 1970 +
+  
+  $ hg debugmanifestfulltextcache -R share-source
+  cache contains 4 manifest entries, in order of most to least recent:
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
+  id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
+  id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes
+  total cache data size 1.76 KB, on-disk 1.76 KB
+  $ hg -R share-source update 1
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg debugmanifestfulltextcache -R share-source
+  cache contains 4 manifest entries, in order of most to least recent:
+  id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
+  id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
+  total cache data size 1.50 KB, on-disk 1.50 KB
+
+making a share out of it. It should have its manifest cache updated
+
+  $ hg share share-source share-dest
+  updating working directory
+  11 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log --debug -r . -R share-dest | grep 'manifest:'
+  manifest:10:b264454d7033405774b9f353b9b37a082c1a8fba
+  $ hg debugmanifestfulltextcache -R share-dest
+  cache contains 1 manifest entries, in order of most to least recent:
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  total cache data size 520 bytes, on-disk 520 bytes
+
+update on various side should only affect the target share
+
+  $ hg update -R share-dest 4
+  0 files updated, 0 files merged, 6 files removed, 0 files unresolved
+  $ hg log --debug -r . -R share-dest | grep 'manifest:'
+  manifest:4:d45ead487afec2588272fcec88a25413c0ec7dc8
+  $ hg debugmanifestfulltextcache -R share-dest
+  cache contains 2 manifest entries, in order of most to least recent:
+  id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  total cache data size 769 bytes, on-disk 769 bytes
+  $ hg debugmanifestfulltextcache -R share-source
+  cache contains 4 manifest entries, in order of most to least recent:
+  id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
+  id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes
+  total cache data size 1.50 KB, on-disk 1.50 KB
+  $ hg update -R share-source 7
+  6 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log --debug -r . -R share-source | grep 'manifest:'
+  manifest:7:7d32499319983d90f97ca02a6c2057a1030bebbb
+  $ hg debugmanifestfulltextcache -R share-dest
+  cache contains 2 manifest entries, in order of most to least recent:
+  id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  total cache data size 769 bytes, on-disk 769 bytes
+  $ hg debugmanifestfulltextcache -R share-source
+  cache contains 4 manifest entries, in order of most to least recent:
+  id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes
+  id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes
+  id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes
+  id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes
+  total cache data size 1.46 KB, on-disk 1.46 KB
+  $ hg update -R share-dest 8
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log --debug -r . -R share-dest | grep 'manifest:'
+  manifest:8:8de636143b0acc5236cb47ca914bd482d82e6f35
+  $ hg debugmanifestfulltextcache -R share-dest
+  

Re: [PATCH 1 of 2] crecord: repurpose "a" key to toggle all selections (BC)

2019-12-11 Thread Denis Laxalde
Jordi Gutiérrez Hermoso a écrit :
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso 
> # Date 1576015329 18000
> #  Tue Dec 10 17:02:09 2019 -0500
> # Node ID bd10bc4bdb994b875040c0c58f1c341df66ddd46
> # Parent  ce088b38f92b6d480df2072dc45fb068443758dd
> crecord: repurpose "a" key to toggle all selections (BC)
> 
> I really don't like "a". I keep accidentally hitting it when I
> actually want "A", and then I'm suddenly in a state I don't want to be
> in. There's a big wall of text telling me that I've turned amend mode
> on or off (which one was I orginally in?), and this seems very
> useless.

Sounds reasonable to me. Also this 'amend mode' seems only useful for
'commit --interactive'; but it's currently also available for other
interactive commands (e.g. 'revert --interactive', which makes no
sense) so it's already weird.

> If I wanted to amend or not, I would have chosen that from the
> command-line, not change my mind after I've already started picking
> hunks apart.

Agreed as well on this. IMHO, interactive diff hunks selection module
should only be concerned about selecting hunks.

> It seems much better to repurpose this key to be a "weaker" version of
> "A". It toggles all selections. This is pretty harmless if hit
> accidentally, (can just hit "a" again to undo it), and has immediate
> visual feedback that something happened: all the x's and blank spaces
> get switched around. And unlike with amend, the current flipped state
> is also immediately visible without having to read a wall of text.

Does "pretty harmless" mean that you can actually toggle back to the
previous selection? (If not, I wouldn't say this is harmless since the
user may have spend a fair amount of time carefully selecting hunks.)

Also, this breaks tests in test-commit-interactive-curses.t (and it'd be
nice to have some new test for the new feature).

> I'm calling this a BC, however, because somewhere, someone out there
> has probably really fallen in love with the old use of "a" and will
> get angry that we took it away.
> 
> diff --git a/mercurial/crecord.py b/mercurial/crecord.py
> --- a/mercurial/crecord.py
> +++ b/mercurial/crecord.py
> @@ -990,6 +990,13 @@ class curseschunkselector(object):
>  self.toggleapply(item)
>  self.waslasttoggleallapplied = not self.waslasttoggleallapplied
>  
> +def flipselections(self):
> +b"flip all selections"

Triple " without 'b' would be nicer.

> +for header in self.headerlist:
> +for hunk in header.allchildren():
> +for line in hunk.allchildren():
> +self.toggleapply(line)
> +
>  def toggleallbetween(self):
>  """toggle applied on or off for all items in range [lastapplied,
>  current]. """
> @@ -1637,7 +1644,7 @@ the following are valid keystrokes:
>   ctrl-l : scroll the selected line to the top of the screen
>m : edit / resume editing the commit message
>e : edit the currently selected hunk
> -  a : toggle amend mode, only with commit -i
> +  a : toggle all selections
>c : confirm selected changes
>r : review/edit and confirm selected changes
>q : quit without confirming (no changes will be made)
> @@ -1913,7 +1920,7 @@ are you sure you want to review/edit and
>  elif keypressed in ["q"]:
>  raise error.Abort(_(b'user quit'))
>  elif keypressed in ['a']:
> -self.toggleamend(self.opts, test)
> +self.flipselections()
>  elif keypressed in ["c"]:
>  return True
>  elif keypressed in ["r"]:
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7528: rust-matchers: add `FileMatcher` implementation

2019-12-11 Thread Raphaël Gomès
Alphare added inline comments.

INLINE COMMENTS

> martinvonz wrote in matchers.rs:136
> It would be slightly simpler if the paths were owned. It doesn't seem too 
> expensive to take ownership of the paths. Do we have any call sites in this 
> series that we can look at?

There is a single call site for now in D7529 
, it's really straightforward.

Automated tools like CI can produce matchers with a lot of files and it seems 
to me not worth changing existing no-allocation code to get rid of a few 
lifetime annotations. Can we see if it gets too unwieldy?

REPOSITORY
  rHG Mercurial

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

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

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


D7526: rust-hg-path: add method to get part of a path relative to a prefix

2019-12-11 Thread Raphaël Gomès
Alphare added inline comments.

INLINE COMMENTS

> martinvonz wrote in hg_path.rs:438
> The argument order here feels backwards. I know some frameworks (like Java's 
> JUnit) put the expected value first, but the definition of `assert_eq!` 
> doesn't seem to have any opinion and 
> https://doc.rust-lang.org/stable/rust-by-example/testing/unit_testing.html 
> puts the actual value first. What do you think about changing the order? That 
> would make it more readable to me.

It looks that I took the habit because the test runner in PyCharm that I used 
when starting with Rust prints `expected` and `actual` in that order. I can 
reverse it if you really think it's more readable this way.

REPOSITORY
  rHG Mercurial

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

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

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


D7531: rust-matchers: add support for `explicitmatcher` in `dirstate.status`

2019-12-11 Thread Raphaël Gomès
Alphare added a comment.


  Yes, I meant `exactmatcher` indeed. 
  `FileMatcher` is meant for the Rust side of things, I do not intend to rename 
it in Python because it is a minor change that would make a lot of noise for 
bikeshedding. Do you think that would be a good idea?

REPOSITORY
  rHG Mercurial

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

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

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


D7118: rust-dirstatemap: remove additional lookups in traverse

2019-12-11 Thread Raphaël Gomès
Alphare added a comment.


  In D7118#111735 , @martinvonz 
wrote:
  
  > What's the state of this patch? The description makes it sound like it's a 
Rust patch, but it only modifies Python code.
  
  It only impacts the rust module policy, I figured the name was not a bad 
idea. Maybe I'm wrong?
  
  I also did not find Yuya's suggestion to work, but I may have understood it 
wrong.

REPOSITORY
  rHG Mercurial

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

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

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