mercurial@37756: 26 new changesets

2018-04-17 Thread Mercurial Commits
26 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/5471348921c1
changeset:   37731:5471348921c1
user:Jun Wu 
date:Mon Mar 19 04:28:30 2018 -0700
summary: patch: buffer lines for a same hunk

https://www.mercurial-scm.org/repo/hg/rev/35632d392279
changeset:   37732:35632d392279
user:Jun Wu 
date:Mon Apr 09 15:58:30 2018 -0700
summary: patch: implement a new worddiff algorithm

https://www.mercurial-scm.org/repo/hg/rev/d43810fe52b0
changeset:   37733:d43810fe52b0
user:Augie Fackler 
date:Fri Apr 13 21:22:05 2018 -0400
summary: tests: port inline extensions in test-http.t to Python 3

https://www.mercurial-scm.org/repo/hg/rev/a1110db1e455
changeset:   37734:a1110db1e455
user:Augie Fackler 
date:Fri Apr 13 21:01:17 2018 -0400
summary: hgweb: these strings should be sysstrs, not bytes

https://www.mercurial-scm.org/repo/hg/rev/126998dcfb08
changeset:   37735:126998dcfb08
user:Augie Fackler 
date:Fri Apr 13 21:04:25 2018 -0400
summary: url: some bytes/str cleanup where we interface with stdlib funcs

https://www.mercurial-scm.org/repo/hg/rev/e10b695b9c41
changeset:   37736:e10b695b9c41
user:Augie Fackler 
date:Fri Apr 13 21:06:50 2018 -0400
summary: httppeer: fix debug prints to work on Python 3

https://www.mercurial-scm.org/repo/hg/rev/6cb7e3b91883
changeset:   37737:6cb7e3b91883
user:Augie Fackler 
date:Fri Apr 13 21:07:18 2018 -0400
summary: httppeer: no matter what Python 3 might think, http headers are 
bytes

https://www.mercurial-scm.org/repo/hg/rev/a1f785148097
changeset:   37738:a1f785148097
user:Augie Fackler 
date:Fri Apr 13 21:11:28 2018 -0400
summary: httppeer: work around API differences on urllib Request objects

https://www.mercurial-scm.org/repo/hg/rev/ce4ae9ead9e7
changeset:   37739:ce4ae9ead9e7
user:Augie Fackler 
date:Fri Apr 13 21:30:55 2018 -0400
summary: py3: another three passing

https://www.mercurial-scm.org/repo/hg/rev/1b71a397d6b2
changeset:   37740:1b71a397d6b2
user:Augie Fackler 
date:Fri Apr 13 21:51:10 2018 -0400
summary: tests: make sure test-run-tests.t actually runs run-tests.py under 
Python 3

https://www.mercurial-scm.org/repo/hg/rev/700aaa19de63
changeset:   37741:700aaa19de63
user:Augie Fackler 
date:Fri Apr 13 21:53:07 2018 -0400
summary: tests: fix up a couple of minor bytes inconsistencies in 
run-tests.py

https://www.mercurial-scm.org/repo/hg/rev/89d82d2b68e9
changeset:   37742:89d82d2b68e9
user:Augie Fackler 
date:Fri Apr 13 22:12:30 2018 -0400
summary: py3: fix test-shelve.t on Python 3

https://www.mercurial-scm.org/repo/hg/rev/25136e03012e
changeset:   37743:25136e03012e
user:Augie Fackler 
date:Fri Apr 13 22:26:57 2018 -0400
summary: lfcommands: use %d on known-int in format string

https://www.mercurial-scm.org/repo/hg/rev/1398c2d74d3a
changeset:   37744:1398c2d74d3a
user:Augie Fackler 
date:Fri Apr 13 22:27:16 2018 -0400
summary: tests: port inline cgi script in test-largefiles.t to python 3

https://www.mercurial-scm.org/repo/hg/rev/42567ffa10a2
changeset:   37745:42567ffa10a2
user:Augie Fackler 
date:Fri Apr 13 22:33:38 2018 -0400
summary: hgweb: inform hgweb.hgweb() entrypoint that paths should be bytes

https://www.mercurial-scm.org/repo/hg/rev/b29f490eb904
changeset:   37746:b29f490eb904
user:Augie Fackler 
date:Fri Apr 13 22:36:54 2018 -0400
summary: hgweb_mod: inform hgweb class about paths actually being bytes

https://www.mercurial-scm.org/repo/hg/rev/2d5b5bcc3b9f
changeset:   37747:2d5b5bcc3b9f
user:Augie Fackler 
date:Fri Apr 13 23:11:46 2018 -0400
summary: wsgicgi: un-do some prior porting work that is now wrong

https://www.mercurial-scm.org/repo/hg/rev/affcecf20c15
changeset:   37748:affcecf20c15
user:Augie Fackler 
date:Fri Apr 13 23:50:17 2018 -0400
summary: tests: update inline extensions in test-bundle2-exchange.t to py3

https://www.mercurial-scm.org/repo/hg/rev/73d0a3dd7e53
changeset:   37749:73d0a3dd7e53
user:Augie Fackler 
date:Fri Apr 13 23:55:37 2018 -0400
summary: stringutil: teach pprint how to format None

https://www.mercurial-scm.org/repo/hg/rev/f7194c925003
changeset:   37750:f7194c925003
user:Augie Fackler 
date:Fri Apr 13 23:57:57 2018 -0400
summary: stringutil: make b prefixes on string output optional

https://www.mercurial-scm.org/repo/hg/rev/483de34f23b1

mercurial@37730: 20 new changesets

2018-04-17 Thread Mercurial Commits
20 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/65a23cc8e75b
changeset:   37711:65a23cc8e75b
user:Gregory Szorc 
date:Sat Apr 14 16:36:15 2018 -0700
summary: cborutil: implement support for streaming encoding, bytestring 
decoding

https://www.mercurial-scm.org/repo/hg/rev/a728e3695325
changeset:   37712:a728e3695325
user:Augie Fackler 
date:Sat Apr 14 01:12:55 2018 -0400
summary: hgwebdir: un-bytes the env dict before re-parsing env

https://www.mercurial-scm.org/repo/hg/rev/11d128a14ec0
changeset:   37713:11d128a14ec0
user:Augie Fackler 
date:Sat Apr 14 11:04:58 2018 -0400
summary: tests: port test-hg-parseurl.py to unittest

https://www.mercurial-scm.org/repo/hg/rev/5dd71e9ae68a
changeset:   37714:5dd71e9ae68a
user:Augie Fackler 
date:Sat Apr 14 11:07:24 2018 -0400
summary: tests: add b prefixes to test-hg-parseurl.py

https://www.mercurial-scm.org/repo/hg/rev/1859b9a7ddef
changeset:   37715:1859b9a7ddef
user:Augie Fackler 
date:Sat Apr 14 11:20:38 2018 -0400
summary: cleanup: polyfill assertRaisesRegex so we can avoid 
assertRaisesRegexp

