D2253: releasenotes: mention changeset with warning and abort

2018-02-13 Thread rishabhmadan96 (Rishabh Madan)
rishabhmadan96 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Output the changeset hash with the warning/abort message just to know where 
things messed up.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/releasenotes.py

CHANGE DETAILS

diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -311,8 +311,8 @@
 title = block['lines'][0].strip() if block['lines'] else None
 
 if i + 1 == len(blocks):
-raise error.Abort(_('release notes directive %s lacks content')
-  % directive)
+raise error.Abort(_('changeset %s: release notes directive %s '
+'lacks content') % (node.hex(ctx.node()), directive))
 
 # Now search ahead and find all paragraphs attached to this
 # admonition.
@@ -325,8 +325,8 @@
 continue
 
 if pblock['type'] != 'paragraph':
-repo.ui.warn(_('unexpected block in release notes '
-'directive %s\n') % directive)
+repo.ui.warn(_('changeset %s: unexpected block in release '
+'notes directive %s\n') % (node.hex(ctx.node()), 
directive))
 
 if pblock['indent'] > 0:
 paragraphs.append(pblock['lines'])



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


D2254: releasenotes: allow notes for multiple directives in a single changeset

2018-02-13 Thread rishabhmadan96 (Rishabh Madan)
rishabhmadan96 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This problem was caught in 
https://phab.mercurial-scm.org/rHGda91e7309daf8ffc51bf3e6f4b2d8a16ef5af95a. 
This patch just makes sure there is no warning when we
  encounter such a case.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/releasenotes.py

CHANGE DETAILS

diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -324,6 +324,9 @@
 if pblock['type'] == 'margin':
 continue
 
+if pblock['type'] == 'admonition':
+break
+
 if pblock['type'] != 'paragraph':
 repo.ui.warn(_('changeset %s: unexpected block in release '
 'notes directive %s\n') % (node.hex(ctx.node()), 
directive))



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


D2255: releasenotes: replace abort with warning while parsing

2018-02-13 Thread rishabhmadan96 (Rishabh Madan)
rishabhmadan96 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  During the 4.5 development cycle, the extension broke on two different 
changesets. This change
  simply makes sure that it just throws a warning when encounters something 
instead of an abort
  action.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/releasenotes.py

CHANGE DETAILS

diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -325,8 +325,8 @@
 continue
 
 if pblock['type'] != 'paragraph':
-raise error.Abort(_('unexpected block in release notes '
-'directive %s') % directive)
+repo.ui.warn(_('unexpected block in release notes '
+'directive %s\n') % directive)
 
 if pblock['indent'] > 0:
 paragraphs.append(pblock['lines'])



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


D1758: remotenames: add new namespaces for remotebookmarks and remotebranches

2018-02-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> test-logexchange.t:130-131
> +  |  tag: tip
> +  |  remote branch:$TESTTMP/server2/wat
> +  |  remote branch:default/wat
> +  |  parent:  4:aa98ab95a928

This is pretty hard to read. Should we at least add a space between the 
label-and-colon and the value?

REPOSITORY
  rHG Mercurial

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

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


D1756: remotenames: introduce class to encapsulate remotenames info in an extension

2018-02-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> remotenames.py:23
> +
> +class remotenames(dict):
> +"""

Why does this extend dict? Do we expect callers to update bookmarks by doing 
something like the following? If not, and the extending of dict is just for the 
convenience of writing the loop in loadnames() below, we should do it 
differently and not expose the dict-ness to users. For example, this class 
could have a dict instead of being a dict.

  remotenames = ...
  remotenames['my-bookmark'] = node

REPOSITORY
  rHG Mercurial

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

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


D2244: histedit: binascii.unhexlify (aka node.bin) throws new exception type on py3

2018-02-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D2244#37261, @indygreg wrote:
  
  > Now I'm second guessing accepting/committing this...
  
  
  Some thoughts:
  
  - This is probably not very well tested code (because it's an error path)
  - As long as we grep for TypeError and add binascii.Error in all those 
places, we're probably fine
  - Extensions need to be fixed too
  
  I think I'd prefer to define our own node.bin() with the old contract (IOW to 
wrap it)

REPOSITORY
  rHG Mercurial

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

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


D2244: histedit: binascii.unhexlify (aka node.bin) throws new exception type on py3

2018-02-13 Thread indygreg (Gregory Szorc)
indygreg added a comment.


  Now I'm second guessing accepting/committing this...

REPOSITORY
  rHG Mercurial

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

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


D2244: histedit: binascii.unhexlify (aka node.bin) throws new exception type on py3

2018-02-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D2244#37169, @durin42 wrote:
  
  > I could go either way. A casual grep for "except TypeError" suggests we're 
looking at 4 or 5 locations *total*, so my bias is to do it at the callsites 
and avoid the annoyingly-large overhead of a wrapper function for something 
that's so fundamental.
  
  
  
  
  In https://phab.mercurial-scm.org/D2244#37233, @indygreg wrote:
  
  > In https://phab.mercurial-scm.org/D2244#37169, @durin42 wrote:
  >
  > > I could go either way. A casual grep for "except TypeError" suggests 
we're looking at 4 or 5 locations *total*, so my bias is to do it at the 
callsites and avoid the annoyingly-large overhead of a wrapper function for 
something that's so fundamental.
  >
  >
  > If it's only 4 or 5 call sites, then I'm not worried. I assumed it would be 
more widespread than that.
  
  
  I found a few more (at 
https://phab.mercurial-scm.org/rHGeefabd9ed3e1c8ed8ea023a0a76a76335185e2b3):
  
  lfcommands.py:332
  histedit.py:428
  shelve.py:194
  bookmarks.py:80
  context.py:528
  debugcommands.py:1541
  revlog.py:1360
  revlog.py:1407
  revset.py:1326
  tags.py:295

REPOSITORY
  rHG Mercurial

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

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


D2231: narrow: fix for getting the username when running http server

2018-02-13 Thread indygreg (Gregory Szorc)
indygreg added inline comments.

INLINE COMMENTS

> narrowbundle2.py:331
> +ui = repo.ui
> +username = ui.shortuser(ui.environ.get('REMOTE_USER') or ui.username())
> +user_includes = ui.configlist(

`REMOTE_USER` is an HTTP-ism and I think it is a layering violation to look for 
`REMOTE_USER` in code that is supposed to be protocol agnostic.

What I'm trying to say is I think we'll need to tweak this ACL code further 
when it is moved to core.

REPOSITORY
  rHG Mercurial

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

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


D2251: py3: introduce and use pycompat.getargspec

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf45600b3e3ee: py3: introduce and use pycompat.getargspec 
(authored by durin42, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D2251?vs=5686=5691#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2251?vs=5686=5691

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

AFFECTED FILES
  contrib/perf.py
  mercurial/extensions.py
  mercurial/localrepo.py
  mercurial/pycompat.py

CHANGE DETAILS

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -11,6 +11,7 @@
 from __future__ import absolute_import
 
 import getopt
+import inspect
 import os
 import shlex
 import sys
@@ -65,6 +66,7 @@
 maplist = lambda *args: list(map(*args))
 ziplist = lambda *args: list(zip(*args))
 rawinput = input
+getargspec = inspect.getfullargspec
 
 # TODO: .buffer might not exist if std streams were replaced; we'll need
 # a silly wrapper to make a bytes stream backed by a unicode one.
@@ -330,6 +332,8 @@
 maplist = map
 ziplist = zip
 rawinput = raw_input
+getargspec = inspect.getargspec
+
 
 def emailparser(*args, **kwargs):
 import email.parser
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -9,7 +9,6 @@
 
 import errno
 import hashlib
-import inspect
 import os
 import random
 import time
@@ -1068,7 +1067,7 @@
 if not fn:
 fn = lambda s, c, **kwargs: util.filter(s, c)
 # Wrap old filters not supporting keyword arguments
-if not inspect.getargspec(fn)[2]:
+if not pycompat.getargspec(fn)[2]:
 oldfn = fn
 fn = lambda s, c, **kwargs: oldfn(s, c)
 l.append((mf, fn, params))
diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -195,11 +195,7 @@
 try:
 extsetup(ui)
 except TypeError:
-# Try to use getfullargspec (Python 3) first, and fall
-# back to getargspec only if it doesn't exist so as to
-# avoid warnings.
-if getattr(inspect, 'getfullargspec',
-   getattr(inspect, 'getargspec'))(extsetup).args:
+if pycompat.getargspec(extsetup).args:
 raise
 extsetup() # old extsetup with no ui argument
 except Exception as inst:
diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -64,6 +64,12 @@
 from mercurial import scmutil # since 1.9 (or 8b252e826c68)
 except ImportError:
 pass
+try:
+from mercurial import pycompat
+getargspec = pycompat.getargspec  # added to module after 4.5
+except (ImportError, AttributeError):
+import inspect
+getargspec = inspect.getargspec
 
 # for "historical portability":
 # define util.safehasattr forcibly, because util.safehasattr has been
@@ -114,9 +120,8 @@
 if safehasattr(registrar, 'command'):
 command = registrar.command(cmdtable)
 elif safehasattr(cmdutil, 'command'):
-import inspect
 command = cmdutil.command(cmdtable)
-if 'norepo' not in inspect.getargspec(command)[0]:
+if 'norepo' not in getargspec(command).args:
 # for "historical portability":
 # wrap original cmdutil.command, because "norepo" option has
 # been available since 3.1 (or 75a96326cecb)



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


D2252: python3: whitelist another 5 passing tests

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG72837041a1ea: python3: whitelist another 5 passing tests 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2252?vs=5687=5692

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

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -59,6 +59,10 @@
 test-empty-group.t
 test-empty.t
 test-encoding-func.py
+test-eol-add.t
+test-eol-clone.t
+test-eol-tag.t
+test-eol-update.t
 test-excessive-merge.t
 test-exchange-obsmarkers-case-A1.t
 test-exchange-obsmarkers-case-A2.t
@@ -229,4 +233,5 @@
 test-update-issue1456.t
 test-update-names.t
 test-update-reverse.t
+test-win32text.t
 test-xdg.t



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


D2251: py3: introduce and use pycompat.getargspec

2018-02-13 Thread indygreg (Gregory Szorc)
indygreg accepted this revision.
indygreg added inline comments.
This revision is now accepted and ready to land.

INLINE COMMENTS

> perf.py:43
>  
> +
>  # for "historical portability":

This looks like a double space. I'll fix this in flight.

REPOSITORY
  rHG Mercurial

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

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


D2250: merge: coerce nodes to bytes, not str

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG82ae565f0d8c: merge: coerce nodes to bytes, not str 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2250?vs=5685=5690

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

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1846,7 +1846,7 @@
 else:
 pas = [p1.ancestor(p2, warn=branchmerge)]
 
-fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
+fp1, fp2, xp1, xp2 = p1.node(), p2.node(), bytes(p1), bytes(p2)
 
 ### check phase
 if not overwrite:



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


D2244: histedit: binascii.unhexlify (aka node.bin) throws new exception type on py3

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG88dd15b38bb0: histedit: binascii.unhexlify (aka node.bin) 
throws new exception type on py3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2244?vs=5668=5688

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -183,6 +183,7 @@
 
 from __future__ import absolute_import
 
+import binascii
 import errno
 import os
 
@@ -425,7 +426,7 @@
 rulehash = rule.strip().split(' ', 1)[0]
 try:
 rev = node.bin(rulehash)
-except TypeError:
+except (TypeError, binascii.Error):
 raise error.ParseError("invalid changeset %s" % rulehash)
 return cls(state, rev)
 



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


D2249: py3: whitelist more passing tests

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6a6c919e9172: py3: whitelist more passing tests (authored 
by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2249?vs=5673=5689

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

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -90,11 +90,15 @@
 test-glog-topological.t
 test-gpg.t
 test-hghave.t
+test-histedit-arguments.t
+test-histedit-base.t
 test-histedit-bookmark-motion.t
 test-histedit-commute.t
 test-histedit-drop.t
 test-histedit-edit.t
+test-histedit-fold-non-commute.t
 test-histedit-no-change.t
+test-histedit-non-commute.t
 test-histedit-obsolete.t
 test-histedit-outgoing.t
 test-http-clone-r.t



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


D2244: histedit: binascii.unhexlify (aka node.bin) throws new exception type on py3

2018-02-13 Thread indygreg (Gregory Szorc)
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  In https://phab.mercurial-scm.org/D2244#37169, @durin42 wrote:
  
  > I could go either way. A casual grep for "except TypeError" suggests we're 
looking at 4 or 5 locations *total*, so my bias is to do it at the callsites 
and avoid the annoyingly-large overhead of a wrapper function for something 
that's so fundamental.
  
  
  If it's only 4 or 5 call sites, then I'm not worried. I assumed it would be 
more widespread than that.

REPOSITORY
  rHG Mercurial

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

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


D2251: py3: introduce and use pycompat.getargspec

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is getfullargspec on py3, which means we can't use namedtuple
  named accessors for all fields (eg keywords from getargspec is varkw
  from getfullargspec, with the same meaning). Solves some warning
  issues on Python 3.
  
  I didn't clean up httpclient because that's vendored code I think we
  should probably discard, and I didn't touch the manpage generator for
  now either.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/perf.py
  mercurial/extensions.py
  mercurial/localrepo.py
  mercurial/pycompat.py

CHANGE DETAILS

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -11,6 +11,7 @@
 from __future__ import absolute_import
 
 import getopt
+import inspect
 import os
 import shlex
 import sys
@@ -65,6 +66,7 @@
 maplist = lambda *args: list(map(*args))
 ziplist = lambda *args: list(zip(*args))
 rawinput = input
+getargspec = inspect.getfullargspec
 
 # TODO: .buffer might not exist if std streams were replaced; we'll need
 # a silly wrapper to make a bytes stream backed by a unicode one.
@@ -330,6 +332,8 @@
 maplist = map
 ziplist = zip
 rawinput = raw_input
+getargspec = inspect.getargspec
+
 
 def emailparser(*args, **kwargs):
 import email.parser
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -9,7 +9,6 @@
 
 import errno
 import hashlib
-import inspect
 import os
 import random
 import time
@@ -1068,7 +1067,7 @@
 if not fn:
 fn = lambda s, c, **kwargs: util.filter(s, c)
 # Wrap old filters not supporting keyword arguments
-if not inspect.getargspec(fn)[2]:
+if not pycompat.getargspec(fn)[2]:
 oldfn = fn
 fn = lambda s, c, **kwargs: oldfn(s, c)
 l.append((mf, fn, params))
diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -195,11 +195,7 @@
 try:
 extsetup(ui)
 except TypeError:
-# Try to use getfullargspec (Python 3) first, and fall
-# back to getargspec only if it doesn't exist so as to
-# avoid warnings.
-if getattr(inspect, 'getfullargspec',
-   getattr(inspect, 'getargspec'))(extsetup).args:
+if pycompat.getargspec(extsetup).args:
 raise
 extsetup() # old extsetup with no ui argument
 except Exception as inst:
diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -40,6 +40,7 @@
 util,
 )
 
+
 # for "historical portability":
 # try to import modules separately (in dict order), and ignore
 # failure, because these aren't available with early Mercurial
@@ -64,6 +65,12 @@
 from mercurial import scmutil # since 1.9 (or 8b252e826c68)
 except ImportError:
 pass
+try:
+from mercurial import pycompat
+getargspec = pycompat.getargspec  # added to module after 4.5
+except (ImportError, AttributeError):
+import inspect
+getargspec = inspect.getargspec
 
 # for "historical portability":
 # define util.safehasattr forcibly, because util.safehasattr has been
@@ -114,9 +121,8 @@
 if safehasattr(registrar, 'command'):
 command = registrar.command(cmdtable)
 elif safehasattr(cmdutil, 'command'):
-import inspect
 command = cmdutil.command(cmdtable)
-if 'norepo' not in inspect.getargspec(command)[0]:
+if 'norepo' not in getargspec(command).args:
 # for "historical portability":
 # wrap original cmdutil.command, because "norepo" option has
 # been available since 3.1 (or 75a96326cecb)



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


D2252: python3: whitelist another 5 passing tests

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: pulkit.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -59,6 +59,10 @@
 test-empty-group.t
 test-empty.t
 test-encoding-func.py
+test-eol-add.t
+test-eol-clone.t
+test-eol-tag.t
+test-eol-update.t
 test-excessive-merge.t
 test-exchange-obsmarkers-case-A1.t
 test-exchange-obsmarkers-case-A2.t
@@ -225,4 +229,5 @@
 test-update-issue1456.t
 test-update-names.t
 test-update-reverse.t
+test-win32text.t
 test-xdg.t



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


D2250: merge: coerce nodes to bytes, not str

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1846,7 +1846,7 @@
 else:
 pas = [p1.ancestor(p2, warn=branchmerge)]
 
-fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
+fp1, fp2, xp1, xp2 = p1.node(), p2.node(), bytes(p1), bytes(p2)
 
 ### check phase
 if not overwrite:



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


D2232: treemanifest: add an optimized __nonzero__()

2018-02-13 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdbb131ffdc4d: treemanifest: add an optimized __nonzero__() 
(authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2232?vs=5654=5684

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

AFFECTED FILES
  mercurial/manifest.py

CHANGE DETAILS

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -755,6 +755,12 @@
 size += m.__len__()
 return size
 
+def __nonzero__(self):
+# Faster than "__len() != 0" since it avoids loading sub-manifests
+return not self._isempty()
+
+__bool__ = __nonzero__
+
 def _isempty(self):
 self._load() # for consistency; already loaded by all callers
 return (not self._files and (not self._dirs or



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


D2232: treemanifest: add an optimized __nonzero__()

2018-02-13 Thread indygreg (Gregory Szorc)
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  Perhaps we should formalize the manifest interface with an abstract base 
class...

REPOSITORY
  rHG Mercurial

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

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


D2248: tests: port fakemergerecord to python3

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdb2c091871d3: tests: port fakemergerecord to python3 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2248?vs=5672=5683

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

AFFECTED FILES
  tests/fakemergerecord.py

CHANGE DETAILS

diff --git a/tests/fakemergerecord.py b/tests/fakemergerecord.py
--- a/tests/fakemergerecord.py
+++ b/tests/fakemergerecord.py
@@ -12,15 +12,15 @@
 cmdtable = {}
 command = registrar.command(cmdtable)
 
-@command('fakemergerecord',
- [('X', 'mandatory', None, 'add a fake mandatory record'),
-  ('x', 'advisory', None, 'add a fake advisory record')], '')
+@command(b'fakemergerecord',
+ [(b'X', b'mandatory', None, b'add a fake mandatory record'),
+  (b'x', b'advisory', None, b'add a fake advisory record')], '')
 def fakemergerecord(ui, repo, *pats, **opts):
 with repo.wlock():
 ms = merge.mergestate.read(repo)
 records = ms._makerecords()
 if opts.get('mandatory'):
-records.append(('X', 'mandatory record'))
+records.append((b'X', b'mandatory record'))
 if opts.get('advisory'):
-records.append(('x', 'advisory record'))
+records.append((b'x', b'advisory record'))
 ms._writerecords(records)



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


D2247: tests: add some b-prefixes on local script in test-histedit-arguments

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGab4900a34298: tests: add some b-prefixes on local script in 
test-histedit-arguments (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2247?vs=5671=5682

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

AFFECTED FILES
  tests/test-histedit-arguments.t

CHANGE DETAILS

diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t
--- a/tests/test-histedit-arguments.t
+++ b/tests/test-histedit-arguments.t
@@ -280,9 +280,9 @@
 
 
   $ $PYTHON < fp = open('logfile', 'w')
-  > fp.write('12345678901234567890123456789012345678901234567890' +
-  >  '12345') # there are 5 more columns for 80 columns
+  > fp = open('logfile', 'wb')
+  > fp.write(b'12345678901234567890123456789012345678901234567890' +
+  >  b'12345') # there are 5 more columns for 80 columns
   > 
   > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
   > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))



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


D2245: ui: coerce system exception to bytes before dropping it in our StdioError

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4d820b8ad42f: ui: coerce system exception to bytes before 
dropping it in our StdioError (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2245?vs=5669=5680

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

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -958,7 +958,7 @@
 self.ferr.flush()
 except IOError as inst:
 if inst.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
-raise error.StdioError(inst)
+raise error.StdioError(pycompat.bytestr(inst))
 
 def flush(self):
 # opencode timeblockedsection because this is a critical path



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


D2246: tests: add bytes prefixes to test-histedit-fold.t's local extension

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2ad59b55759a: tests: add bytes prefixes to 
test-histedit-fold.ts local extension (authored by durin42, committed by 
).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2246?vs=5670=5681

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

AFFECTED FILES
  tests/test-histedit-fold.t

CHANGE DETAILS

diff --git a/tests/test-histedit-fold.t b/tests/test-histedit-fold.t
--- a/tests/test-histedit-fold.t
+++ b/tests/test-histedit-fold.t
@@ -154,9 +154,9 @@
   > from mercurial import util
   > def abortfolding(ui, repo, hooktype, **kwargs):
   > ctx = repo[kwargs.get('node')]
-  > if set(ctx.files()) == {'c', 'd', 'f'}:
+  > if set(ctx.files()) == {b'c', b'd', b'f'}:
   > return True # abort folding commit only
-  > ui.warn('allow non-folding commit\\n')
+  > ui.warn(b'allow non-folding commit\\n')
   > EOF
   $ cat > .hg/hgrc < [hooks]



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


D2249: py3: whitelist more passing tests

2018-02-13 Thread indygreg (Gregory Szorc)
indygreg added a comment.


  Can't accept this until https://phab.mercurial-scm.org/D2244 is resolved.

REPOSITORY
  rHG Mercurial

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

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


D2240: histedit: convert bool to bytestring manually

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG73621823a1ac: histedit: convert bool to bytestring manually 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2240?vs=5662=5676

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -344,7 +344,7 @@
 fp.write('v1\n')
 fp.write('%s\n' % node.hex(self.parentctxnode))
 fp.write('%s\n' % node.hex(self.topmost))
-fp.write('%s\n' % self.keep)
+fp.write('%s\n' % ('True' if self.keep else 'False'))
 fp.write('%d\n' % len(self.actions))
 for action in self.actions:
 fp.write('%s\n' % action.tostate())



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


D2241: histedit: modernize write of histedit-last-edit file

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbe73fa5b42d3: histedit: modernize write of 
histedit-last-edit file (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2241?vs=5663=5677

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1415,9 +1415,8 @@
 # Save edit rules in .hg/histedit-last-edit.txt in case
 # the user needs to ask for help after something
 # surprising happens.
-f = open(repo.vfs.join('histedit-last-edit.txt'), 'w')
-f.write(rules)
-f.close()
+with repo.vfs('histedit-last-edit.txt', 'wb') as f:
+f.write(rules)
 
 return rules
 



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


D2243: histedit: fix silly bug that was unpacking a bytestr before writing it

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG28830ba50687: histedit: fix silly bug that was unpacking a 
bytestr before writing it (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2243?vs=5667=5679

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -491,7 +491,7 @@
 repo.dirstate.setbranch(rulectx.branch())
 if stats and stats[3] > 0:
 buf = repo.ui.popbuffer()
-repo.ui.write(*buf)
+repo.ui.write(buf)
 raise error.InterventionRequired(
 _('Fix up the change (%s %s)') %
 (self.verb, node.short(self.node)),



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


D2238: narrowmerge: iterate over a copy of dict items so we can mutate the dict

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG53fe5a1a92bd: narrowmerge: iterate over a copy of dict 
items so we can mutate the dict (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2238?vs=5660=5674

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

AFFECTED FILES
  hgext/narrow/narrowmerge.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowmerge.py b/hgext/narrow/narrowmerge.py
--- a/hgext/narrow/narrowmerge.py
+++ b/hgext/narrow/narrowmerge.py
@@ -28,7 +28,9 @@
 nooptypes = set(['k']) # TODO: handle with nonconflicttypes
 nonconflicttypes = set('a am c cm f g r e'.split())
 narrowmatch = repo.narrowmatch()
-for f, action in actions.items():
+# We mutate the items in the dict during iteration, so iterate
+# over a copy.
+for f, action in list(actions.items()):
 if narrowmatch(f):
 pass
 elif not branchmerge:



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


D2239: narrowcommands: more byteskwargs cleanup

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGccf7ae119769: narrowcommands: more byteskwargs cleanup 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2239?vs=5661=5675

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

AFFECTED FILES
  hgext/narrow/narrowcommands.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -332,6 +332,7 @@
 If --clear is specified without any further options, the narrowspec will be
 empty and will not match any files.
 """
+opts = pycompat.byteskwargs(opts)
 if narrowrepo.REQUIREMENT not in repo.requirements:
 ui.warn(_('The narrow command is only supported on respositories 
cloned'
   ' with --narrow.\n'))



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


D2242: py3: whitelist another 8 passing tests

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0ea86f70da8e: py3: whitelist another 8 passing tests 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2242?vs=5664=5678

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

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -90,6 +90,13 @@
 test-glog-topological.t
 test-gpg.t
 test-hghave.t
+test-histedit-bookmark-motion.t
+test-histedit-commute.t
+test-histedit-drop.t
+test-histedit-edit.t
+test-histedit-no-change.t
+test-histedit-obsolete.t
+test-histedit-outgoing.t
 test-http-clone-r.t
 test-imports-checker.t
 test-inherit-mode.t
@@ -179,6 +186,7 @@
 test-rebase-inmemory.t
 test-rebase-issue-noparam-single-rev.t
 test-rebase-legacy.t
+test-rebase-pull.t
 test-rebase-transaction.t
 test-record.t
 test-remove.t



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


D2244: histedit: binascii.unhexlify (aka node.bin) throws new exception type on py3

2018-02-13 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I could go either way. A casual grep for "except TypeError" suggests we're 
looking at 4 or 5 locations *total*, so my bias is to do it at the callsites 
and avoid the annoyingly-large overhead of a wrapper function for something 
that's so fundamental.

REPOSITORY
  rHG Mercurial

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

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


D2244: histedit: binascii.unhexlify (aka node.bin) throws new exception type on py3

2018-02-13 Thread indygreg (Gregory Szorc)
indygreg requested changes to this revision.
indygreg added a comment.
This revision now requires changes to proceed.


  I'm not super thrilled about this. Presumably we'll have this class of 
failure throughout the code base. What do you think about having `node.bin()` 
catch `binascii.Error` and re-raise as `TypeError`?

REPOSITORY
  rHG Mercurial

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

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


D2240: histedit: convert bool to bytestring manually

2018-02-13 Thread durin42 (Augie Fackler)
durin42 added a comment.


  Yeah, but it failed tests. I suspect the difference between 
https://phab.mercurial-scm.org/D2169 and this is the extra parens in my version?

REPOSITORY
  rHG Mercurial

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

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


D2240: histedit: convert bool to bytestring manually

2018-02-13 Thread indygreg (Gregory Szorc)
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  Pretty sure I wrote this patch the other day...

REPOSITORY
  rHG Mercurial

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

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


D2243: histedit: fix silly bug that was unpacking a bytestr before writing it

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I have this foggy notion that popbuffer() might have returned a list
  in the past, but it doesn't anymore, and this was breaking on Python
  
  3. As a bonus, it's probably a ton faster on Python 2 now.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -491,7 +491,7 @@
 repo.dirstate.setbranch(rulectx.branch())
 if stats and stats[3] > 0:
 buf = repo.ui.popbuffer()
-repo.ui.write(*buf)
+repo.ui.write(buf)
 raise error.InterventionRequired(
 _('Fix up the change (%s %s)') %
 (self.verb, node.short(self.node)),



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


D2244: histedit: binascii.unhexlify (aka node.bin) throws new exception type on py3

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Lucky for us, the exception type exists on 2.7, so we can include it
  in the except block without any extra work.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -183,6 +183,7 @@
 
 from __future__ import absolute_import
 
+import binascii
 import errno
 import os
 
@@ -425,7 +426,7 @@
 rulehash = rule.strip().split(' ', 1)[0]
 try:
 rev = node.bin(rulehash)
-except TypeError:
+except (TypeError, binascii.Error):
 raise error.ParseError("invalid changeset %s" % rulehash)
 return cls(state, rev)
 



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


D2247: tests: add some b-prefixes on local script in test-histedit-arguments

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  1. skip-blame its just more b prefixes and a file in binary mode

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-histedit-arguments.t

CHANGE DETAILS

diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t
--- a/tests/test-histedit-arguments.t
+++ b/tests/test-histedit-arguments.t
@@ -280,9 +280,9 @@
 
 
   $ $PYTHON < fp = open('logfile', 'w')
-  > fp.write('12345678901234567890123456789012345678901234567890' +
-  >  '12345') # there are 5 more columns for 80 columns
+  > fp = open('logfile', 'wb')
+  > fp.write(b'12345678901234567890123456789012345678901234567890' +
+  >  b'12345') # there are 5 more columns for 80 columns
   > 
   > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
   > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))



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