https://www.mercurial-scm.org/repo/hg/rev/dfc51a482031
changeset:   37716:dfc51a482031
user:Gregory Szorc 
date:Sat Apr 14 09:23:48 2018 -0700
summary: registrar: replace "cmdtype" with an intent-based mechanism (API)

https://www.mercurial-scm.org/repo/hg/rev/0664be4f0c1f
changeset:   37717:0664be4f0c1f
user:Gregory Szorc 
date:Sat Apr 14 09:57:44 2018 -0700
summary: hg: pass command intents to repo/peer creation (API)

https://www.mercurial-scm.org/repo/hg/rev/ad1c07008e0b
changeset:   37718:ad1c07008e0b
user:Gregory Szorc 
date:Sat Apr 14 11:49:57 2018 -0700
summary: debugcommands: ability to suppress logging of handshake

https://www.mercurial-scm.org/repo/hg/rev/a656cba08a04
changeset:   37719:a656cba08a04
user:Gregory Szorc 
date:Sat Apr 14 11:50:19 2018 -0700
summary: wireprotov2: move response handling out of httppeer

https://www.mercurial-scm.org/repo/hg/rev/d715a85003c8
changeset:   37720:d715a85003c8
user:Gregory Szorc 
date:Sat Apr 14 11:46:08 2018 -0700
summary: wireprotov2: establish a type for representing command response

https://www.mercurial-scm.org/repo/hg/rev/f7673845b167
changeset:   37721:f7673845b167
user:Gregory Szorc 
date:Sat Apr 14 11:49:06 2018 -0700
summary: wireprotov2: decode responses to their expected types

https://www.mercurial-scm.org/repo/hg/rev/89a16704114c
changeset:   37722:89a16704114c
user:Gregory Szorc 
date:Sat Apr 14 12:07:31 2018 -0700
summary: wireprotov2: define response data as CBOR

https://www.mercurial-scm.org/repo/hg/rev/e8fba6d578f0
changeset:   37723:e8fba6d578f0
user:Gregory Szorc 
date:Sat Apr 14 12:11:24 2018 -0700
summary: wireprotov2: change frame type value for command data

https://www.mercurial-scm.org/repo/hg/rev/deff7cf7eefd
changeset:   37724:deff7cf7eefd
user:Gregory Szorc 
date:Sat Apr 14 14:37:23 2018 -0700
summary: wireprotov2: change frame type and name for command response

https://www.mercurial-scm.org/repo/hg/rev/3ea8323d6f95
changeset:   37725:3ea8323d6f95
user:Gregory Szorc 
date:Sat Apr 14 15:19:36 2018 -0700
summary: wireprotov2: change command response protocol to include a leading 
map

https://www.mercurial-scm.org/repo/hg/rev/0c184ca594bb
changeset:   37726:0c184ca594bb
user:Gregory Szorc 
date:Sat Apr 14 15:36:12 2018 -0700
summary: wireprotov2: change behavior of error frame

https://www.mercurial-scm.org/repo/hg/rev/5cdde6158426
changeset:   37727:5cdde6158426
user:Gregory Szorc 
date:Sat Apr 14 15:38:11 2018 -0700
summary: wireprotov2: remove support for sending bytes response

https://www.mercurial-scm.org/repo/hg/rev/564a3eec6e63
changeset:   37728:564a3eec6e63
user:Gregory Szorc 
date:Sun Apr 15 10:37:29 2018 -0700
summary: wireprotov2: add support for more response types

https://www.mercurial-scm.org/repo/hg/rev/6e137da59ad9
changeset:   37729:6e137da59ad9
user:Martin von Zweigbergk 
date:Mon Apr 16 09:39:40 2018 -0700
summary: context: clarify deprecation warning message

https://www.mercurial-scm.org/repo/hg/rev/8d730f96e792
changeset:   37730:8d730f96e792
bookmark:@
tag: tip
user:Jun Wu 
date:Mon 

mercurial@37710: 60 new changesets

2018-04-17 Thread Mercurial Commits
60 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/950294e28136
changeset:   37651:950294e28136
user:Gregory Szorc 
date:Fri Apr 13 12:30:04 2018 -0700
summary: httppeer: implement command executor for version 2 peer

https://www.mercurial-scm.org/repo/hg/rev/fe8c6f9f2914
changeset:   37652:fe8c6f9f2914
user:Gregory Szorc 
date:Fri Apr 13 12:31:34 2018 -0700
summary: debugcommands: use command executor for invoking commands

https://www.mercurial-scm.org/repo/hg/rev/b2fa1591fb44
changeset:   37653:b2fa1591fb44
user:Gregory Szorc 
date:Fri Apr 13 12:31:56 2018 -0700
summary: wireproto: add media type to version 2 capabilities response

https://www.mercurial-scm.org/repo/hg/rev/8cea0d57bf37
changeset:   37654:8cea0d57bf37
user:Gregory Szorc 
date:Thu Apr 12 13:08:33 2018 -0700
summary: httppeer: handle error response from client reactor

https://www.mercurial-scm.org/repo/hg/rev/b9502b5f2066
changeset:   37655:b9502b5f2066
user:Gregory Szorc 
date:Thu Apr 12 13:11:29 2018 -0700
summary: wireprotoframing: use value passed into function

https://www.mercurial-scm.org/repo/hg/rev/e6870bca1f47
changeset:   37656:e6870bca1f47
user:Gregory Szorc 
date:Fri Apr 13 12:49:47 2018 -0700
summary: wireprotoframing: record when new stream is encountered

https://www.mercurial-scm.org/repo/hg/rev/23c4ddda7bbe
changeset:   37657:23c4ddda7bbe
user:Gregory Szorc 
date:Fri Apr 13 12:50:47 2018 -0700
summary: wireproto: expose repository formats via capabilities

https://www.mercurial-scm.org/repo/hg/rev/34758397ad1b
changeset:   37658:34758397ad1b
user:Pulkit Goyal <7895pul...@gmail.com>
date:Fri Apr 13 16:30:27 2018 +0530
summary: py3: use b"%d" instead of str() to convert integers to bytes

https://www.mercurial-scm.org/repo/hg/rev/575f59cdd8a1
changeset:   37659:575f59cdd8a1
user:Pulkit Goyal <7895pul...@gmail.com>
date:Fri Apr 13 16:31:02 2018 +0530
summary: lock: don't use 'file' as a variable name

https://www.mercurial-scm.org/repo/hg/rev/9dfa4e9ed45d
changeset:   37660:9dfa4e9ed45d
user:Pulkit Goyal <7895pul...@gmail.com>
date:Fri Apr 13 18:41:56 2018 +0530
summary: py3: add b'' prefixes to tests/test-status-inprocess.py

https://www.mercurial-scm.org/repo/hg/rev/afe624d78d43
changeset:   37661:afe624d78d43
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sat Apr 14 00:56:44 2018 +0530
summary: py3: use urllib.parse.unquote_plus instead of urllib.unquote_plus