D2248: tests: port fakemergerecord to python3

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/fakemergerecord.py

CHANGE DETAILS

diff --git a/tests/fakemergerecord.py b/tests/fakemergerecord.py
--- a/tests/fakemergerecord.py
+++ b/tests/fakemergerecord.py
@@ -12,15 +12,15 @@
 cmdtable = {}
 command = registrar.command(cmdtable)
 
-@command('fakemergerecord',
- [('X', 'mandatory', None, 'add a fake mandatory record'),
-  ('x', 'advisory', None, 'add a fake advisory record')], '')
+@command(b'fakemergerecord',
+ [(b'X', b'mandatory', None, b'add a fake mandatory record'),
+  (b'x', b'advisory', None, b'add a fake advisory record')], '')
 def fakemergerecord(ui, repo, *pats, **opts):
 with repo.wlock():
 ms = merge.mergestate.read(repo)
 records = ms._makerecords()
 if opts.get('mandatory'):
-records.append(('X', 'mandatory record'))
+records.append((b'X', b'mandatory record'))
 if opts.get('advisory'):
-records.append(('x', 'advisory record'))
+records.append((b'x', b'advisory record'))
 ms._writerecords(records)



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


D2249: py3: whitelist more passing tests

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: pulkit.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I had some good success tonight with histedit
  tests. test-histedit-fold.t is now low-hanging fruit: it is only
  failing because the logic for setting environment variables in hook.py
  is slightly busted. Specifically, hook.py line 142 should be making
  sure it puts strings in the env dict, not bytes, to avoid b'' goo in
  environment variables.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -90,11 +90,15 @@
 test-glog-topological.t
 test-gpg.t
 test-hghave.t
+test-histedit-arguments.t
+test-histedit-base.t
 test-histedit-bookmark-motion.t
 test-histedit-commute.t
 test-histedit-drop.t
 test-histedit-edit.t
+test-histedit-fold-non-commute.t
 test-histedit-no-change.t
+test-histedit-non-commute.t
 test-histedit-obsolete.t
 test-histedit-outgoing.t
 test-http-clone-r.t



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


D2237: contrib: ban $RANDOM using check-code

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc38e9248f531: contrib: ban $RANDOM using check-code 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2237?vs=5659=5666

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

AFFECTED FILES
  contrib/check-code.py

CHANGE DETAILS

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -150,6 +150,7 @@
 (r'grep.* -[ABC]', "don't use grep's context flags"),
 (r'find.*-printf',
  "don't use 'find -printf', it doesn't exist on BSD find(1)"),