https://www.mercurial-scm.org/repo/hg/rev/5340daa85c62
changeset:   37662:5340daa85c62
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sat Apr 14 01:58:44 2018 +0530
summary: py3: iterate over a copy of dict while changing it

https://www.mercurial-scm.org/repo/hg/rev/fc114a16a484
changeset:   37663:fc114a16a484
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sat Apr 14 01:59:55 2018 +0530
summary: py3: use stringutil.forcebytestr() instead of str()

https://www.mercurial-scm.org/repo/hg/rev/483cafc3762a
changeset:   37664:483cafc3762a
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sat Apr 14 02:00:43 2018 +0530
summary: py3: make sure curses.tigetstr() first argument is a str

https://www.mercurial-scm.org/repo/hg/rev/83250442dc81
changeset:   37665:83250442dc81
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sat Apr 14 02:02:11 2018 +0530
summary: py3: use str variables to check keys in request header

https://www.mercurial-scm.org/repo/hg/rev/46e705b79323
changeset:   37666:46e705b79323
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sat Apr 14 02:03:02 2018 +0530
summary: py3: add b'' prefixes to make values bytes

https://www.mercurial-scm.org/repo/hg/rev/701c261fba83
changeset:   37667:701c261fba83
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sat Apr 14 02:04:19 2018 +0530
summary: py3: use b"%d" instead of str() to convert int to bytes

https://www.mercurial-scm.org/repo/hg/rev/2a42ca2679e2
changeset:   37668:2a42ca2679e2
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sat Apr 14 02:06:03 2018 +0530
summary: py3: add b'' prefixes to make values bytes

https://www.mercurial-scm.org/repo/hg/rev/1cb54e6193a6
changeset:   37669:1cb54e6193a6
user:Augie Fackler 
date:Fri Apr 13 18:17:45 2018 -0400
summary: py3: paper over differences in future exception handling

https://www.mercurial-scm.org/repo/hg/rev/719b8cb22936
changeset:   37670:719b8cb22936
user:Augie Fackler 
date:Fri Apr 13 18:28:58 2018 -0400
summary: localrepo: add some overlooked 

D3404: scripts: remove code for special handling of generaldelta; r?sheehan

2018-04-17 Thread indygreg (Gregory Szorc)
indygreg abandoned this revision.
indygreg added a comment.


  Sent this to the wrong Phabricator instance :)

REPOSITORY
  rHG Mercurial

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

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


D3404: scripts: remove code for special handling of generaldelta; r?sheehan

2018-04-17 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  generaldelta has been the default for new Mercurial repos for
  probably 2 years now. Setting format.generaldelta=true had no effect
  because it was redundant with the default. So stop doing that.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  scripts/sync-hg-repos-from-manifest

CHANGE DETAILS

diff --git a/scripts/sync-hg-repos-from-manifest 
b/scripts/sync-hg-repos-from-manifest
--- a/scripts/sync-hg-repos-from-manifest
+++ b/scripts/sync-hg-repos-from-manifest
@@ -49,8 +49,6 @@
 if not os.path.exists(path):
 is_clone = True
 args = [HG, 'init', path]
-if 'generaldelta' in requires:
-args.extend(['--config', 'format.generaldelta=true'])
 
 print('creating empty repo: %s' % path)
 subprocess.check_output(args, cwd='/', stderr=subprocess.STDOUT)



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


D3393: bundle: introduce per-engine compression level

2018-04-17 Thread joerg.sonnenberger (Joerg Sonnenberger)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6a7ff5816c5f: bundle: introduce per-engine compression 
level (authored by joerg.sonnenberger, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3393?vs=8360=8377

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/configitems.py
  tests/test-bundle-type.t

CHANGE DETAILS

diff --git a/tests/test-bundle-type.t b/tests/test-bundle-type.t
--- a/tests/test-bundle-type.t
+++ b/tests/test-bundle-type.t
@@ -154,6 +154,11 @@
   $ f --size gzip-v2-level1.hg
   gzip-v2-level1.hg: size=475
 
+  $ hg --config experimental.bundlecomplevel.gzip=1 --config 
experimental.bundlelevel=9 bundle -a -t gzip-v2 gzip-v2-level1.hg
+  1 changesets found
+  $ f --size gzip-v2-level1.hg
+  gzip-v2-level1.hg: size=475
+
   $ cd ..
 
 #if zstd
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -440,6 +440,18 @@
 coreconfigitem('experimental', 'bundlecomplevel',
 default=None,
 )
+coreconfigitem('experimental', 'bundlecomplevel.bzip2',
+default=None,
+)
+coreconfigitem('experimental', 'bundlecomplevel.gzip',
+default=None,
+)
+coreconfigitem('experimental', 'bundlecomplevel.none',
+default=None,
+)
+coreconfigitem('experimental', 'bundlecomplevel.zstd',
+default=None,
+)
 coreconfigitem('experimental', 'changegroup3',
 default=False,
 )
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1260,7 +1260,10 @@
 # level without a) formalizing the bundlespec changes to declare it
 # b) introducing a command flag.
 compopts = {}
-complevel = ui.configint('experimental', 'bundlecomplevel')
+complevel = ui.configint('experimental',
+ 'bundlecomplevel.' + bundlespec.compression)
+if complevel is None:
+complevel = ui.configint('experimental', 'bundlecomplevel')
 if complevel is not None:
 compopts['level'] = complevel
 



To: joerg.sonnenberger, #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


D3392: bundlespec: drop externalnames flag

2018-04-17 Thread joerg.sonnenberger (Joerg Sonnenberger)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5527aa808dea: bundlespec: drop externalnames flag (authored 
by joerg.sonnenberger, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3392?vs=8359=8376

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/exchange.py

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -86,11 +86,13 @@
 @attr.s
 class bundlespec(object):
 compression = attr.ib()
+wirecompression = attr.ib()
 version = attr.ib()
+wireversion = attr.ib()
 params = attr.ib()
 contentopts = attr.ib()
 
-def parsebundlespec(repo, spec, strict=True, externalnames=False):
+def parsebundlespec(repo, spec, strict=True):
 """Parse a bundle string specification into parts.
 
 Bundle specifications denote a well-defined bundle/exchange format.
@@ -110,9 +112,6 @@
 If ``strict`` is True (the default)  is required. Otherwise,
 it is optional.
 
-If ``externalnames`` is False (the default), the human-centric names will
-be converted to their internal representation.
-
 Returns a bundlespec object of (compression, version, parameters).
 Compression will be ``None`` if not in strict mode and a compression isn't
 defined.
@@ -215,12 +214,12 @@
 variant = _bundlespecvariants["streamv2"]
 contentopts.update(variant)
 
-if not externalnames:
-engine = util.compengines.forbundlename(compression)
-compression = engine.bundletype()[1]
-version = _bundlespeccgversions[version]
+engine = util.compengines.forbundlename(compression)
+compression, wirecompression = engine.bundletype()
+wireversion = _bundlespeccgversions[version]
 
-return bundlespec(compression, version, params, contentopts)
+return bundlespec(compression, wirecompression, version, wireversion,
+  params, contentopts)
 
 def readbundle(ui, fh, fname, vfs=None):
 header = changegroup.readexactly(fh, 4)
@@ -2253,8 +2252,7 @@
 # component of the BUNDLESPEC.
 if key == 'BUNDLESPEC':
 try:
-bundlespec = parsebundlespec(repo, value,
- externalnames=True)
+bundlespec = parsebundlespec(repo, value)
 attrs['COMPRESSION'] = bundlespec.compression
 attrs['VERSION'] = bundlespec.version
 except error.InvalidBundleSpecification:
@@ -2268,11 +2266,12 @@
 
 def isstreamclonespec(bundlespec):
 # Stream clone v1
-if (bundlespec.compression == 'UN' and bundlespec.version == 's1'):
+if (bundlespec.wirecompression == 'UN' and bundlespec.wireversion == 's1'):
 return True
 
 # Stream clone v2
-if (bundlespec.compression == 'UN' and bundlespec.version == '02' and \
+if (bundlespec.wirecompression == 'UN' and \
+bundlespec.wireversion == '02' and \
 bundlespec.contentopts.get('streamv2')):
 return True
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1245,14 +1245,12 @@
 scmutil.nochangesfound(ui, repo, not base and outgoing.excluded)
 return 1
 
-bcompression = bundlespec.compression
 if cgversion == '01': #bundle1
-if bcompression is None:
-bcompression = 'UN'
-bversion = 'HG10' + bcompression
+bversion = 'HG10' + bundlespec.wirecompression
 bcompression = None
 elif cgversion in ('02', '03'):
 bversion = 'HG20'
+bcompression = bundlespec.wirecompression
 else:
 raise error.ProgrammingError(
 'bundle: unexpected changegroup version %s' % cgversion)



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


D3393: bundle: introduce per-engine compression level

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


  I'm going to queue this because it is a useful feature. But I would strongly 
prefer we formalize things early in the 3.7 cycle. This functionality is too 
important to only live behind experimental flags.

REPOSITORY
  rHG Mercurial

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

To: joerg.sonnenberger, #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


D3403: revlog: make shortest() take a full binary nodeid (API)

2018-04-17 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG44d1959acb3b: revlog: make shortest() take a full binary 
nodeid (API) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3403?vs=8374=8375

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

AFFECTED FILES
  mercurial/revlog.py
  mercurial/scmutil.py

CHANGE DETAILS

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -448,7 +448,7 @@
 # _partialmatch() of filtered changelog could take O(len(repo)) time,
 # which would be unacceptably slow. so we look for hash collision in
 # unfiltered space, which means some hashes may be slightly longer.
-return repo.unfiltered().changelog.shortest(hex(node), minlength)
+return repo.unfiltered().changelog.shortest(node, minlength)
 
 def isrevsymbol(repo, symbol):
 """Checks if a symbol exists in the repo.
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1500,8 +1500,8 @@
 
 raise LookupError(id, self.indexfile, _('no match found'))
 
-def shortest(self, hexnode, minlength=1):
-"""Find the shortest unambiguous prefix that matches hexnode."""
+def shortest(self, node, minlength=1):
+"""Find the shortest unambiguous prefix that matches node."""
 def isvalid(test):
 try:
 if self._partialmatch(test) is None:
@@ -1523,6 +1523,7 @@
 # single 'ff...' match
 return True
 
+hexnode = hex(node)
 shortest = hexnode
 startlength = max(6, minlength)
 length = startlength



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


D2938: grep: make grep search on working directory by default

2018-04-17 Thread sangeet259 (Sangeet Kumar Mishra)
sangeet259 marked 2 inline comments as done.
sangeet259 added a comment.


  @yuja
  
  > fix grep -r 'wdir()'
  
  What exactly do you mean by fixing 'grep -r wdir()' ?

REPOSITORY
  rHG Mercurial

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

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


D3393: bundle: introduce per-engine compression level

2018-04-17 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger added a comment.


  I don't really disagree that the existing option naming is a bit stupid. 
There are useful points for including the compression level as part of the 
bundle spec, but I don't think that replaces the need for a config option for 
sane defaults.
  As I said on IRC, a consistent approach for the three places where 
compression is used would be useful:
  
  - standalone "hg bundle" operations
  - wire compression
  - reflog compression
  
  We currently don't allow tuning for the latter two, even though trade-offs 
between (write) performance and space make a lot of sense. As such, having a 
uniform mechanism for specifying the compression level sounds like a good idea.

REPOSITORY
  rHG Mercurial

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

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


D3403: revlog: make shortest() take a full binary nodeid (API)

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

REVISION SUMMARY
  Follow-up to 
https://phab.mercurial-scm.org/rHG7b29556247776a86ead7eb98fd3a20dafd0c08b4 
(scmutil: make shortesthexnodeidprefix()
  take a full binary nodeid, 2018-04-14).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/revlog.py
  mercurial/scmutil.py

CHANGE DETAILS

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -448,7 +448,7 @@
 # _partialmatch() of filtered changelog could take O(len(repo)) time,
 # which would be unacceptably slow. so we look for hash collision in
 # unfiltered space, which means some hashes may be slightly longer.
-return repo.unfiltered().changelog.shortest(hex(node), minlength)
+return repo.unfiltered().changelog.shortest(node, minlength)
 
 def isrevsymbol(repo, symbol):
 """Checks if a symbol exists in the repo.
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1500,8 +1500,8 @@
 
 raise LookupError(id, self.indexfile, _('no match found'))
 
-def shortest(self, hexnode, minlength=1):
-"""Find the shortest unambiguous prefix that matches hexnode."""
+def shortest(self, node, minlength=1):
+"""Find the shortest unambiguous prefix that matches node."""
 def isvalid(test):
 try:
 if self._partialmatch(test) is None:
@@ -1523,6 +1523,7 @@
 # single 'ff...' match
 return True
 
+hexnode = hex(node)
 shortest = hexnode
 startlength = max(6, minlength)
 length = startlength



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


D3392: bundlespec: drop externalnames flag

2018-04-17 Thread lothiraldan (Boris Feld)
lothiraldan accepted this revision.
lothiraldan added a comment.


  LGTM, thanks for the much needed cleanup

REPOSITORY
  rHG Mercurial

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

To: joerg.sonnenberger, #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


D2934: forget: add --confirm option

2018-04-17 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I'm fine to rename this to --interactive if we think that makes more sense, 
even if we do it during the freeze.

REPOSITORY
  rHG Mercurial

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

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


[PATCH] revsetlang: do not pass in non-bytes to parse()

2018-04-17 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1523969998 -32400
#  Tue Apr 17 21:59:58 2018 +0900
# Node ID 235258eb2600f6d41ce9bc5c8ab5a2601b19dce8
# Parent  925707ac2855944b0607bec68986a273fb5321ae
revsetlang: do not pass in non-bytes to parse()

Since parse() isn't a simple function, we shouldn't expect it would raise
TypeError or ValueError for invalid inputs. Before, TypeError was raised
at 'if pos != len(spec)', which was quite late to report an error.

This patch also makes tokenize() detect invalid object before converting
it to a py3-safe bytes.

Spotted while adding the 'revset(...)' hack to _parsewith().

diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py
--- a/mercurial/revsetlang.py
+++ b/mercurial/revsetlang.py
@@ -89,6 +89,9 @@ def tokenize(program, lookup=None, symin
 [('symbol', '@', 0), ('::', None, 1), ('end', None, 3)]
 
 '''
+if not isinstance(program, bytes):
+raise error.ProgrammingError('revset statement must be bytes, got %r'
+ % program)
 program = pycompat.bytestr(program)
 if syminitletters is None:
 syminitletters = _syminitletters
@@ -581,6 +584,8 @@ def _formatargtype(c, arg):
 elif c == 's':
 return _quote(arg)
 elif c == 'r':
+if not isinstance(arg, bytes):
+raise TypeError
 parse(arg) # make sure syntax errors are confined
 return '(%s)' % arg
 elif c == 'n':
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3212: patch: implement a new worddiff algorithm

2018-04-17 Thread lothiraldan (Boris Feld)
lothiraldan added a comment.


  In https://phab.mercurial-scm.org/D3212#52767, @quark wrote:
  
  > F71015: 2018-04-12-193346_956x996_scrot.png 

  
  
   for git inspired colored output. I gave a try to the dim version and it was 
less readable than the old version.

REPOSITORY
  rHG Mercurial

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

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


D2934: forget: add --confirm option

2018-04-17 Thread yuja (Yuya Nishihara)
yuja added a comment.


  The change looks good, but new behavior sounds more like `--interactive`
  than `--confirm`.

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH] lfs: add the 'Authorization' property to the Batch API response, if present

2018-04-17 Thread Matt Harbison

> On Apr 17, 2018, at 7:40 AM, Yuya Nishihara  wrote:
> 
>> On Mon, 16 Apr 2018 08:22:13 -0400, Matt Harbison wrote:
>> 
 On Apr 16, 2018, at 7:58 AM, Yuya Nishihara  wrote:
 
 On Sun, 15 Apr 2018 19:41:32 -0400, Matt Harbison wrote:
 # HG changeset patch
 # User Matt Harbison 
 # Date 1523027627 14400
 #  Fri Apr 06 11:13:47 2018 -0400
 # Node ID 6d8c47590030244033d51c2d0b390d2ee6337dea
 # Parent  acd5a25c179269df689b8799aa7cbc52d5451251
 lfs: add the 'Authorization' property to the Batch API response, if present
 
 The client copies all of these properties under 'header' to the HTTP 
 Headers of
 the subsequent GET or PUT request that it performs.  That allows the Basic 
 HTTP
 authentication used to authorize the Batch API request to also authorize 
 the
 upload/download action.
>>> 
>>> I'm not pretty sure, but I think it's up to the client to resend an
>>> Authorization header depending on the realm provided by the server. Doesn't
>>> the server request authentication for batch requests?
>> 
>> It does request authentication for batch requests, but doesn’t for the 
>> transfer, which surprised me.  Somewhere I think I read that the 
>> authentication request is also tied to the URI, which would explain why the 
>> client isn’t resending on its own.
> 
> Queued, but can you investigate further why the server doesn't send 401
> response?

Will do.  There’s more to look at in this area in general, and the lfs spec in 
this area is a bit vague, at least to me.

>> I wireshark traced git-lfs to a couple of different servers, and this seemed 
>> to be what it was doing.  That gitbucket footnote shows it rolling its own 
>> authorization token that it expects on transfer, so I thought this was by 
>> design.
> 
> Sending new token might make some sense, but echoing back the original
> Authorization header seems a bit weird.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3402: notify: add maxdiffstat option to truncate long file lists

2018-04-17 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Large scale changes like a new GCC version can easily result in 1MB+
  emails due to diffstat alone. The new maxdiffstat option truncates the
  list similar to what maxdiff already provides for the diffs.

REPOSITORY
  rHG Mercurial

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

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

CHANGE DETAILS

diff --git a/tests/test-notify.t b/tests/test-notify.t
--- a/tests/test-notify.t
+++ b/tests/test-notify.t
@@ -121,6 +121,10 @@
 Maximum number of diff lines to include in notification email. Set to 0 to
 disable the diff, or -1 to include all of it. Default: 300.
   
+  notify.maxdiffstat
+Maximum number of diffstat lines to include in notification email. Set to 
-1
+to include all of it. Default: -1.
+  
   notify.maxsubject
 Maximum number of characters in email's subject line. Default: 67.
   
@@ -152,19 +156,21 @@
   no commands defined
   $ hg init a
   $ echo a > a/a
+  $ echo b > a/b
 
 commit
 
   $ hg --cwd a commit -Ama -d '0 0'
   adding a
-
+  adding b
 
 clone
 
   $ hg --traceback clone a b
   updating to branch default
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ echo a >> a/a
+  $ echo b >> a/b
 
 commit
 
@@ -187,29 +193,34 @@
   adding changesets
   adding manifests
   adding file changes
-  added 1 changesets with 1 changes to 1 files
-  new changesets 0647d048b600
+  added 1 changesets with 2 changes to 2 files
+  new changesets 00a13f371396
   MIME-Version: 1.0
   Content-Type: text/plain; charset="us-ascii"
   Content-Transfer-Encoding: 7bit
   Date: * (glob)
   Subject: changeset in $TESTTMP/b: b
   From: test
-  X-Hg-Notification: changeset 0647d048b600
+  X-Hg-Notification: changeset 00a13f371396
   Message-Id: <*> (glob)
   To: baz, foo@bar
   
-  changeset 0647d048b600 in $TESTTMP/b
-  details: $TESTTMP/b?cmd=changeset;node=0647d048b600
+  changeset 00a13f371396 in $TESTTMP/b
+  details: $TESTTMP/b?cmd=changeset;node=00a13f371396
   description: b
   
-  diffs (6 lines):
+  diffs (12 lines):
   
-  diff -r cb9a9f314b8b -r 0647d048b600 a
+  diff -r 0cd96de13884 -r 00a13f371396 a
   --- a/a  Thu Jan 01 00:00:00 1970 +
   +++ b/a  Thu Jan 01 00:00:01 1970 +
   @@ -1,1 +1,2 @@ a
   +a
+  diff -r 0cd96de13884 -r 00a13f371396 b
+  --- a/b  Thu Jan 01 00:00:00 1970 +
+  +++ b/b  Thu Jan 01 00:00:01 1970 +
+  @@ -1,1 +1,2 @@ b
+  +b
   (run 'hg update' to get a working copy)
 
   $ cat <> $HGRCPATH
@@ -241,28 +252,33 @@
   adding changesets
   adding manifests
   adding file changes
-  added 1 changesets with 1 changes to 1 files
-  new changesets 0647d048b600
+  added 1 changesets with 2 changes to 2 files
+  new changesets 00a13f371396
   MIME-Version: 1.0
   Content-Type: text/plain; charset="us-ascii"
   Content-Transfer-Encoding: 7bit
   X-Test: foo
   Date: * (glob)
   Subject: b
   From: t...@test.com
-  X-Hg-Notification: changeset 0647d048b600
+  X-Hg-Notification: changeset 00a13f371396
   Message-Id: <*> (glob)
   To: b...@test.com, foo@bar
   
-  changeset 0647d048b600 in b
+  changeset 00a13f371396 in b
   description: b
-  diffs (6 lines):
+  diffs (12 lines):
   
-  diff -r cb9a9f314b8b -r 0647d048b600 a
+  diff -r 0cd96de13884 -r 00a13f371396 a
   --- a/a  Thu Jan 01 00:00:00 1970 +
   +++ b/a  Thu Jan 01 00:00:01 1970 +
   @@ -1,1 +1,2 @@ a
   +a
+  diff -r 0cd96de13884 -r 00a13f371396 b
+  --- a/b  Thu Jan 01 00:00:00 1970 +
+  +++ b/b  Thu Jan 01 00:00:01 1970 +
+  @@ -1,1 +1,2 @@ b
+  +b
   (run 'hg update' to get a working copy)
 
   $ cat << EOF >> $HGRCPATH
@@ -278,49 +294,54 @@
 
   $ hg --cwd b rollback
   repository tip rolled back to revision 0 (undo pull)
-  $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
+  $ hg --traceback --config notify.maxdiffstat=1 --cwd b pull ../a | $PYTHON 
$TESTTMP/filter.py
   pulling from ../a
   searching for changes
   adding changesets
   adding manifests
   adding file changes
-  added 1 changesets with 1 changes to 1 files
-  new changesets 0647d048b600
+  added 1 changesets with 2 changes to 2 files
+  new changesets 00a13f371396
   MIME-Version: 1.0
   Content-Type: text/plain; charset="us-ascii"
   Content-Transfer-Encoding: 7bit
   X-Test: foo
   Date: * (glob)
   Subject: b
   From: t...@test.com
-  X-Hg-Notification: changeset 0647d048b600
+  X-Hg-Notification: changeset 00a13f371396
   Message-Id: <*> (glob)
   To: b...@test.com, foo@bar
   
-  changeset 0647d048b600 in b
+  changeset 00a13f371396 in b
   description: b
-  diffstat:
-   a |  1 + 1 files changed, 1 insertions(+), 0 deletions(-)
+  diffstat (truncated from 2 to 1 lines):
+   a |  1 + 2 files changed, 2 insertions(+), 0 deletions(-)
   
-  diffs (6 lines):

Re: [PATCH 3 of 3 V5] revset: skip legacy lookup for revspec wrapped in 'revset(…)'

2018-04-17 Thread Yuya Nishihara
On Mon, 16 Apr 2018 19:49:43 +0200, Feld Boris wrote:
> On 16/04/2018 14:24, Yuya Nishihara wrote:
> > On Mon, 16 Apr 2018 08:58:31 +0200, Boris Feld wrote:
> >> # HG changeset patch
> >> # User Boris Feld 
> >> # Date 1523369212 -7200
> >> #  Tue Apr 10 16:06:52 2018 +0200
> >> # Node ID 109ca88347d7b531d4b48370efcbc4d6e850cf92
> >> # Parent  f363552ced37ae028bbcf2cba1f02ac623385f54
> >> # EXP-Topic noname
> >> # Available At https://bitbucket.org/octobus/mercurial-devel/
> >> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> >> 109ca88347d7
> >> revset: skip legacy lookup for revspec wrapped in 'revset(…)'
> >> @@ -2191,7 +2194,12 @@ def matchany(ui, specs, lookup=None, loc
> >>   raise error.ParseError(_("empty query"))
> >>   parsedspecs = []
> >>   for s in specs:
> >> -parsedspecs.append(revsetlang.parse(s, lookup))
> >> +lookupthis = lookup
> >> +stripped = s.strip()
> >> +if (stripped.startswith(prefixrevset)
> >> +and stripped.endswith(postfixrevset)):
> >> +lookupthis = None
> >> +parsedspecs.append(revsetlang.parse(s, lookupthis))
> > Is it okay to move this hack to revsetlang._parsewith?
> >
> > @@ -482,6 +485,8 @@ def _parsewith(spec, lookup=None, symini
> > ...
> >   ParseError: ('invalid token', 4)
> >   """
> > +if spec.startswith('revset(') and spec.endswith(')'):
> > +lookup = None
> >   p = parser.parser(elements)
> >   tree, pos = p.parse(tokenize(spec, lookup=lookup,
> >syminitletters=syminitletters))
> >
> > I don't think revset.match*() is the right place to do parsing stuff, and
> > we'll need a tokenizer to make it more correctly handle variants such as
> > ' revset ( ... )' or '... and revset(...)'.
> You're are right, moving it lower in the stack makes sense. Would it be 
> possible to implement it even lower in revsetlang.tokenize?

Maybe no. We'll need the tokenize() function to handle e.g. 'revset ( ... )'.

  if firsttwotokens(tokenize(s)) == ['revset', '(']:
  return tokenize(s)
  # otherwise, wrap lookup() to count parens and conditionally disable lookup?

> We tried preparing a V6 to move the code but we didn't find the queued 
> version of the first changeset. Were you waiting for us to move the code 
> yourself?

I've already fixed it locally, so will push soon.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 3 of 3 V5] revset: skip legacy lookup for revspec wrapped in 'revset(…)'

2018-04-17 Thread Feld Boris



On 16/04/2018 19:49, Feld Boris wrote:

On 16/04/2018 14:24, Yuya Nishihara wrote:

On Mon, 16 Apr 2018 08:58:31 +0200, Boris Feld wrote:

# HG changeset patch
# User Boris Feld 
# Date 1523369212 -7200
#  Tue Apr 10 16:06:52 2018 +0200
# Node ID 109ca88347d7b531d4b48370efcbc4d6e850cf92
# Parent  f363552ced37ae028bbcf2cba1f02ac623385f54
# EXP-Topic noname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull 
https://bitbucket.org/octobus/mercurial-devel/ -r 109ca88347d7

revset: skip legacy lookup for revspec wrapped in 'revset(…)'
@@ -2191,7 +2194,12 @@ def matchany(ui, specs, lookup=None, loc
  raise error.ParseError(_("empty query"))
  parsedspecs = []
  for s in specs:
-    parsedspecs.append(revsetlang.parse(s, lookup))
+    lookupthis = lookup
+    stripped = s.strip()
+    if (stripped.startswith(prefixrevset)
+    and stripped.endswith(postfixrevset)):
+    lookupthis = None
+    parsedspecs.append(revsetlang.parse(s, lookupthis))

Is it okay to move this hack to revsetlang._parsewith?

@@ -482,6 +485,8 @@ def _parsewith(spec, lookup=None, symini
    ...
  ParseError: ('invalid token', 4)
  """
+    if spec.startswith('revset(') and spec.endswith(')'):
+    lookup = None
  p = parser.parser(elements)
  tree, pos = p.parse(tokenize(spec, lookup=lookup,
syminitletters=syminitletters))

I don't think revset.match*() is the right place to do parsing stuff, 
and

we'll need a tokenizer to make it more correctly handle variants such as
' revset ( ... )' or '... and revset(...)'.
You're are right, moving it lower in the stack makes sense. Would it 
be possible to implement it even lower in revsetlang.tokenize?


We tried preparing a V6 to move the code but we didn't find the queued 
version of the first changeset. Were you waiting for us to move the 
code yourself?
We sent the V6 version with the renamed test file (we hope it's the 
right name) so you can take the second updated changeset.

___
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


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


[PATCH 2 of 2 V6] revset: skip legacy lookup for revspec wrapped in 'revset(…)'

2018-04-17 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1523369212 -7200
#  Tue Apr 10 16:06:52 2018 +0200
# Node ID a8bfeca77f8e59c9f9e8552f04ec2f553d59e7fa
# Parent  6501c9e162939da32371fa67da710af506f85140
# EXP-Topic noname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
a8bfeca77f8e
revset: skip legacy lookup for revspec wrapped in 'revset(…)'

Currently, multiple labels can take forms that can be confused with revset
(eg: "rev(0)" is a valid tag). Since we look up for tags before evaluating
revset, this means a tag can shadow a valid revset at any time.

We now enforce the strict revset parsing when wrapped with 'revset(…)'. For
now, This only work on a whole revspec (but can be used within the revset
without effect). This might change in the future if we improve the
implementation.

The feature is undocumented for now, keeping it in the experimental namespace.
In case a better approach to achieve the same goal is found.

The syntax looks like a revset but is not implemented as such for now. Since
the goal is to avoid some preprocessing that happens before revset parsing, we
cannot simply implement it as a revset predicate.

There were other approaches discussed over the mailing-list but they were less
convincing.

Having a configuration flag to disable legacy lookup have been considered but
discarded. There are too many common uses of ambiguous identifier (eg: '+',
'-' or '..') to have the legacy lookup mechanism turned off.

In addition, the approach can control the parsing of each revset, making it
more flexible. For example, a revset used as the value of an existing
configuration option (eg: pushrev) could enforce its resolution as a revset
(by using the prefix) while user inputs would still use the legacy lookup.

In addition to offering a way to unambiguously input a revset, this prefix
allow skipping the name lookup providing a significant speedup in some case.

diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py
--- a/mercurial/revsetlang.py
+++ b/mercurial/revsetlang.py
@@ -68,6 +68,9 @@ symbols = {}
 # default set of valid characters for non-initial letters of symbols
 _symletters = _syminitletters | set(pycompat.iterbytestr('-/'))
 
+prefixrevset = 'revset('
+postfixrevset = ')'
+
 def tokenize(program, lookup=None, syminitletters=None, symletters=None):
 '''
 Parse a revset statement into a stream of tokens
@@ -95,6 +98,11 @@ def tokenize(program, lookup=None, symin
 if symletters is None:
 symletters = _symletters
 
+stripped = program.strip()
+if (stripped.startswith(prefixrevset)
+and stripped.endswith(postfixrevset)):
+lookup = None
+
 if program and lookup:
 # attempt to parse old-style ranges first to deal with
 # things like old-tag which contain query metacharacters
@@ -352,6 +360,9 @@ def _analyze(x):
 elif op == 'keyvalue':
 return (op, x[1], _analyze(x[2]))
 elif op == 'func':
+f = getsymbol(x[1])
+if f == 'revset':
+return _analyze(x[2])
 return (op, x[1], _analyze(x[2]))
 raise ValueError('invalid operator %r' % op)
 
diff --git a/tests/test-revset-legacy-lookup.t 
b/tests/test-revset-legacy-lookup.t
--- a/tests/test-revset-legacy-lookup.t
+++ b/tests/test-revset-legacy-lookup.t
@@ -1,4 +1,3 @@
-
   $ cat >> $HGRCPATH << EOF
   > [ui]
   > logtemplate="{rev}:{node|short} {desc} [{tags}]\n"
@@ -62,6 +61,12 @@ within a more advances revset
   $ hg log -r 'rev(0) and branch(default)'
   0:a87874c6ec31 first []
 
+with explicit revset resolution
+(still resolved as the label)
+
+  $ hg log -r 'revset(rev(0))'
+  0:a87874c6ec31 first []
+
 some of the above with quote to force its resolution as a label
 
   $ hg log -r ':"rev(0)"'
@@ -91,8 +96,13 @@ Test label with quote in them.
   $ hg log -r '("foo")'
   abort: unknown revision 'foo'!
   [255]
+  $ hg log -r 'revset("foo")'
+  abort: unknown revision 'foo'!
+  [255]
   $ hg log -r '("\"foo\"")'
   2:fb616635b18f Added tag rev(0) for changeset 43114e71eddd ["foo"]
+  $ hg log -r 'revset("\"foo\"")'
+  2:fb616635b18f Added tag rev(0) for changeset 43114e71eddd ["foo"]
 
 Test label with dash in them.
 
@@ -116,6 +126,9 @@ Test label with + in them.
   $ hg log -r '(foo+bar)'
   abort: unknown revision 'foo'!
   [255]
+  $ hg log -r 'revset(foo+bar)'
+  abort: unknown revision 'foo'!
+  [255]
   $ hg log -r '"foo+bar"'
   4:bbf52b87b370 Added tag foo-bar for changeset a50aae922707 [foo+bar]
   $ hg log -r '("foo+bar")'
@@ -129,6 +142,8 @@ Test tag with numeric version number.
   5:ff42fde8edbb Added tag foo+bar for changeset bbf52b87b370 [1.2]
   $ hg log -r '(1.2)'
   5:ff42fde8edbb Added tag foo+bar for changeset bbf52b87b370 [1.2]
+  $ hg log -r 'revset(1.2)'
+  5:ff42fde8edbb Added tag foo+bar for changeset bbf52b87b370 [1.2]
   $ hg log -r '"1.2"'
   5:ff42fde8edbb Added tag foo+bar for 

[PATCH 1 of 2 V6] revset: add more test to show current behaviors with label looking like revset

2018-04-17 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1519922236 18000
#  Thu Mar 01 11:37:16 2018 -0500
# Node ID 6501c9e162939da32371fa67da710af506f85140
# Parent  9b3a348c9b2fa290fda8a8d1fe8afb987d2fc9e7
# EXP-Topic noname
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
6501c9e16293
revset: add more test to show current behaviors with label looking like revset

There are very few constraints on what character can be put into tags and
other labels. We add more tests showing some of extreme cases that user can
currently use.

diff --git a/tests/test-revset-legacy-lookup.t 
b/tests/test-revset-legacy-lookup.t
new file mode 100644
--- /dev/null
+++ b/tests/test-revset-legacy-lookup.t
@@ -0,0 +1,259 @@
+
+  $ cat >> $HGRCPATH << EOF
+  > [ui]
+  > logtemplate="{rev}:{node|short} {desc} [{tags}]\n"
+  > EOF
+
+  $ hg init legacy-lookup
+  $ cd legacy-lookup
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m 'first'
+  $ echo aa > a
+  $ hg commit -m 'second'
+  $ hg log -G
+  @  1:43114e71eddd second [tip]
+  |
+  o  0:a87874c6ec31 first []
+  
+
+Create a tag that looks like a revset
+
+  $ hg tag 'rev(0)'
+  $ hg log -G
+  @  2:fb616635b18f Added tag rev(0) for changeset 43114e71eddd [tip]
+  |
+  o  1:43114e71eddd second [rev(0)]
+  |
+  o  0:a87874c6ec31 first []
+  
+
+See how various things are resolved
+---
+
+Revision numbers
+
+  $ hg log -r '0'
+  0:a87874c6ec31 first []
+  $ hg log -r '1'
+  1:43114e71eddd second [rev(0)]
+
+"rev(x)" form (the one conflicting with the tags)
+(resolved as a label)
+
+  $ hg log -r 'rev(0)'
+  1:43114e71eddd second [rev(0)]
+  $ hg log -r 'rev(1)'
+  1:43114e71eddd second [rev(0)]
+
+same within a simple revspec
+(still resolved as the label)
+
+  $ hg log -r ':rev(0)'
+  0:a87874c6ec31 first []
+  1:43114e71eddd second [rev(0)]
+  $ hg log -r 'rev(0):'
+  1:43114e71eddd second [rev(0)]
+  2:fb616635b18f Added tag rev(0) for changeset 43114e71eddd [tip]
+
+within a more advances revset
+(still resolved as the label)
+
+  $ hg log -r 'rev(0) and branch(default)'
+  0:a87874c6ec31 first []
+
+some of the above with quote to force its resolution as a label
+
+  $ hg log -r ':"rev(0)"'
+  0:a87874c6ec31 first []
+  1:43114e71eddd second [rev(0)]
+  $ hg log -r '"rev(0)":'
+  1:43114e71eddd second [rev(0)]
+  2:fb616635b18f Added tag rev(0) for changeset 43114e71eddd [tip]
+  $ hg log -r '"rev(0)" and branch(default)'
+  1:43114e71eddd second [rev(0)]
+
+confusing bits within parents
+
+  $ hg log -r '(rev(0))'
+  0:a87874c6ec31 first []
+  $ hg log -r '( rev(0))'
+  0:a87874c6ec31 first []
+  $ hg log -r '("rev(0)")'
+  1:43114e71eddd second [rev(0)]
+
+Test label with quote in them.
+
+  $ hg tag '"foo"'
+
+  $ hg log -r '"foo"'
+  2:fb616635b18f Added tag rev(0) for changeset 43114e71eddd ["foo"]
+  $ hg log -r '("foo")'
+  abort: unknown revision 'foo'!
+  [255]
+  $ hg log -r '("\"foo\"")'
+  2:fb616635b18f Added tag rev(0) for changeset 43114e71eddd ["foo"]
+
+Test label with dash in them.
+
+  $ hg tag 'foo-bar'
+
+  $ hg log -r 'foo-bar'
+  3:a50aae922707 Added tag "foo" for changeset fb616635b18f [foo-bar]
+  $ hg log -r '(foo-bar)'
+  3:a50aae922707 Added tag "foo" for changeset fb616635b18f [foo-bar]
+  $ hg log -r '"foo-bar"'
+  3:a50aae922707 Added tag "foo" for changeset fb616635b18f [foo-bar]
+  $ hg log -r '("foo-bar")'
+  3:a50aae922707 Added tag "foo" for changeset fb616635b18f [foo-bar]
+
+Test label with + in them.
+
+  $ hg tag 'foo+bar'
+
+  $ hg log -r 'foo+bar'
+  4:bbf52b87b370 Added tag foo-bar for changeset a50aae922707 [foo+bar]
+  $ hg log -r '(foo+bar)'
+  abort: unknown revision 'foo'!
+  [255]
+  $ hg log -r '"foo+bar"'
+  4:bbf52b87b370 Added tag foo-bar for changeset a50aae922707 [foo+bar]
+  $ hg log -r '("foo+bar")'
+  4:bbf52b87b370 Added tag foo-bar for changeset a50aae922707 [foo+bar]
+
+Test tag with numeric version number.
+
+  $ hg tag '1.2'
+
+  $ hg log -r '1.2'
+  5:ff42fde8edbb Added tag foo+bar for changeset bbf52b87b370 [1.2]
+  $ hg log -r '(1.2)'
+  5:ff42fde8edbb Added tag foo+bar for changeset bbf52b87b370 [1.2]
+  $ hg log -r '"1.2"'
+  5:ff42fde8edbb Added tag foo+bar for changeset bbf52b87b370 [1.2]
+  $ hg log -r '("1.2")'
+  5:ff42fde8edbb Added tag foo+bar for changeset bbf52b87b370 [1.2]
+  $ hg log -r '::"1.2"'
+  0:a87874c6ec31 first []
+  1:43114e71eddd second [rev(0)]
+  2:fb616635b18f Added tag rev(0) for changeset 43114e71eddd ["foo"]
+  3:a50aae922707 Added tag "foo" for changeset fb616635b18f [foo-bar]
+  4:bbf52b87b370 Added tag foo-bar for changeset a50aae922707 [foo+bar]
+  5:ff42fde8edbb Added tag foo+bar for changeset bbf52b87b370 [1.2]
+  $ hg log -r '::1.2'
+  0:a87874c6ec31 first []
+  1:43114e71eddd second [rev(0)]
+  2:fb616635b18f Added tag rev(0) for changeset 43114e71eddd ["foo"]
+  3:a50aae922707 Added tag "foo" for changeset fb616635b18f [foo-bar]
+  

D2880: bundle: add the possibility to bundle bookmarks (issue5792)

2018-04-17 Thread lothiraldan (Boris Feld)
lothiraldan added inline comments.

INLINE COMMENTS

> martinvonz wrote in test-bundle-bookmarks.t:37-63
> I think it should be the same thing as pulling from another repo. Try putting 
> the same changes in another repo and pulling from it without giving the path 
> a name (nothing in [paths] config). I haven't checked what suffix will be 
> used on the divergent bookmark, but it probably makes sense to use the same 
> here (perhaps it's just going to be "https://phab.mercurial-scm.org/D1@1; as 
> I guessed before).

I tried adding such scenarios but failed to produce a divergence scenario, no 
idea why.

I don't think I will have time to debug the issue before the freeze, so let's 
skip this changeset for 4.6

REPOSITORY
  rHG Mercurial

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

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