+(r'\$RANDOM ', "don't use bash-only $RANDOM to generate random values"),
   ],
   # warnings
   [



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


D2236: tests: remove use of bashism $RANDOM to fix test-narrow.t on non-bash shells

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG068f520754ca: tests: remove use of bashism $RANDOM to fix 
test-narrow.t on non-bash shells (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2236?vs=5658=5665

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

AFFECTED FILES
  tests/test-narrow.t

CHANGE DETAILS

diff --git a/tests/test-narrow.t b/tests/test-narrow.t
--- a/tests/test-narrow.t
+++ b/tests/test-narrow.t
@@ -51,7 +51,7 @@
   [255]
 
 Names with '.' in them are OK.
-  $ hg clone --narrow ssh://user@dummy/master $RANDOM --include a/.b/c
+  $ hg clone --narrow ssh://user@dummy/master should-work --include a/.b/c
   requesting all changes
   adding changesets
   adding manifests



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


D2242: py3: whitelist another 8 passing tests

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: pulkit.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -90,6 +90,13 @@
 test-glog-topological.t
 test-gpg.t
 test-hghave.t
+test-histedit-bookmark-motion.t
+test-histedit-commute.t
+test-histedit-drop.t
+test-histedit-edit.t
+test-histedit-no-change.t
+test-histedit-obsolete.t
+test-histedit-outgoing.t
 test-http-clone-r.t
 test-imports-checker.t
 test-inherit-mode.t
@@ -179,6 +186,7 @@
 test-rebase-inmemory.t
 test-rebase-issue-noparam-single-rev.t
 test-rebase-legacy.t
+test-rebase-pull.t
 test-rebase-transaction.t
 test-record.t
 test-remove.t



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


D2241: histedit: modernize write of histedit-last-edit file

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1415,9 +1415,8 @@
 # Save edit rules in .hg/histedit-last-edit.txt in case
 # the user needs to ask for help after something
 # surprising happens.
-f = open(repo.vfs.join('histedit-last-edit.txt'), 'w')
-f.write(rules)
-f.close()
+with repo.vfs('histedit-last-edit.txt', 'wb') as f:
+f.write(rules)
 
 return rules
 



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


D2238: narrowmerge: iterate over a copy of dict items so we can mutate the dict

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowmerge.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowmerge.py b/hgext/narrow/narrowmerge.py
--- a/hgext/narrow/narrowmerge.py
+++ b/hgext/narrow/narrowmerge.py
@@ -28,7 +28,9 @@
 nooptypes = set(['k']) # TODO: handle with nonconflicttypes
 nonconflicttypes = set('a am c cm f g r e'.split())
 narrowmatch = repo.narrowmatch()
-for f, action in actions.items():
+# We mutate the items in the dict during iteration, so iterate
+# over a copy.
+for f, action in list(actions.items()):
 if narrowmatch(f):
 pass
 elif not branchmerge:



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


D2239: narrowcommands: more byteskwargs cleanup

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowcommands.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -332,6 +332,7 @@
 If --clear is specified without any further options, the narrowspec will be
 empty and will not match any files.
 """
+opts = pycompat.byteskwargs(opts)
 if narrowrepo.REQUIREMENT not in repo.requirements:
 ui.warn(_('The narrow command is only supported on respositories 
cloned'
   ' with --narrow.\n'))



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


D2240: histedit: convert bool to bytestring manually

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Yes, this format has 'True' and 'False' in it. I'm sorry, as it's
  almost certainly my fault.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -344,7 +344,7 @@
 fp.write('v1\n')
 fp.write('%s\n' % node.hex(self.parentctxnode))
 fp.write('%s\n' % node.hex(self.topmost))
-fp.write('%s\n' % self.keep)
+fp.write('%s\n' % ('True' if self.keep else 'False'))
 fp.write('%d\n' % len(self.actions))
 for action in self.actions:
 fp.write('%s\n' % action.tostate())



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


D2236: tests: remove use of bashism $RANDOM to fix test-narrow.t on non-bash shells

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This test passed on our workstations, including on Macs, so we never
  noticed, but it fails on both the Linux and FreeBSD buildbots. Today I
  learned about a bash feature, wherein $RANDOM gives a random int every
  time you read it.
  
  check-code rule to follow.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-narrow.t

CHANGE DETAILS

diff --git a/tests/test-narrow.t b/tests/test-narrow.t
--- a/tests/test-narrow.t
+++ b/tests/test-narrow.t
@@ -51,7 +51,7 @@
   [255]
 
 Names with '.' in them are OK.
-  $ hg clone --narrow ssh://user@dummy/master $RANDOM --include a/.b/c
+  $ hg clone --narrow ssh://user@dummy/master should-work --include a/.b/c
   requesting all changes
   adding changesets
   adding manifests



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


D2237: contrib: ban $RANDOM using check-code

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/check-code.py

CHANGE DETAILS

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -150,6 +150,7 @@
 (r'grep.* -[ABC]', "don't use grep's context flags"),
 (r'find.*-printf',
  "don't use 'find -printf', it doesn't exist on BSD find(1)"),
+(r'\$RANDOM ', "don't use bash-only $RANDOM to generate random values"),
   ],
   # warnings
   [



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


D2235: manifest: add support for including directories outside narrowspec

2018-02-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  When using tree manifests and the client doesn't have a directory, we
  have two choices for what to do with "hg manifest" output: 1) ignore
  the directory, and 2) include the directory (not files within it). For
  "hg files", we decided to ignore the directories (and files) outside
  the narrowspec.
  
  If we choose to not include directories outside the narrowspec, then I
  think we should also make sure we don't include files outside the
  narrowspec. I also think we should add --outside-narrow flag (or other
  name). Thus, whichever way we go, I think we should have a way of
  displaying paths (files or directories) outside the narrowspec. For
  that we'll need to handle the 't' flag that narrowhg uses, and that's
  what this patch adds support for.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/commands.py
  tests/test-narrow-commit.t

CHANGE DETAILS

diff --git a/tests/test-narrow-commit.t b/tests/test-narrow-commit.t
--- a/tests/test-narrow-commit.t
+++ b/tests/test-narrow-commit.t
@@ -72,12 +72,20 @@
 
   $ hg update -q 'desc("initial")'
   $ echo modified2 > inside/f1
+  $ hg manifest --debug
+  4d6a634d5ba06331a60c29ee0db8412490a54fcd 644   inside/f1
+  7fb3bb6356d28d4dc352c5ba52d7350a81b6bd46 644   outside/f1 (flat !)
+  d0f2f706468ab0e8bec7af87446835fb1b13511b 755 d outside/ (tree !)
   $ hg commit -m 'modify inside/f1'
   created new head
   $ hg files -r .
   inside/f1
   outside/f1 (flat !)
   outside/ (tree !)
+  $ hg manifest --debug
+  3f4197b4a11b9016e77ebc47fe566944885fd11b 644   inside/f1
+  7fb3bb6356d28d4dc352c5ba52d7350a81b6bd46 644   outside/f1 (flat !)
+  d0f2f706468ab0e8bec7af87446835fb1b13511b 755 d outside/ (tree !)
 Some filesystems (notably FAT/exFAT only store timestamps with 2
 seconds of precision, so by sleeping for 3 seconds, we can ensure that
 the timestamps of files stored by dirstate will appear older than the
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3502,8 +3502,8 @@
 if not node:
 node = rev
 
-char = {'l': '@', 'x': '*', '': ''}
-mode = {'l': '644', 'x': '755', '': '644'}
+char = {'l': '@', 'x': '*', '': '', 't': 'd'}
+mode = {'l': '644', 'x': '755', '': '644', 't': '755'}
 if node:
 repo = scmutil.unhidehashlikerevs(repo, [node], 'nowarn')
 ctx = scmutil.revsingle(repo, node)



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


D2234: narrow: restrict manifest iteration by using manifest.walk(matcher)

2018-02-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is only for root nodes, so it shouldn't really matter (they're
  rarely huge), but seems cleaner.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -152,7 +152,7 @@
 else:
 # For a root node, we need to include the node if any
 # files in the node match the narrowspec.
-needed = any(match(f) for f in curmf)
+needed = any(curmf.walk(match))
 
 if needed:
 for head in ellipsisheads[rev]:



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


D2232: treemanifest: add an optimized __nonzero__()

2018-02-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We use bool(manifest) in at least some places:
  
localrepo.py:1730
hgweb/webcommands.py:524
  
  Since the treemanifest class doesn't define __nonzero__() (before this
  patch), bool(manifest) will instead call __len__(), which can be slow
  for treemanifests. This patch may make a noticeable difference in the
  localrepo case above, but that only happens when committing a merge
  and I haven't timed it.
  
  Note that Durham already added a __nonzero__ implementation to
  manifestdict in 
https://phab.mercurial-scm.org/rHGb19291e5d506238acd84f5890da7adadd8167e82 
(manifest: add __nonzero__ method,
  2016-11-03).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/manifest.py

CHANGE DETAILS

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -755,6 +755,12 @@
 size += m.__len__()
 return size
 
+def __nonzero__(self):
+# Faster than "__len() != 0" since it avoids loading sub-manifests
+return not self._isempty()
+
+__bool__ = __nonzero__
+
 def _isempty(self):
 self._load() # for consistency; already loaded by all callers
 return (not self._files and (not self._dirs or



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


D2233: narrow: only diff manifest part within narrowspec when generating changegroup

2018-02-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Since 
https://phab.mercurial-scm.org/rHG959ebff3505a3e4c996b62b58659c286b7feb9a8 
(manifest: add match argument to diff and
  filesnotin, 2017-03-07), we have a more efficient way of diffing
  manifests while applying a matcher. Let's use that while generating
  narrowed changegroups, so we avoid diffing parts of the manifest that
  don't match the narrowspec.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -141,14 +141,14 @@
 # changesets because it's not always correct. TODO: could
 # we trust it for the non-merge case?
 p1mf = mfl[cl.changelogrevision(ps[0]).manifest].read()
-needed = any(match(f) for f in curmf.diff(p1mf).iterkeys())
+needed = bool(curmf.diff(p1mf, match))
 if not needed and len(ps) > 1:
 # For merge changes, the list of changed files is not
 # helpful, since we need to emit the merge if a file
 # in the narrow spec has changed on either side of the
 # merge. As a result, we do a manifest diff to check.
 p2mf = mfl[cl.changelogrevision(ps[1]).manifest].read()
-needed = any(match(f) for f in curmf.diff(p2mf).iterkeys())
+needed = bool(curmf.diff(p2mf, match))
 else:
 # For a root node, we need to include the node if any
 # files in the node match the narrowspec.



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


D2066: lfs: add a test showing bundle application could be broken

2018-02-13 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  This series worked for me in practice.  I assume there's no chance that this 
lands on stable to help people that are pushing to a repo converted to LFS, but 
that didn't reclone after converting?

INLINE COMMENTS

> test-lfs-bundle.t:22
> +  > [lfs]
> +  > url=file://$TESTTMP/lfs-remote
> +  > EOF

This needs to be 'url=file:$TESTDIR/lfs-remote' to keep MSYS happy.

REPOSITORY
  rHG Mercurial

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

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


D2231: narrow: fix for getting the username when running http server

2018-02-13 Thread idlsoft (Sandu Turcan)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4224f26c0d35: narrow: fix for getting the username when 
running http server (authored by idlsoft, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2231?vs=5649=5653

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -327,13 +327,14 @@
 part.addparam('treemanifest', '1')
 
 def applyacl_narrow(repo, kwargs):
-username = repo.ui.shortuser(repo.ui.username())
-user_includes = repo.ui.configlist(
+ui = repo.ui
+username = ui.shortuser(ui.environ.get('REMOTE_USER') or ui.username())
+user_includes = ui.configlist(
 _NARROWACL_SECTION, username + '.includes',
-repo.ui.configlist(_NARROWACL_SECTION, 'default.includes'))
-user_excludes = repo.ui.configlist(
+ui.configlist(_NARROWACL_SECTION, 'default.includes'))
+user_excludes = ui.configlist(
 _NARROWACL_SECTION, username + '.excludes',
-repo.ui.configlist(_NARROWACL_SECTION, 'default.excludes'))
+ui.configlist(_NARROWACL_SECTION, 'default.excludes'))
 if not user_includes:
 raise error.Abort(_("{} configuration for user {} is empty")
   .format(_NARROWACL_SECTION, username))



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


[PATCH 3 of 3] revert: account for computed changes in interactive revert (issue5789)

2018-02-13 Thread Denis Laxalde
# HG changeset patch
# User Denis Laxalde 
# Date 1518554564 -3600
#  Tue Feb 13 21:42:44 2018 +0100
# Node ID a7d28fab177642e028e37b77727603601c3a76cb
# Parent  4b8c889eb9d0b7ca6883b93dbd476323c94f677f
# EXP-Topic revert-interactive-pats
revert: account for computed changes in interactive revert (issue5789)

When going through _performrevert() in the interactive case, we build a
matcher with files to revert and pass it patch.diff() for later
selection of diff hunks to revert. The files set used to build the
matcher comes from dirstate and accounts for patterns explicitly passed
to revert ('hg revert -i ') and, in case of nonexistent pattern,
this set is empty (which is expected). Unfortunately, when going through
patch.diff() with the resulting matcher (for which .always() is True), a
new changes tuple will be built that completely ignores patterns passed
by the user. This leads to the situation described in issue5789, where
one gets prompted about reverting files unrelated to specified patterns
because they made a typo or so.

We fix this by building a 'changes' tuple (scmutil.status tuple) from
information computed during dirstate inspection in cmdutil.revert() and
pass this to _performrevert() which then hands it to patch.diff(), thus
avoiding re-computation of a 'changes' tuple when 'match.always is True'.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2829,6 +2829,12 @@ def revert(ui, repo, ctx, parents, *pats
 (unknown,   actions['unknown'],  discard),
 )
 
+# status for 'revert' action to be used in interactive case.
+torevertchanges = None
+if interactive:
+torevertchanges = scmutil.status(
+modified | dsmodified, [], [], deleted, [], [], [])
+
 for abs, (rel, exact) in sorted(names.items()):
 # target file to be touch on disk (relative to cwd)
 target = repo.wjoin(abs)
@@ -2872,7 +2878,8 @@ def revert(ui, repo, ctx, parents, *pats
 oplist = [actions[name][0] for name in needdata]
 _prefetchfiles(repo, ctx,
[f for sublist in oplist for f in sublist])
-_performrevert(repo, parents, ctx, actions, interactive, tobackup)
+_performrevert(repo, parents, ctx, actions, torevertchanges,
+   interactive, tobackup)
 
 if targetsubs:
 # Revert the subrepos on the revert list
@@ -2894,8 +2901,8 @@ def _prefetchfiles(repo, ctx, files):
 """Let extensions changing the storage layer prefetch content for any non
 merge based command."""
 
-def _performrevert(repo, parents, ctx, actions, interactive=False,
-   tobackup=None):
+def _performrevert(repo, parents, ctx, actions, changes=None,
+   interactive=False, tobackup=None):
 """function that actually perform all the actions computed for revert
 
 This is an independent function to let extension to plug in and react to
@@ -2957,6 +2964,7 @@ def _performrevert(repo, parents, ctx, a
 
 newlyaddedandmodifiedfiles = set()
 if interactive:
+assert changes
 # Prompt the user for changes to revert
 torevert = [repo.wjoin(f) for f in actions['revert'][0]]
 m = scmutil.match(ctx, torevert, matcher_opts)
@@ -2972,7 +2980,7 @@ def _performrevert(repo, parents, ctx, a
 node1, node2 = ctx.node(), None
 else:
 node1, node2 = None, ctx.node()
-diff = patch.diff(repo, node1, node2, m, opts=diffopts)
+diff = patch.diff(repo, node1, node2, m, changes, opts=diffopts)
 originalchunks = patch.parsepatch(diff)
 
 try:
diff --git a/tests/test-revert-interactive.t b/tests/test-revert-interactive.t
--- a/tests/test-revert-interactive.t
+++ b/tests/test-revert-interactive.t
@@ -428,9 +428,5 @@ When specified pattern does not exist, w
   b: no such file in rev b40d1912accf
   $ hg rev -i b
   b: no such file in rev b40d1912accf
-  diff --git a/a b/a
-  1 hunks, 1 lines changed
-  examine changes to 'a'? [Ynesfdaq?] abort: response expected
-  [255]
 
   $ cd ..
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 3] revert: precompute arguments of patch.diff() in _performrevert()

2018-02-13 Thread Denis Laxalde
# HG changeset patch
# User Denis Laxalde 
# Date 1518554320 -3600
#  Tue Feb 13 21:38:40 2018 +0100
# Node ID 4b8c889eb9d0b7ca6883b93dbd476323c94f677f
# Parent  75a4598a4375d80d240c19625e2c43a069ba9618
# EXP-Topic revert-interactive-pats
revert: precompute arguments of patch.diff() in _performrevert()

By factoring out arguments ordering for patch.diff() call, we can only
keep one diff = patch.diff(...) statement thus reducing code duplication.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2969,9 +2969,10 @@ def _performrevert(repo, parents, ctx, a
 operation = 'apply'
 reversehunks = False
 if reversehunks:
-diff = patch.diff(repo, ctx.node(), None, m, opts=diffopts)
+node1, node2 = ctx.node(), None
 else:
-diff = patch.diff(repo, None, ctx.node(), m, opts=diffopts)
+node1, node2 = None, ctx.node()
+diff = patch.diff(repo, node1, node2, m, opts=diffopts)
 originalchunks = patch.parsepatch(diff)
 
 try:
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 3] tests: add a test demonstrate that 'revert -i' ignores nonexistent patterns

2018-02-13 Thread Denis Laxalde
# HG changeset patch
# User Denis Laxalde 
# Date 1518377864 -3600
#  Sun Feb 11 20:37:44 2018 +0100
# Node ID 75a4598a4375d80d240c19625e2c43a069ba9618
# Parent  62a428bf63590f74024c6cc6c40b4178be086cc4
# EXP-Topic revert-interactive-pats
tests: add a test demonstrate that 'revert -i' ignores nonexistent patterns

As described in issue5789, when revert is called through:

  hg revert -i 

we'd expect the command to abort early. Currently, it just warns about
missing file but prompt about files unrelated to user arguments.

diff --git a/tests/test-revert-interactive.t b/tests/test-revert-interactive.t
--- a/tests/test-revert-interactive.t
+++ b/tests/test-revert-interactive.t
@@ -420,4 +420,17 @@ When a line without EOL is selected duri
   $ cat a
   0
 
+When specified pattern does not exist, we should exit early (issue5789).
+
+  $ hg files
+  a
+  $ hg rev b
+  b: no such file in rev b40d1912accf
+  $ hg rev -i b
+  b: no such file in rev b40d1912accf
+  diff --git a/a b/a
+  1 hunks, 1 lines changed
+  examine changes to 'a'? [Ynesfdaq?] abort: response expected
+  [255]
+
   $ cd ..
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2067: changegroup: do not delta lfs revisions

2018-02-13 Thread quark (Jun Wu)
quark updated this revision to Diff 5650.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2067?vs=5327=5650

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

AFFECTED FILES
  mercurial/changegroup.py
  mercurial/revlog.py
  tests/test-lfs-bundle.t
  tests/test-lfs.t

CHANGE DETAILS

diff --git a/tests/test-lfs.t b/tests/test-lfs.t
--- a/tests/test-lfs.t
+++ b/tests/test-lfs.t
@@ -371,7 +371,7 @@
   uncompressed size of bundle content:
* (changelog) (glob)
* (manifests) (glob)
-   *  a (glob)
+  * a (glob)
   $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
   $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a
   5 branching
diff --git a/tests/test-lfs-bundle.t b/tests/test-lfs-bundle.t
--- a/tests/test-lfs-bundle.t
+++ b/tests/test-lfs-bundle.t
@@ -95,6 +95,6 @@
   2 integrity errors encountered!
   (first damaged changeset appears to be 2)
    Applying src-lfs.bundle to dst-normal 
-  CRASHED
+  OK
    Applying src-lfs.bundle to dst-lfs 
   OK
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -78,6 +78,8 @@
 REVIDX_EXTSTORED,
 ]
 REVIDX_KNOWN_FLAGS = util.bitsfrom(REVIDX_FLAGS_ORDER)
+# bitmark for flags that could cause rawdata content change
+REVIDX_RAWTEXT_CHANGING_FLAGS = REVIDX_ISCENSORED | REVIDX_EXTSTORED
 
 # max size of revlog with inline data
 _maxinline = 131072
@@ -97,7 +99,8 @@
 """Register a flag processor on a revision data flag.
 
 Invariant:
-- Flags need to be defined in REVIDX_KNOWN_FLAGS and REVIDX_FLAGS_ORDER.
+- Flags need to be defined in REVIDX_KNOWN_FLAGS and REVIDX_FLAGS_ORDER,
+  and REVIDX_RAWTEXT_CHANGING_FLAGS if they can alter rawtext.
 - Only one flag processor can be registered on a specific flag.
 - flagprocessors must be 3-tuples of functions (read, write, raw) with the
   following signatures:
@@ -739,6 +742,18 @@
 except KeyError:
 return False
 
+def candelta(self, baserev, rev):
+"""whether two revisions (prev, rev) can be delta-ed or not"""
+# Disable delta if either rev requires a content-changing flag
+# processor (ex. LFS). This is because such flag processor can alter
+# the rawtext content that the delta will be based on, and two clients
+# could have a same revlog node with different flags (i.e. different
+# rawtext contents) and the delta could be incompatible.
+if ((self.flags(baserev) & REVIDX_RAWTEXT_CHANGING_FLAGS)
+or (self.flags(rev) & REVIDX_RAWTEXT_CHANGING_FLAGS)):
+return False
+return True
+
 def clearcaches(self):
 self._cache = None
 self._chainbasecache.clear()
diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -770,6 +770,8 @@
 progress(msgbundling, None)
 
 def deltaparent(self, revlog, rev, p1, p2, prev):
+if not revlog.candelta(prev, rev):
+raise error.ProgrammingError('cg1 should not be used in this case')
 return prev
 
 def revchunk(self, revlog, rev, prev, linknode):
@@ -829,16 +831,19 @@
 # expensive. The revlog caches should have prev cached, meaning
 # less CPU for changegroup generation. There is likely room to add
 # a flag and/or config option to control this behavior.
-return prev
+base = prev
 elif dp == nullrev:
 # revlog is configured to use full snapshot for a reason,
 # stick to full snapshot.
-return nullrev
+base = nullrev
 elif dp not in (p1, p2, prev):
 # Pick prev when we can't be sure remote has the base revision.
 return prev
 else:
-return dp
+base = dp
+if base != nullrev and not revlog.candelta(base, rev):
+base = nullrev
+return base
 
 def builddeltaheader(self, node, p1n, p2n, basenode, linknode, flags):
 # Do nothing with flags, it is implicitly 0 in cg1 and cg2



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


D2068: revlog: do not use delta for lfs revisions

2018-02-13 Thread quark (Jun Wu)
quark updated this revision to Diff 5651.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2068?vs=5329=5651

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

AFFECTED FILES
  mercurial/revlog.py
  tests/test-lfs-bundle.t
  tests/test-revlog-raw.py

CHANGE DETAILS

diff --git a/tests/test-revlog-raw.py b/tests/test-revlog-raw.py
--- a/tests/test-revlog-raw.py
+++ b/tests/test-revlog-raw.py
@@ -114,6 +114,8 @@
 else:
 # suboptimal deltaparent
 deltaparent = min(0, parentrev)
+if not rlog.candelta(deltaparent, r):
+deltaparent = -1
 return {'node': rlog.node(r), 'p1': pnode, 'p2': node.nullid,
 'cs': rlog.node(rlog.linkrev(r)), 'flags': rlog.flags(r),
 'deltabase': rlog.node(deltaparent),
@@ -151,12 +153,12 @@
 for r in rlog:
 p1 = rlog.node(r - 1)
 p2 = node.nullid
-if r == 0:
+if r == 0 or rlog.flags(r):
 text = rlog.revision(r, raw=True)
 cachedelta = None
 else:
-# deltaparent is more interesting if it has the EXTSTORED flag.
-deltaparent = max([0] + [p for p in range(r - 2) if rlog.flags(p)])
+# deltaparent cannot have EXTSTORED flag.
+deltaparent = max([-1] + [p for p in range(r) if not 
rlog.flags(p)])
 text = None
 cachedelta = (deltaparent, rlog.revdiff(deltaparent, r))
 flags = rlog.flags(r)
@@ -262,8 +264,9 @@
 result.append((text, rawtext))
 
 # Verify flags like isdelta, isext work as expected
-if bool(rlog.deltaparent(rev) > -1) != isdelta:
-abort('rev %d: isdelta is ineffective' % rev)
+# isdelta can be overridden to False if this or p1 has isext set
+if bool(rlog.deltaparent(rev) > -1) and not isdelta:
+abort('rev %d: isdelta is unexpected' % rev)
 if bool(rlog.flags(rev)) != isext:
 abort('rev %d: isext is ineffective' % rev)
 return result
diff --git a/tests/test-lfs-bundle.t b/tests/test-lfs-bundle.t
--- a/tests/test-lfs-bundle.t
+++ b/tests/test-lfs-bundle.t
@@ -90,10 +90,7 @@
    Applying src-normal.bundle to dst-normal 
   OK
    Applying src-normal.bundle to dst-lfs 
-   X@2: unpacking bcc7d23fa6b7: integrity check failed on data/X.i:2
-   Y@2: unpacking 46017a6640e7: integrity check failed on data/Y.i:2
-  2 integrity errors encountered!
-  (first damaged changeset appears to be 2)
+  CRASHED
    Applying src-lfs.bundle to dst-normal 
   OK
    Applying src-lfs.bundle to dst-lfs 
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -408,6 +408,9 @@
 for candidaterevs in self._getcandidaterevs(p1, p2, cachedelta):
 nominateddeltas = []
 for candidaterev in candidaterevs:
+# no delta for rawtext-changing revs (see "candelta" for why)
+if revlog.flags(candidaterev) & REVIDX_RAWTEXT_CHANGING_FLAGS:
+continue
 candidatedelta = self._builddeltainfo(revinfo, candidaterev, 
fh)
 if revlog._isgooddeltainfo(candidatedelta, revinfo.textlen):
 nominateddeltas.append(candidatedelta)
@@ -2102,7 +2105,12 @@
 deltacomputer = _deltacomputer(self)
 
 revinfo = _revisioninfo(node, p1, p2, btext, textlen, cachedelta, 
flags)
-deltainfo = deltacomputer.finddeltainfo(revinfo, fh)
+
+# no delta for flag processor revision (see "candelta" for why)
+if flags & REVIDX_KNOWN_FLAGS:
+deltainfo = None
+else:
+deltainfo = deltacomputer.finddeltainfo(revinfo, fh)
 
 if deltainfo is not None:
 base = deltainfo.base



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


D2069: revlog: resolve lfs rawtext to vanilla rawtext before applying delta

2018-02-13 Thread quark (Jun Wu)
quark updated this revision to Diff 5652.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2069?vs=5271=5652

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

AFFECTED FILES
  mercurial/revlog.py
  tests/test-lfs-bundle.t

CHANGE DETAILS

diff --git a/tests/test-lfs-bundle.t b/tests/test-lfs-bundle.t
--- a/tests/test-lfs-bundle.t
+++ b/tests/test-lfs-bundle.t
@@ -90,7 +90,7 @@
    Applying src-normal.bundle to dst-normal 
   OK
    Applying src-normal.bundle to dst-lfs 
-  CRASHED
+  OK
    Applying src-lfs.bundle to dst-normal 
   OK
    Applying src-lfs.bundle to dst-lfs 
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -337,7 +337,9 @@
len(delta) - hlen):
 btext[0] = delta[hlen:]
 else:
-basetext = revlog.revision(baserev, _df=fh, raw=True)
+# deltabase is rawtext before changed by flag processors, which is
+# equivalent to non-raw text
+basetext = revlog.revision(baserev, _df=fh, raw=False)
 btext[0] = mdiff.patch(basetext, delta)
 
 try:
@@ -2096,7 +2098,10 @@
 # full versions are inserted when the needed deltas
 # become comparable to the uncompressed text
 if rawtext is None:
-textlen = mdiff.patchedsize(self.rawsize(cachedelta[0]),
+# need rawtext size, before changed by flag processors, which is
+# the non-raw size. use revlog explicitly to avoid filelog's extra
+# logic that might remove metadata size.
+textlen = mdiff.patchedsize(revlog.size(self, cachedelta[0]),
 cachedelta[1])
 else:
 textlen = len(rawtext)



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


D2231: narrow: fix for getting the username when running http server

2018-02-13 Thread idlsoft (Sandu Turcan)
idlsoft created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -327,13 +327,14 @@
 part.addparam('treemanifest', '1')
 
 def applyacl_narrow(repo, kwargs):
-username = repo.ui.shortuser(repo.ui.username())
-user_includes = repo.ui.configlist(
+ui = repo.ui
+username = ui.shortuser(ui.environ.get('REMOTE_USER') or ui.username())
+user_includes = ui.configlist(
 _NARROWACL_SECTION, username + '.includes',
-repo.ui.configlist(_NARROWACL_SECTION, 'default.includes'))
-user_excludes = repo.ui.configlist(
+ui.configlist(_NARROWACL_SECTION, 'default.includes'))
+user_excludes = ui.configlist(
 _NARROWACL_SECTION, username + '.excludes',
-repo.ui.configlist(_NARROWACL_SECTION, 'default.excludes'))
+ui.configlist(_NARROWACL_SECTION, 'default.excludes'))
 if not user_includes:
 raise error.Abort(_("{} configuration for user {} is empty")
   .format(_NARROWACL_SECTION, username))



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


D2067: changegroup: do not delta lfs revisions

2018-02-13 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D2067#34758, @indygreg wrote:
  
  > This looks mostly good. I would like a change to address a future footgun 
though.
  >
  > I would also appreciate someone familiar with censor and narrow to weigh in 
on the implications of disabling delta generation for revisions that have the 
censor and ellipsis flags set. I'm pretty sure narrow will cope since it 
reimplements changegroup generation. Not sure how censor will react. (But I 
know we already have random code for detecting censored nodes during 
changegroup generation.)
  
  
  I think narrow would be functionally fine with it disabled, but it would be 
terrible for storage space. We don't set the ellipsis flag on files, but we do 
on manifests (and we use tree manifests). Some directories have tens of 
thousands of entries and tens of thousands of entries and tens of thousands of 
revisions. Storing them all in full would be bad. We get a compression of close 
to 2000x (not a typo) on these directories. I just created a pretty large clone 
for testing this and one directory's revlog there ended up being 9MB instead of 
15GB.
  
  In https://phab.mercurial-scm.org/D2067#36959, @durin42 wrote:
  
  > In https://phab.mercurial-scm.org/D2067#34758, @indygreg wrote:
  >
  > > This looks mostly good. I would like a change to address a future footgun 
though.
  > >
  > > I would also appreciate someone familiar with censor and narrow to weigh 
in on the implications of disabling delta generation for revisions that have 
the censor and ellipsis flags set. I'm pretty sure narrow will cope since it 
reimplements changegroup generation. Not sure how censor will react. (But I 
know we already have random code for detecting censored nodes during 
changegroup generation.)
  >
  >
  > Hmm, I could swear we already don't generate deltas for ellipsis nodes, and 
I'm having trouble defending the idea that maybe we should. Censor I'm 99% sure 
disables deltas. I'll ask adgar, but if you don't hear from me assume I was 
right.

REPOSITORY
  rHG Mercurial

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

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


D2067: changegroup: do not delta lfs revisions

2018-02-13 Thread durin42 (Augie Fackler)
durin42 added a comment.


  In https://phab.mercurial-scm.org/D2067#34758, @indygreg wrote:
  
  > This looks mostly good. I would like a change to address a future footgun 
though.
  >
  > I would also appreciate someone familiar with censor and narrow to weigh in 
on the implications of disabling delta generation for revisions that have the 
censor and ellipsis flags set. I'm pretty sure narrow will cope since it 
reimplements changegroup generation. Not sure how censor will react. (But I 
know we already have random code for detecting censored nodes during 
changegroup generation.)
  
  
  Hmm, I could swear we already don't generate deltas for ellipsis nodes, and 
I'm having trouble defending the idea that maybe we should. Censor I'm 99% sure 
disables deltas. I'll ask adgar, but if you don't hear from me assume I was 
right.

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH] dirstate: drop explicitly-specified files that shouldn't match (BC)

2018-02-13 Thread Martin von Zweigbergk via Mercurial-devel
On Tue, Feb 13, 2018 at 10:19 AM Augie Fackler  wrote:

>
>
> > On Feb 10, 2018, at 23:09, Yuya Nishihara  wrote:
> >
> > # HG changeset patch
> > # User Yuya Nishihara 
> > # Date 1516963719 -32400
> > #  Fri Jan 26 19:48:39 2018 +0900
> > # Node ID ba8846546795996af10fe93db4317b855018d749
> > # Parent  91aac8e6604d1aa08b2683c1d4c7d1936f226e48
> > dirstate: drop explicitly-specified files that shouldn't match (BC)
>
> New tests have appeared since you wrote this, and appear to cause surprise
> breakage. I don't have time to look now, but for now I'm going to discard
> this patch (but I agree we should come back to it.)
>

I'm pretty sure that'll need the same workaround as in sparse.py (not
surprising, really, since we copied a lot from there).


>
> cd tests && python run-tests.py -j7 test-narrow-commit.t
>
> --- /Users/augie/Programming/hg/crew/tests/test-narrow-commit.t
> +++ /Users/augie/Programming/hg/crew/tests/test-narrow-commit.t.flat.err
> @@ -49,12 +49,8 @@
>matcher: 
>f  inside/f1  inside/f1
>$ hg add outside/f1
> -  abort: cannot track 'outside/f1' - it is outside the narrow clone
> -  [255]
>$ touch outside/f3
>$ hg add outside/f3
> -  abort: cannot track 'outside/f3' - it is outside the narrow clone
> -  [255]
>$ rm -r outside
>
>  Can modify dirstate inside
>
> ERROR: test-narrow-commit.t (case flat) output changed
> !
> --- /Users/augie/Programming/hg/crew/tests/test-narrow-commit.t
> +++ /Users/augie/Programming/hg/crew/tests/test-narrow-commit.t.tree.err
> @@ -49,12 +49,8 @@
>matcher: 
>f  inside/f1  inside/f1
>$ hg add outside/f1
> -  abort: cannot track 'outside/f1' - it is outside the narrow clone
> -  [255]
>$ touch outside/f3
>$ hg add outside/f3
> -  abort: cannot track 'outside/f3' - it is outside the narrow clone
> -  [255]
>$ rm -r outside
>
>  Can modify dirstate inside
>
> ERROR: test-narrow-commit.t (case tree) output changed
> !
> Failed test-narrow-commit.t (case flat): output changed
> Failed test-narrow-commit.t (case tree): output changed
>
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] dirstate: drop explicitly-specified files that shouldn't match (BC)

2018-02-13 Thread Augie Fackler


> On Feb 10, 2018, at 23:09, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1516963719 -32400
> #  Fri Jan 26 19:48:39 2018 +0900
> # Node ID ba8846546795996af10fe93db4317b855018d749
> # Parent  91aac8e6604d1aa08b2683c1d4c7d1936f226e48
> dirstate: drop explicitly-specified files that shouldn't match (BC)

New tests have appeared since you wrote this, and appear to cause surprise 
breakage. I don't have time to look now, but for now I'm going to discard this 
patch (but I agree we should come back to it.)

cd tests && python run-tests.py -j7 test-narrow-commit.t

--- /Users/augie/Programming/hg/crew/tests/test-narrow-commit.t
+++ /Users/augie/Programming/hg/crew/tests/test-narrow-commit.t.flat.err
@@ -49,12 +49,8 @@
   matcher: 
   f  inside/f1  inside/f1
   $ hg add outside/f1
-  abort: cannot track 'outside/f1' - it is outside the narrow clone
-  [255]
   $ touch outside/f3
   $ hg add outside/f3
-  abort: cannot track 'outside/f3' - it is outside the narrow clone
-  [255]
   $ rm -r outside

 Can modify dirstate inside

ERROR: test-narrow-commit.t (case flat) output changed
!
--- /Users/augie/Programming/hg/crew/tests/test-narrow-commit.t
+++ /Users/augie/Programming/hg/crew/tests/test-narrow-commit.t.tree.err
@@ -49,12 +49,8 @@
   matcher: 
   f  inside/f1  inside/f1
   $ hg add outside/f1
-  abort: cannot track 'outside/f1' - it is outside the narrow clone
-  [255]
   $ touch outside/f3
   $ hg add outside/f3
-  abort: cannot track 'outside/f3' - it is outside the narrow clone
-  [255]
   $ rm -r outside

 Can modify dirstate inside

ERROR: test-narrow-commit.t (case tree) output changed
!
Failed test-narrow-commit.t (case flat): output changed
Failed test-narrow-commit.t (case tree): output changed

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


mercurial@36059: 58 new changesets

2018-02-13 Thread Mercurial Commits
58 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/f8ad57d24252
changeset:   36002:f8ad57d24252
parent:  36000:91aac8e6604d
user:Yuya Nishihara 
date:Sun Jan 21 13:40:31 2018 +0900
summary: log: pass ctx to makefilematcher() and makehunksfilter() functions

https://www.mercurial-scm.org/repo/hg/rev/fcde8946c553
changeset:   36003:fcde8946c553
user:Yuya Nishihara 
date:Sun Jan 21 14:07:52 2018 +0900
summary: logcmdutil: hold makefilematcher/makehunksfilter() by 
changesetpriner (API)

https://www.mercurial-scm.org/repo/hg/rev/d4c210ee894f
changeset:   36004:d4c210ee894f
user:Yuya Nishihara 
date:Sun Jan 21 14:37:04 2018 +0900
summary: logcmdutil: unindent diff generator of changesetprinter

https://www.mercurial-scm.org/repo/hg/rev/dd77e36eabb6
changeset:   36005:dd77e36eabb6
user:Yuya Nishihara 
date:Sun Jan 21 15:34:37 2018 +0900
summary: logcmdutil: create hunksfilter and filematcher even if no diff 
option given

https://www.mercurial-scm.org/repo/hg/rev/f113ac0750f3
changeset:   36006:f113ac0750f3
user:Yuya Nishihara 
date:Sun Jan 21 15:50:24 2018 +0900
summary: log: drop dead code to concatenate --line-range patterns and pats

https://www.mercurial-scm.org/repo/hg/rev/29b83c08afe0
changeset:   36007:29b83c08afe0
user:Yuya Nishihara 
date:Sun Jan 21 15:54:18 2018 +0900
summary: log: pack filematcher and hunksfilter into changesetdiffer object

https://www.mercurial-scm.org/repo/hg/rev/006ff7268c5c
changeset:   36008:006ff7268c5c
user:Yuya Nishihara 
date:Wed Feb 07 23:22:53 2018 +0900
summary: diff: remove fp.write() wrapper which drops label argument

https://www.mercurial-scm.org/repo/hg/rev/55e8efa2451a
changeset:   36009:55e8efa2451a
user:Yuya Nishihara 
date:Tue Feb 06 22:36:38 2018 +0900
summary: subrepo: split non-core functions to new module

https://www.mercurial-scm.org/repo/hg/rev/46a54de96a54
changeset:   36010:46a54de96a54
user:Yuya Nishihara 
date:Tue Feb 06 22:55:02 2018 +0900
summary: merge: cut import cycle at merge -> extensions

https://www.mercurial-scm.org/repo/hg/rev/c02200b11c39
changeset:   36011:c02200b11c39
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Feb 11 17:30:21 2018 +0530
summary: py3: replace file() with open() in test-clone.t

https://www.mercurial-scm.org/repo/hg/rev/233fb0b91a35
changeset:   36012:233fb0b91a35
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Feb 11 17:30:42 2018 +0530
summary: py3: replace file() with open() in test-convert-mtn.t

https://www.mercurial-scm.org/repo/hg/rev/42542adb8944
changeset:   36013:42542adb8944
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Feb 11 16:56:47 2018 +0530
summary: py3: replace file() with open() in test-convert-p4-filetypes.t

https://www.mercurial-scm.org/repo/hg/rev/d7238d125aa2
changeset:   36014:d7238d125aa2
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Feb 11 16:58:22 2018 +0530
summary: py3: replace file() with open() in test-win32text.t

https://www.mercurial-scm.org/repo/hg/rev/3790d735ff68
changeset:   36015:3790d735ff68
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Feb 11 16:59:35 2018 +0530
summary: py3: replace file() with open() in test-walk.t

https://www.mercurial-scm.org/repo/hg/rev/ca62987f3f7d
changeset:   36016:ca62987f3f7d
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Feb 11 17:00:21 2018 +0530
summary: py3: replace file() with open() in test-transplant.t

https://www.mercurial-scm.org/repo/hg/rev/eed40f0f4c6f
changeset:   36017:eed40f0f4c6f
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Feb 11 17:01:25 2018 +0530
summary: py3: replace file() with open() in test-tag.t

https://www.mercurial-scm.org/repo/hg/rev/1c322658f43e
changeset:   36018:1c322658f43e
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Feb 11 17:02:14 2018 +0530
summary: py3: replace file() with open() in test-subrepo-missing.t

https://www.mercurial-scm.org/repo/hg/rev/2ea0e89bca1e
changeset:   36019:2ea0e89bca1e
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Feb 11 17:03:17 2018 +0530
summary: py3: replace file() with open() in test-relink.t

https://www.mercurial-scm.org/repo/hg/rev/bfc9ab6c1bec
changeset:   36020:bfc9ab6c1bec
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Feb 11 17:03:50 2018 +0530
summary: py3: replace file() with open() in test-patch-offset.t

https://www.mercurial-scm.org/repo/hg/rev/85c94c9d342b
changeset:   36021:85c94c9d342b
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Feb 11 17:04:21 2018 +0530
summary: py3: 

[Bug 5791] New: bugzilla LFS component doesn't notify mailing list

2018-02-13 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5791

Bug ID: 5791
   Summary: bugzilla LFS component doesn't notify mailing list
   Product: Mercurial project
   Version: unspecified
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: infrastructure
  Assignee: bugzi...@mercurial-scm.org
  Reporter: hol...@alumni.cmu.edu
CC: kbullock+mercur...@ringworld.org,
mercurial-devel@mercurial-scm.org

I created bug 5790 in the new LFS component, but no notification was sent to
mercurial-devel@mercurial-scm.org.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] dirstate: drop explicitly-specified files that shouldn't match (BC)

2018-02-13 Thread Augie Fackler
Queued, per the very helpful explanations. Thanks all!

> On Feb 13, 2018, at 12:28, Martin von Zweigbergk  
> wrote:
> 
> I agree with Yuya (and apparently with former me; thanks for digging that up, 
> Matt). I think it's just an unintended consequence of how the dirstate walk 
> works, but I'm not sure. The exception for explicit files also bothered me 
> when I was working on the matcher code a year or so ago. I actually added the 
> exception to the matcher code because I thought it was always working like 
> that (not just for dirstate) in a83a7d27911e (match: handle excludes using 
> new differencematcher, 2017-05-16). It was only recently that Yuya realized 
> that it used to be inconsistent and that I probably made it consistently bad 
> because I didn't realize it was inconsistent to start with, see 821d8a5ab4ff 
> (match: do not weirdly include explicit files excluded by -X option, 
> 2018-01-16).
> 
> So I guess I just think it feels wrong to include explicit matches. I wish I 
> could point to something that would actually crash (e.g. narrowhg), but I 
> can't think of anything.
> 
> Also, thanks for working on this, Yuya! I feel a bit guilty for never getting 
> around to it.
> 
> On Sun, Feb 11, 2018 at 12:54 PM Matt Harbison  > wrote:
> On Sun, 11 Feb 2018 09:17:42 -0500, Yuya Nishihara  > wrote:
> 
> > On Sun, 11 Feb 2018 08:58:48 -0500, Augie Fackler wrote:
> >> On Sun, Feb 11, 2018 at 01:09:50PM +0900, Yuya Nishihara wrote:
> >> > # HG changeset patch
> >> > # User Yuya Nishihara >
> >> > # Date 1516963719 -32400
> >> > #  Fri Jan 26 19:48:39 2018 +0900
> >> > # Node ID ba8846546795996af10fe93db4317b855018d749
> >> > # Parent  91aac8e6604d1aa08b2683c1d4c7d1936f226e48
> >> > dirstate: drop explicitly-specified files that shouldn't match (BC)
> >>
> >> Hmm. I'm not sure I like this behavior change. The current behavior is
> >> consistent with how an explicitly-tracked file shows up in status even
> >> if it's matched by .hgignore.
> >>
> >> Any particular reason to go this route?
> >
> > The current behavior is inconsistent with other commands, notably log and
> > files.
> >
> >   $ hg files hg -X hg
> >
> > Even more, it's inconsistent with status --change.
> >
> >   $ hg status --all hg -X hg
> >   C hg
> >   $ hg status --all hg -X hg --change .
> >
> > So I believe it's a bug of dirsate.walk().
> 
> Related: https://bz.mercurial-scm.org/show_bug.cgi?id=4679 
> 
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org 
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel 
> 

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


Re: [PATCH] dirstate: drop explicitly-specified files that shouldn't match (BC)

2018-02-13 Thread Martin von Zweigbergk via Mercurial-devel
I agree with Yuya (and apparently with former me; thanks for digging that
up, Matt). I think it's just an unintended consequence of how the dirstate
walk works, but I'm not sure. The exception for explicit files also
bothered me when I was working on the matcher code a year or so ago. I
actually added the exception to the matcher code because I thought it was
always working like that (not just for dirstate) in a83a7d27911e (match:
handle excludes using new differencematcher, 2017-05-16). It was only
recently that Yuya realized that it used to be inconsistent and that I
probably made it consistently bad because I didn't realize it was
inconsistent to start with, see 821d8a5ab4ff (match: do not weirdly include
explicit files excluded by -X option, 2018-01-16).

So I guess I just think it feels wrong to include explicit matches. I wish
I could point to something that would actually crash (e.g. narrowhg), but I
can't think of anything.

Also, thanks for working on this, Yuya! I feel a bit guilty for never
getting around to it.

On Sun, Feb 11, 2018 at 12:54 PM Matt Harbison 
wrote:

> On Sun, 11 Feb 2018 09:17:42 -0500, Yuya Nishihara  wrote:
>
> > On Sun, 11 Feb 2018 08:58:48 -0500, Augie Fackler wrote:
> >> On Sun, Feb 11, 2018 at 01:09:50PM +0900, Yuya Nishihara wrote:
> >> > # HG changeset patch
> >> > # User Yuya Nishihara 
> >> > # Date 1516963719 -32400
> >> > #  Fri Jan 26 19:48:39 2018 +0900
> >> > # Node ID ba8846546795996af10fe93db4317b855018d749
> >> > # Parent  91aac8e6604d1aa08b2683c1d4c7d1936f226e48
> >> > dirstate: drop explicitly-specified files that shouldn't match (BC)
> >>
> >> Hmm. I'm not sure I like this behavior change. The current behavior is
> >> consistent with how an explicitly-tracked file shows up in status even
> >> if it's matched by .hgignore.
> >>
> >> Any particular reason to go this route?
> >
> > The current behavior is inconsistent with other commands, notably log and
> > files.
> >
> >   $ hg files hg -X hg
> >
> > Even more, it's inconsistent with status --change.
> >
> >   $ hg status --all hg -X hg
> >   C hg
> >   $ hg status --all hg -X hg --change .
> >
> > So I believe it's a bug of dirsate.walk().
>
> Related: https://bz.mercurial-scm.org/show_bug.cgi?id=4679
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2199: tests: glob over line number

2018-02-13 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG802742769680: tests: glob over line number (authored by 
indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2199?vs=5568=5645

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

AFFECTED FILES
  tests/test-narrow-pull.t

CHANGE DETAILS

diff --git a/tests/test-narrow-pull.t b/tests/test-narrow-pull.t
--- a/tests/test-narrow-pull.t
+++ b/tests/test-narrow-pull.t
@@ -166,7 +166,7 @@
 
 We should also be able to unshare without breaking everything:
   $ hg unshare
-  devel-warn: write with no wlock: "narrowspec" at: 
*/hgext/narrow/narrowrepo.py:43 (unsharenarrowspec) (glob)
+  devel-warn: write with no wlock: "narrowspec" at: 
*/hgext/narrow/narrowrepo.py:* (unsharenarrowspec) (glob)
   $ hg verify
   checking changesets
   checking manifests



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


D2200: hg: move share._getsrcrepo into core

2018-02-13 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0fe7e39dc683: hg: move share._getsrcrepo into core 
(authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2200?vs=5569=5646

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

AFFECTED FILES
  hgext/journal.py
  hgext/narrow/narrowrepo.py
  hgext/narrow/narrowspec.py
  hgext/share.py
  mercurial/hg.py

CHANGE DETAILS

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -202,6 +202,24 @@
 return ''
 return os.path.basename(os.path.normpath(path))
 
+def sharedreposource(repo):
+"""Returns repository object for source repository of a shared repo.
+
+If repo is not a shared repository, returns None.
+"""
+if repo.sharedpath == repo.path:
+return None
+
+if util.safehasattr(repo, 'srcrepo') and repo.srcrepo:
+return repo.srcrepo
+
+# the sharedpath always ends in the .hg; we want the path to the repo
+source = repo.vfs.split(repo.sharedpath)[0]
+srcurl, branches = parseurl(source)
+srcrepo = repository(repo.ui, srcurl)
+repo.srcrepo = srcrepo
+return srcrepo
+
 def share(ui, source, dest=None, update=True, bookmarks=True, defaultpath=None,
   relative=False):
 '''create a shared repository'''
diff --git a/hgext/share.py b/hgext/share.py
--- a/hgext/share.py
+++ b/hgext/share.py
@@ -52,9 +52,6 @@
 util,
 )
 
-repository = hg.repository
-parseurl = hg.parseurl
-
 cmdtable = {}
 command = registrar.command(cmdtable)
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' 
for
@@ -135,27 +132,9 @@
 return False
 return hg.sharedbookmarks in shared
 
-def _getsrcrepo(repo):
-"""
-Returns the source repository object for a given shared repository.
-If repo is not a shared repository, return None.
-"""
-if repo.sharedpath == repo.path:
-return None
-
-if util.safehasattr(repo, 'srcrepo') and repo.srcrepo:
-return repo.srcrepo
-
-# the sharedpath always ends in the .hg; we want the path to the repo
-source = repo.vfs.split(repo.sharedpath)[0]
-srcurl, branches = parseurl(source)
-srcrepo = repository(repo.ui, srcurl)
-repo.srcrepo = srcrepo
-return srcrepo
-
 def getbkfile(orig, repo):
 if _hassharedbookmarks(repo):
-srcrepo = _getsrcrepo(repo)
+srcrepo = hg.sharedreposource(repo)
 if srcrepo is not None:
 # just orig(srcrepo) doesn't work as expected, because
 # HG_PENDING refers repo.root.
@@ -186,7 +165,7 @@
 orig(self, tr)
 
 if _hassharedbookmarks(self._repo):
-srcrepo = _getsrcrepo(self._repo)
+srcrepo = hg.sharedreposource(self._repo)
 if srcrepo is not None:
 category = 'share-bookmarks'
 tr.addpostclose(category, lambda tr: self._writerepo(srcrepo))
@@ -196,6 +175,6 @@
 orig(self, repo)
 
 if _hassharedbookmarks(self._repo):
-srcrepo = _getsrcrepo(self._repo)
+srcrepo = hg.sharedreposource(self._repo)
 if srcrepo is not None:
 orig(self, srcrepo)
diff --git a/hgext/narrow/narrowspec.py b/hgext/narrow/narrowspec.py
--- a/hgext/narrow/narrowspec.py
+++ b/hgext/narrow/narrowspec.py
@@ -12,14 +12,11 @@
 from mercurial.i18n import _
 from mercurial import (
 error,
+hg,
 match as matchmod,
 util,
 )
 
-from .. import (
-share,
-)
-
 FILENAME = 'narrowspec'
 
 def _parsestoredpatterns(text):
@@ -133,7 +130,7 @@
 
 def load(repo):
 if repo.shared():
-repo = share._getsrcrepo(repo)
+repo = hg.sharedreposource(repo)
 try:
 spec = repo.vfs.read(FILENAME)
 except IOError as e:
@@ -150,7 +147,7 @@
 def save(repo, includepats, excludepats):
 spec = format(includepats, excludepats)
 if repo.shared():
-repo = share._getsrcrepo(repo)
+repo = hg.sharedreposource(repo)
 repo.vfs.write(FILENAME, spec)
 
 def restrictpatterns(req_includes, req_excludes, repo_includes, repo_excludes):
diff --git a/hgext/narrow/narrowrepo.py b/hgext/narrow/narrowrepo.py
--- a/hgext/narrow/narrowrepo.py
+++ b/hgext/narrow/narrowrepo.py
@@ -9,15 +9,12 @@
 
 from mercurial import (
 bundlerepo,
+hg,
 localrepo,
 match as matchmod,
 scmutil,
 )
 
-from .. import (
-share,
-)
-
 from . import (
 narrowrevlog,
 narrowspec,
@@ -37,7 +34,7 @@
 def unsharenarrowspec(orig, ui, repo, repopath):
 if (REQUIREMENT in repo.requirements
 and repo.path == repopath and repo.shared()):
-srcrepo = share._getsrcrepo(repo)
+srcrepo = hg.sharedreposource(repo)
 with srcrepo.vfs(narrowspec.FILENAME) as f:
 spec = f.read()
 with repo.vfs(narrowspec.FILENAME, 'w') as f:
diff --git a/hgext/journal.py b/hgext/journal.py
--- a/hgext/journal.py
+++ 

D2201: narrowspec: move module into core

2018-02-13 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9fd8c2a3db5a: narrowspec: move module into core (authored 
by indygreg, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D2201?vs=5570=5647#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2201?vs=5570=5647

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

AFFECTED FILES
  hgext/narrow/narrowbundle2.py
  hgext/narrow/narrowcommands.py
  hgext/narrow/narrowdirstate.py
  hgext/narrow/narrowrepo.py
  hgext/narrow/narrowspec.py
  hgext/narrow/narrowwirepeer.py
  mercurial/narrowspec.py
  tests/test-narrow-expanddirstate.t

CHANGE DETAILS

diff --git a/tests/test-narrow-expanddirstate.t 
b/tests/test-narrow-expanddirstate.t
--- a/tests/test-narrow-expanddirstate.t
+++ b/tests/test-narrow-expanddirstate.t
@@ -51,22 +51,22 @@
   > from mercurial import extensions
   > from mercurial import localrepo
   > from mercurial import match as matchmod
+  > from mercurial import narrowspec
   > from mercurial import patch
   > from mercurial import util as hgutil
   > 
   > def expandnarrowspec(ui, repo, newincludes=None):
   >   if not newincludes:
   > return
   >   import sys
   >   newincludes = set([newincludes])
-  >   narrowhg = extensions.find('narrow')
   >   includes, excludes = repo.narrowpats
-  >   currentmatcher = narrowhg.narrowspec.match(repo.root, includes, excludes)
+  >   currentmatcher = narrowspec.match(repo.root, includes, excludes)
   >   includes = includes | newincludes
   >   if not repo.currenttransaction():
   > ui.develwarn('expandnarrowspec called outside of transaction!')
   >   repo.setnarrowpats(includes, excludes)
-  >   newmatcher = narrowhg.narrowspec.match(repo.root, includes, excludes)
+  >   newmatcher = narrowspec.match(repo.root, includes, excludes)
   >   added = matchmod.differencematcher(newmatcher, currentmatcher)
   >   for f in repo['.'].manifest().walk(added):
   > repo.dirstate.normallookup(f)
diff --git a/hgext/narrow/narrowspec.py b/mercurial/narrowspec.py
rename from hgext/narrow/narrowspec.py
rename to mercurial/narrowspec.py
--- a/hgext/narrow/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -9,8 +9,8 @@
 
 import errno
 
-from mercurial.i18n import _
-from mercurial import (
+from .i18n import _
+from . import (
 error,
 hg,
 match as matchmod,
@@ -89,7 +89,7 @@
 # We use newlines as separators in the narrowspec file, so don't allow them
 # in patterns.
 if _numlines(pat) > 1:
-raise error.Abort('newlines are not allowed in narrowspec paths')
+raise error.Abort(_('newlines are not allowed in narrowspec paths'))
 
 components = pat.split('/')
 if '.' in components or '..' in components:
diff --git a/hgext/narrow/narrowwirepeer.py b/hgext/narrow/narrowwirepeer.py
--- a/hgext/narrow/narrowwirepeer.py
+++ b/hgext/narrow/narrowwirepeer.py
@@ -12,11 +12,10 @@
 error,
 extensions,
 hg,
+narrowspec,
 node,
 )
 
-from . import narrowspec
-
 def uisetup():
 def peersetup(ui, peer):
 # We must set up the expansion before reposetup below, since it's used
diff --git a/hgext/narrow/narrowrepo.py b/hgext/narrow/narrowrepo.py
--- a/hgext/narrow/narrowrepo.py
+++ b/hgext/narrow/narrowrepo.py
@@ -12,12 +12,12 @@
 hg,
 localrepo,
 match as matchmod,
+narrowspec,
 scmutil,
 )
 
 from . import (
 narrowrevlog,
-narrowspec,
 )
 
 # When narrowing is finalized and no longer subject to format changes,
diff --git a/hgext/narrow/narrowdirstate.py b/hgext/narrow/narrowdirstate.py
--- a/hgext/narrow/narrowdirstate.py
+++ b/hgext/narrow/narrowdirstate.py
@@ -13,11 +13,10 @@
 error,
 extensions,
 match as matchmod,
+narrowspec,
 util as hgutil,
 )
 
-from . import narrowspec
-
 def setup(repo):
 """Add narrow spec dirstate ignore, block changes outside narrow spec."""
 
diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -18,6 +18,7 @@
 extensions,
 hg,
 merge,
+narrowspec,
 node,
 pycompat,
 registrar,
@@ -29,7 +30,6 @@
 from . import (
 narrowbundle2,
 narrowrepo,
-narrowspec,
 )
 
 table = {}
diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py
--- a/hgext/narrow/narrowbundle2.py
+++ b/hgext/narrow/narrowbundle2.py
@@ -24,14 +24,14 @@
 error,
 exchange,
 extensions,
+narrowspec,
 repair,
 util,
 wireproto,
 )
 
 from . import (
 narrowrepo,
-narrowspec,
 )
 
 NARROWCAP = 'narrow'



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


D2202: tests: remove code to support Mercurial 4.3

2018-02-13 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG48797b21882e: tests: remove code to support Mercurial 4.3 
(authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2202?vs=5571=5648

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

AFFECTED FILES
  tests/test-narrow-expanddirstate.t

CHANGE DETAILS

diff --git a/tests/test-narrow-expanddirstate.t 
b/tests/test-narrow-expanddirstate.t
--- a/tests/test-narrow-expanddirstate.t
+++ b/tests/test-narrow-expanddirstate.t
@@ -75,23 +75,13 @@
   >   def wrapds(orig, self):
   > ds = orig(self)
   > class expandingdirstate(ds.__class__):
-  >   # Mercurial 4.4 uses this version.
   >   @hgutil.propertycache
   >   def _map(self):
   > ret = super(expandingdirstate, self)._map
   > with repo.wlock(), repo.lock(), repo.transaction(
   > 'expandnarrowspec'):
   >   expandnarrowspec(ui, repo, os.environ.get('DIRSTATEINCLUDES'))
   > return ret
-  >   # Mercurial 4.3.3 and earlier uses this version. It seems that
-  >   # narrowhg does not currently support this version, but we include
-  >   # it just in case backwards compatibility is restored.
-  >   def _read(self):
-  > ret = super(expandingdirstate, self)._read()
-  > with repo.wlock(), repo.lock(), repo.transaction(
-  > 'expandnarrowspec'):
-  >   expandnarrowspec(ui, repo, os.environ.get('DIRSTATEINCLUDES'))
-  > return ret
   > ds.__class__ = expandingdirstate
   > return ds
   >   return wrapds



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


D2198: tests: remove references to bundle2-exp config option

2018-02-13 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2405ca783672: tests: remove references to bundle2-exp 
config option (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2198?vs=5567=5644

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

AFFECTED FILES
  tests/narrow-library.sh
  tests/test-pushvars.t

CHANGE DETAILS

diff --git a/tests/test-pushvars.t b/tests/test-pushvars.t
--- a/tests/test-pushvars.t
+++ b/tests/test-pushvars.t
@@ -11,8 +11,6 @@
   $ cat >> $HGRCPATH << EOF
   > [hooks]
   > pretxnchangegroup = sh $TESTTMP/pretxnchangegroup.sh
-  > [experimental]
-  > bundle2-exp = true
   > EOF
 
   $ hg init repo
diff --git a/tests/narrow-library.sh b/tests/narrow-library.sh
--- a/tests/narrow-library.sh
+++ b/tests/narrow-library.sh
@@ -4,6 +4,5 @@
 [ui]
 ssh=python "$TESTDIR/dummyssh"
 [experimental]
-bundle2-exp = True
 changegroup3 = True
 EOF



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


D2226: progress: use %d to format ints instead of %s

2018-02-13 Thread durin42 (Augie Fackler)
durin42 added a comment.


  In https://phab.mercurial-scm.org/D2226#36921, @indygreg wrote:
  
  > Ugh. Maybe `.format()` would be better here. We can use that in 3.5 for 
bytes, right?
  
  
  Python 3.6.2 (default, Jul 17 2017, 17:35:42)
  [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  
  >>> b''.format
  
  Traceback (most recent call last):
  
File "", line 1, in 
  
  AttributeError: 'bytes' object has no attribute 'format'
  
  Sigh.

REPOSITORY
  rHG Mercurial

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

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


D2228: narrowcommands: use pycompat.{bytes,str}kwargs

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4a7ba3ac9163: narrowcommands: use 
pycompat.{bytes,str}kwargs (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2228?vs=5634=5641

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

AFFECTED FILES
  hgext/narrow/narrowcommands.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -19,6 +19,7 @@
 hg,
 merge,
 node,
+pycompat,
 registrar,
 repair,
 repoview,
@@ -69,6 +70,7 @@
 
 def clonenarrowcmd(orig, ui, repo, *args, **opts):
 """Wraps clone command, so 'hg clone' first wraps localrepo.clone()."""
+opts = pycompat.byteskwargs(opts)
 wrappedextraprepare = util.nullcontextmanager()
 opts_narrow = opts['narrow']
 if opts_narrow:
@@ -111,7 +113,7 @@
 wrappedpull = extensions.wrappedfunction(exchange, 'pull', pullnarrow)
 
 with wrappedextraprepare, wrappedpull:
-return orig(ui, repo, *args, **opts)
+return orig(ui, repo, *args, **pycompat.strkwargs(opts))
 
 def pullnarrowcmd(orig, ui, repo, *args, **opts):
 """Wraps pull command to allow modifying narrow spec."""



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


D2227: debugcommands: mergestate version is an int, use %d on it

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG72d155a792b1: debugcommands: mergestate version is an int, 
use %d on it (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2227?vs=5633=5640

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

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -1406,7 +1406,7 @@
 return h
 
 def printrecords(version):
-ui.write(('* version %s records\n') % version)
+ui.write(('* version %d records\n') % version)
 if version == 1:
 records = v1records
 else:



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


D2230: py3: whitelist another six passing tests

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGcf2b9475fbe6: py3: whitelist another six passing tests 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2230?vs=5636=5643

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

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -10,6 +10,7 @@
 test-bisect2.t
 test-bookmarks-current.t
 test-bookmarks-merge.t
+test-bookmarks-rebase.t
 test-bookmarks-strip.t
 test-branch-option.t
 test-branch-tag-confict.t
@@ -34,6 +35,7 @@
 test-contrib-check-commit.t
 test-convert-clonebranches.t
 test-copy-move-merge.t
+test-copytrace-heuristics.t
 test-debugindexdot.t
 test-debugrename.t
 test-diff-binary-file.t
@@ -172,10 +174,14 @@
 test-push-checkheads-unpushed-D6.t
 test-push-checkheads-unpushed-D7.t
 test-push-warn.t
+test-rebase-bookmarks.t
+test-rebase-check-restore.t
 test-rebase-inmemory.t
 test-rebase-issue-noparam-single-rev.t
+test-rebase-legacy.t
 test-rebase-transaction.t
 test-record.t
+test-remove.t
 test-rename-after-merge.t
 test-rename-dir-merge.t
 test-rename-merge1.t



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


D2229: narrowrepo: filter() is a generator on py3, wrap in list()

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0c104ee51918: narrowrepo: filter() is a generator on py3, 
wrap in list() (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2229?vs=5635=5642

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

AFFECTED FILES
  hgext/narrow/narrowrepo.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowrepo.py b/hgext/narrow/narrowrepo.py
--- a/hgext/narrow/narrowrepo.py
+++ b/hgext/narrow/narrowrepo.py
@@ -103,13 +103,13 @@
 def status(self, *args, **kwargs):
 s = super(narrowrepository, self).status(*args, **kwargs)
 narrowmatch = self.narrowmatch()
-modified = filter(narrowmatch, s.modified)
-added = filter(narrowmatch, s.added)
-removed = filter(narrowmatch, s.removed)
-deleted = filter(narrowmatch, s.deleted)
-unknown = filter(narrowmatch, s.unknown)
-ignored = filter(narrowmatch, s.ignored)
-clean = filter(narrowmatch, s.clean)
+modified = list(filter(narrowmatch, s.modified))
+added = list(filter(narrowmatch, s.added))
+removed = list(filter(narrowmatch, s.removed))
+deleted = list(filter(narrowmatch, s.deleted))
+unknown = list(filter(narrowmatch, s.unknown))
+ignored = list(filter(narrowmatch, s.ignored))
+clean = list(filter(narrowmatch, s.clean))
 return scmutil.status(modified, added, removed, deleted, unknown,
   ignored, clean)
 



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


D2224: branchmap: wrap builtin exception in bytes for logging

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfa4d333cac58: branchmap: wrap builtin exception in bytes 
for logging (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2224?vs=5630=5637

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

AFFECTED FILES
  mercurial/branchmap.py

CHANGE DETAILS

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -377,7 +377,7 @@
 self._rbcrevs[:] = data
 except (IOError, OSError) as inst:
 repo.ui.debug("couldn't read revision branch cache: %s\n" %
-  inst)
+  pycompat.bytestr(inst))
 # remember number of good records on disk
 self._rbcrevslen = min(len(self._rbcrevs) // _rbcrecsize,
len(repo.changelog))



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


D2225: progress: determine padding width portably

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd541042f32f6: progress: determine padding width portably 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2225?vs=5631=5638

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

AFFECTED FILES
  mercurial/progress.py

CHANGE DETAILS

diff --git a/mercurial/progress.py b/mercurial/progress.py
--- a/mercurial/progress.py
+++ b/mercurial/progress.py
@@ -119,8 +119,8 @@
 add = topic
 elif indicator == 'number':
 if total:
-add = ('% ' + str(len(str(total))) +
-   's/%s') % (pos, total)
+padamount = '%d' % len(str(total))
+add = ('% '+ padamount + 's/%s') % (pos, total)
 else:
 add = str(pos)
 elif indicator.startswith('item') and item:



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


D2226: progress: use %d to format ints instead of %s

2018-02-13 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7f5108e58083: progress: use %d to format ints instead of %s 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2226?vs=5632=5639

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

AFFECTED FILES
  mercurial/progress.py

CHANGE DETAILS

diff --git a/mercurial/progress.py b/mercurial/progress.py
--- a/mercurial/progress.py
+++ b/mercurial/progress.py
@@ -120,7 +120,11 @@
 elif indicator == 'number':
 if total:
 padamount = '%d' % len(str(total))
-add = ('% '+ padamount + 's/%s') % (pos, total)
+# '% 1d' % 1 adds an extra space compared to '% 1s' % 1.
+# To avoid this change in output, we convert to a string
+# first, then do the padding.
+spos = '%d' % pos
+add = ('% '+ padamount + 's/%d') % (spos, total)
 else:
 add = str(pos)
 elif indicator.startswith('item') and item:



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


D2229: narrowrepo: filter() is a generator on py3, wrap in list()

2018-02-13 Thread indygreg (Gregory Szorc)
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  I'm not sure if there are performance implications to this. But if there are, 
this will get addressed when this code moves to core.

REPOSITORY
  rHG Mercurial

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

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


D2226: progress: use %d to format ints instead of %s

2018-02-13 Thread indygreg (Gregory Szorc)
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  Ugh. Maybe `.format()` would be better here. We can use that in 3.5 for 
bytes, right?

REPOSITORY
  rHG Mercurial

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

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


D2216: httppeer: remove httpspeer

2018-02-13 Thread indygreg (Gregory Szorc)
indygreg added a comment.


  In https://phab.mercurial-scm.org/D2216#36814, @lothiraldan wrote:
  
  > Could an extension import the `httpspeer` class or is it too low-level?
  
  
  In theory, sure. But these classes are instantiated via 
`httppeer.instance()`. If anything, this change makes things friendlier for 
extensions because there is one less class to wrap and the remaining class 
doesn't inherit from a class that may be wrapped.

REPOSITORY
  rHG Mercurial

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

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


mercurial@36001: new changeset (1 on stable)

2018-02-13 Thread Mercurial Commits
New changeset (1 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/9f454a717c43
changeset:   36001:9f454a717c43
branch:  stable
tag: tip
parent:  35950:7b2b82f891bf
user:Anton Shestakov 
date:Tue Feb 13 18:12:26 2018 +0800
summary: tests: allow age to go up to triple digits in test-shelve.t

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


D2230: py3: whitelist another six passing tests

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: pulkit.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -10,6 +10,7 @@
 test-bisect2.t
 test-bookmarks-current.t
 test-bookmarks-merge.t
+test-bookmarks-rebase.t
 test-bookmarks-strip.t
 test-branch-option.t
 test-branch-tag-confict.t
@@ -34,6 +35,7 @@
 test-contrib-check-commit.t
 test-convert-clonebranches.t
 test-copy-move-merge.t
+test-copytrace-heuristics.t
 test-debugindexdot.t
 test-debugrename.t
 test-diff-binary-file.t
@@ -172,10 +174,14 @@
 test-push-checkheads-unpushed-D6.t
 test-push-checkheads-unpushed-D7.t
 test-push-warn.t
+test-rebase-bookmarks.t
+test-rebase-check-restore.t
 test-rebase-inmemory.t
 test-rebase-issue-noparam-single-rev.t
+test-rebase-legacy.t
 test-rebase-transaction.t
 test-record.t
+test-remove.t
 test-rename-after-merge.t
 test-rename-dir-merge.t
 test-rename-merge1.t



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


D2225: progress: determine padding width portably

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/progress.py

CHANGE DETAILS

diff --git a/mercurial/progress.py b/mercurial/progress.py
--- a/mercurial/progress.py
+++ b/mercurial/progress.py
@@ -119,8 +119,8 @@
 add = topic
 elif indicator == 'number':
 if total:
-add = ('% ' + str(len(str(total))) +
-   's/%s') % (pos, total)
+padamount = '%d' % len(str(total))
+add = ('% '+ padamount + 's/%s') % (pos, total)
 else:
 add = str(pos)
 elif indicator.startswith('item') and item:



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


D2229: narrowrepo: filter() is a generator on py3, wrap in list()

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Was at the top of Python 3 exceptions.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowrepo.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowrepo.py b/hgext/narrow/narrowrepo.py
--- a/hgext/narrow/narrowrepo.py
+++ b/hgext/narrow/narrowrepo.py
@@ -103,13 +103,13 @@
 def status(self, *args, **kwargs):
 s = super(narrowrepository, self).status(*args, **kwargs)
 narrowmatch = self.narrowmatch()
-modified = filter(narrowmatch, s.modified)
-added = filter(narrowmatch, s.added)
-removed = filter(narrowmatch, s.removed)
-deleted = filter(narrowmatch, s.deleted)
-unknown = filter(narrowmatch, s.unknown)
-ignored = filter(narrowmatch, s.ignored)
-clean = filter(narrowmatch, s.clean)
+modified = list(filter(narrowmatch, s.modified))
+added = list(filter(narrowmatch, s.added))
+removed = list(filter(narrowmatch, s.removed))
+deleted = list(filter(narrowmatch, s.deleted))
+unknown = list(filter(narrowmatch, s.unknown))
+ignored = list(filter(narrowmatch, s.ignored))
+clean = list(filter(narrowmatch, s.clean))
 return scmutil.status(modified, added, removed, deleted, unknown,
   ignored, clean)
 



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


D2228: narrowcommands: use pycompat.{bytes,str}kwargs

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/narrow/narrowcommands.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -19,6 +19,7 @@
 hg,
 merge,
 node,
+pycompat,
 registrar,
 repair,
 repoview,
@@ -69,6 +70,7 @@
 
 def clonenarrowcmd(orig, ui, repo, *args, **opts):
 """Wraps clone command, so 'hg clone' first wraps localrepo.clone()."""
+opts = pycompat.byteskwargs(opts)
 wrappedextraprepare = util.nullcontextmanager()
 opts_narrow = opts['narrow']
 if opts_narrow:
@@ -111,7 +113,7 @@
 wrappedpull = extensions.wrappedfunction(exchange, 'pull', pullnarrow)
 
 with wrappedextraprepare, wrappedpull:
-return orig(ui, repo, *args, **opts)
+return orig(ui, repo, *args, **pycompat.strkwargs(opts))
 
 def pullnarrowcmd(orig, ui, repo, *args, **opts):
 """Wraps pull command to allow modifying narrow spec."""



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


D2226: progress: use %d to format ints instead of %s

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Due to behavioral changes between '% Ns' and '% Nd' this has some
  unfortunate extra dancing. I'm not sure of a better way to solve this
  problem.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/progress.py

CHANGE DETAILS

diff --git a/mercurial/progress.py b/mercurial/progress.py
--- a/mercurial/progress.py
+++ b/mercurial/progress.py
@@ -120,7 +120,11 @@
 elif indicator == 'number':
 if total:
 padamount = '%d' % len(str(total))
-add = ('% '+ padamount + 's/%s') % (pos, total)
+# '% 1d' % 1 adds an extra space compared to '% 1s' % 1.
+# To avoid this change in output, we convert to a string
+# first, then do the padding.
+spos = '%d' % pos
+add = ('% '+ padamount + 's/%d') % (spos, total)
 else:
 add = str(pos)
 elif indicator.startswith('item') and item:



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


D2227: debugcommands: mergestate version is an int, use %d on it

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -1406,7 +1406,7 @@
 return h
 
 def printrecords(version):
-ui.write(('* version %s records\n') % version)
+ui.write(('* version %d records\n') % version)
 if version == 1:
 records = v1records
 else:



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


D2224: branchmap: wrap builtin exception in bytes for logging

2018-02-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/branchmap.py

CHANGE DETAILS

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -377,7 +377,7 @@
 self._rbcrevs[:] = data
 except (IOError, OSError) as inst:
 repo.ui.debug("couldn't read revision branch cache: %s\n" %
-  inst)
+  pycompat.bytestr(inst))
 # remember number of good records on disk
 self._rbcrevslen = min(len(self._rbcrevs) // _rbcrecsize,
len(repo.changelog))



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


D2095: clone: updates the help text for hg clone -r (issue5654) [bugzilla] and hg clone -b

2018-02-13 Thread sangeet259 (Sangeet Kumar Mishra)
sangeet259 added a comment.


  In https://phab.mercurial-scm.org/D2095#35494, @joerg.sonnenberger wrote:
  
  > There was a longish discussion on IRC about this. The problem is that the 
flags by themselves do not document the interaction of -r and -b or multiple 
instances of either at all. The change was a compromise trying to address that.
  
  
  Yeah, I had a long discussion regarding this on IRC, this is finally what all 
agreed upon.

REPOSITORY
  rHG Mercurial

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

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


D2002: remotenames: add three new revsets related to remotenames

2018-02-13 Thread yuja (Yuya Nishihara)
yuja accepted this revision.
yuja added a comment.
This revision is now accepted and ready to land.


  Fixed help text and queued, thanks.

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH] convert: fix line ending of mapfile and commit.desc file

2018-02-13 Thread Augie Fackler


> On Feb 13, 2018, at 08:16, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1518526371 -32400
> #  Tue Feb 13 21:52:51 2018 +0900
> # Node ID b5d1c234b618e7dcc7e0bed9c10b60751ab0496c
> # Parent  6eb7d95f89730b30c6e12b8df3dfeb59a52a
> convert: fix line ending of mapfile and commit.desc file

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


[PATCH] convert: fix line ending of mapfile and commit.desc file

2018-02-13 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1518526371 -32400
#  Tue Feb 13 21:52:51 2018 +0900
# Node ID b5d1c234b618e7dcc7e0bed9c10b60751ab0496c
# Parent  6eb7d95f89730b30c6e12b8df3dfeb59a52a
convert: fix line ending of mapfile and commit.desc file

Follows up 42a393ea56d2. CRLF vs LF doesn't really matter as we do strip()
or rstrip() on read, but mixing them isn't nice. So let's restore the old
behavior.

I don't know whether CVS/Root, CVS/Repository, and ~/.cvspass are written
in native line ending, so I leave them read as binary files.

diff --git a/hgext/convert/common.py b/hgext/convert/common.py
--- a/hgext/convert/common.py
+++ b/hgext/convert/common.py
@@ -476,7 +476,7 @@ class mapfile(dict):
 raise error.Abort(
 _('could not open map file %r: %s') %
 (self.path, encoding.strtolocal(err.strerror)))
-self.fp.write('%s %s\n' % (key, value))
+self.fp.write(util.tonativeeol('%s %s\n' % (key, value)))
 self.fp.flush()
 super(mapfile, self).__setitem__(key, value)
 
diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py
+++ b/hgext/convert/convcmd.py
@@ -411,7 +411,8 @@ class converter(object):
 self.ui.status(_('writing author map file %s\n') % authorfile)
 ofile = open(authorfile, 'wb+')
 for author in self.authors:
-ofile.write("%s=%s\n" % (author, self.authors[author]))
+ofile.write(util.tonativeeol("%s=%s\n"
+ % (author, self.authors[author])))
 ofile.close()
 
 def readauthormap(self, authorfile):
diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py
--- a/hgext/convert/hg.py
+++ b/hgext/convert/hg.py
@@ -626,7 +626,7 @@ class mercurial_source(common.converter_
 def converted(self, rev, destrev):
 if self.convertfp is None:
 self.convertfp = open(self.repo.vfs.join('shamap'), 'ab')
-self.convertfp.write('%s %s\n' % (destrev, rev))
+self.convertfp.write(util.tonativeeol('%s %s\n' % (destrev, rev)))
 self.convertfp.flush()
 
 def before(self):
diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -640,7 +640,8 @@ class svn_source(converter_source):
 if self.convertfp is None:
 self.convertfp = open(os.path.join(self.wc, '.svn', 'hg-shamap'),
   'ab')
-self.convertfp.write('%s %d\n' % (destrev, self.revnum(rev)))
+self.convertfp.write(util.tonativeeol('%s %d\n'
+  % (destrev, self.revnum(rev
 self.convertfp.flush()
 
 def revid(self, revnum, module=None):
@@ -1309,7 +1310,7 @@ class svn_sink(converter_sink, commandli
 
 fd, messagefile = tempfile.mkstemp(prefix='hg-convert-')
 fp = os.fdopen(fd, pycompat.sysstr('wb'))
-fp.write(commit.desc)
+fp.write(util.tonativeeol(commit.desc))
 fp.close()
 try:
 output = self.run0('commit',
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] minifileset: allow 'path:' patterns to have an explicit trailing slash

2018-02-13 Thread Matt Harbison

> On Feb 13, 2018, at 6:27 AM, Yuya Nishihara  wrote:
> 
>> On Mon, 12 Feb 2018 22:17:35 -0500, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison 
>> # Date 1518488713 18000
>> #  Mon Feb 12 21:25:13 2018 -0500
>> # Node ID e99e6917138593d2dddf7e0f5506dbd3f6c87743
>> # Parent  9b5df6e19a4f308e14703a8136cd0530c1e1d1a9
>> minifileset: allow 'path:' patterns to have an explicit trailing slash
>> 
>> We allow for it on the command line, with `hg status`, for example.  I 
>> thought
>> that I copied this "n.startswith(p) and (len(n) == pl or n[pl] == '/')" 
>> pattern
>> from somewhere, but I don't see it now.
>> 
>> diff --git a/mercurial/minifileset.py b/mercurial/minifileset.py
>> --- a/mercurial/minifileset.py
>> +++ b/mercurial/minifileset.py
>> @@ -26,7 +26,7 @@
>> raise error.ParseError(_('reserved character: %s') % c)
>> return lambda n, s: n.endswith(ext)
>> elif name.startswith('path:'): # directory or full path test
>> -p = name[5:] # prefix
>> +p = name[5:] if name[-1] != '/' else name[5:-1] # prefix
> 
> Doesn't it mean 'a/' matches 'a'?

Yes. (But 'a' won’t match 'ab'.)  Basically, I spent some time last week 
writing ignore rules for some converted repos, and got into the habit of 
appending a trailing '/' to ensure the match is a directory, and not just a 
substring.  When I did that here, it took awhile to figure out why the path was 
being ignored.  ('path:' only matches directories)

> Can't we reuse some parts of the match module to build a function or regexp
> from a pattern string?

Probably.  I’ve seen a couple cases where a regex pattern would be useful.  I 
just assumed those other match types were part of the performance concern that 
was the reason for splitting out the mini language in the first place.

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


  1   2   >