Re: [PATCH 6 of 6 v2] paths: allow util.finddirs touse os.path.sep

2017-10-01 Thread Matt Harbison

> On Oct 1, 2017, at 6:33 AM, Kostia Balytskyi  wrote:
> 
> You guys are correct, these patches should not land. Yesterday I did another 
> pass of experiments on Windows 10 (build 10.0.14393), and if looks like 
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled
>  now works better than advertised (it did not two months ago...) in that if 
> it is enabled, both CreateFileA and CreateFileW accept long paths without 
> \\?\ prefixes and work well with them, including paths that contain forward 
> slashes as separators. So if I understand the situation correctly, MS has 
> fixed stuff for us and there's literally nothing we should do.  In any case, 
> this series is obsolete now.

I don’t have easy access to Windows 10, but given this, maybe we should try 
running the test suite with a TEMP path > 260 characters and Greg’s manifest 
patch, to see if we can make this work out of the box?  I think the xxxA 
methods are usually a thin wrapper around the xxxW methods, so I’d be surprised 
if a registry entry makes them work, but the manifest entry doesn’t.  Adrian’s 
concern about whether or not python will handle long paths seems reasonable, 
but your testing seems to show that it might just work.  (I’m assuming you were 
running hg commands, and not doing toy C apps.)

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


[Bug 5696] New: hg incoming exit status is ambiguous

2017-10-01 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5696

Bug ID: 5696
   Summary: hg incoming exit status is ambiguous
   Product: Mercurial
   Version: 4.3
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: vinc...@vinc17.net
CC: mercurial-devel@mercurial-scm.org

The description of the exit status of "hg incoming" is:

  Returns 0 if there are incoming changes, 1 otherwise.

But this is ambiguous. It does not say what happens in case the server is
unreachable. This prevents one from writing robust scripts.

Actually, hg doesn't behave as documented:

zira% hg incoming foo
abort: repository foo not found!
zira% echo $?
255

while 255 isn't a documented exit status. And an exit status larger than 128
may not be a good idea because this generally means that the command received a
signal.

Note that "diff" and "grep" also differentiate the status by returning 0 or 1,
but return 2 in case of error.

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


D894: fsmonitor: warn when fsmonitor could be used

2017-10-01 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  fsmonitor can significantly speed up operations on large working
  directories. But fsmonitor isn't enabled by default, so naive users
  may not realize there is a potential to make Mercurial faster.
  
  This commit introduces a warning to working directory updates when
  fsmonitor could be used.
  
  The following conditions must be met:
  
  - Working directory is previously empty
  - New working directory adds >= N files (currently 50,000)
  - Running on Linux or MacOS
  - fsmonitor not enabled
  - Warning not disabled via config override
  
  Because of the empty working directory restriction, most users will
  only see this warning during `hg clone` (assuming very few users
  actually do an `hg up null`).
  
  The addition of a warning may be considered a BC change. However, clone
  has printed warnings before. Until recently, Mercurial printed a warning
  with the server's certificate fingerprint when it wasn't explicitly
  trusted for example. The warning goes to stderr. So it shouldn't
  interfere with scripts parsing meaningful output.
  
  The OS restriction was on the advice of Facebook engineers, who only
  feel confident with watchman's stability on the supported platforms.
  
  .. feature::
  
Print warning when fsmonitor isn't being used on a large repository

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fsmonitor/__init__.py
  mercurial/configitems.py
  mercurial/merge.py
  tests/hghave.py
  tests/test-fsmonitor-warning.t

CHANGE DETAILS

diff --git a/tests/test-fsmonitor-warning.t b/tests/test-fsmonitor-warning.t
new file mode 100644
--- /dev/null
+++ b/tests/test-fsmonitor-warning.t
@@ -0,0 +1,94 @@
+Cloning without fsmonitor enabled does not print a warning for small repos
+
+  $ hg init source
+  $ cd source
+  $ touch file1 file2 file3 file4
+  $ hg -q commit -A -m initial
+  $ touch file5
+  $ hg -q commit -A -m 'add file5'
+  $ cd ..
+
+  $ hg clone source dest-default
+  updating to branch default
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Lower the warning threshold to simulate a large repo
+
+  $ cat >> $HGRCPATH << EOF
+  > [fsmonitor]
+  > warn_update_file_count = 4
+  > EOF
+
+We should see a warning about no fsmonitor on supported platforms
+
+#if linuxormacos no-fsmonitor
+
+  $ hg clone source dest-nofsmonitor
+  updating to branch default
+  (warning: large working directory being used without fsmonitor enabled; 
enable fsmonitor to improve performance; see "hg help -e fsmonitor")
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+#else
+
+  $ hg clone source dest-nofsmonitor
+  updating to branch default
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+#endif
+
+We should not see warning about fsmonitor when it is enabled
+
+#if fsmonitor
+
+  $ hg clone source dest-fsmonitor
+  updating to branch default
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+#endif
+
+We can disable the fsmonitor warning
+
+  $ hg --config fsmonitor.warn_when_unused=false clone source 
dest-disable-warning
+  updating to branch default
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Loaded fsmonitor but disabled in config should still print warning
+
+#if linuxormacos fsmonitor
+
+  $ hg --config fsmonitor.mode=off clone source dest-mode-off
+  updating to branch default
+  (warning: large working directory being used without fsmonitor enabled; 
enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor 
!)
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+#endif
+
+Warning not printed if working directory isn't empty
+
+  $ hg -q clone source dest-update
+  (warning: large working directory being used without fsmonitor enabled; 
enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
+  $ cd dest-update
+  $ hg up 4c436bafb4ab
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg up 9637229078ea
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+`hg update` from null revision also prints
+
+  $ hg up null
+  0 files updated, 0 files merged, 5 files removed, 0 files unresolved
+
+#if linuxormacos no-fsmonitor
+
+  $ hg up 9637229078ea
+  (warning: large working directory being used without fsmonitor enabled; 
enable fsmonitor to improve performance; see "hg help -e fsmonitor")
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+#else
+
+  $ hg up 9637229078ea
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+#endif
+
+  $ cd ..
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -554,6 +554,11 @@
 except ImportError:
 return False
 

D893: fsmonitor: use configitem

2017-10-01 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We might as well get this out of the way.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fsmonitor/__init__.py
  hgext/fsmonitor/state.py

CHANGE DETAILS

diff --git a/hgext/fsmonitor/state.py b/hgext/fsmonitor/state.py
--- a/hgext/fsmonitor/state.py
+++ b/hgext/fsmonitor/state.py
@@ -29,11 +29,10 @@
 self._lastclock = None
 self._identity = util.filestat(None)
 
-self.mode = self._ui.config('fsmonitor', 'mode', default='on')
+self.mode = self._ui.config('fsmonitor', 'mode')
 self.walk_on_invalidate = self._ui.configbool(
-'fsmonitor', 'walk_on_invalidate', False)
-self.timeout = float(self._ui.config(
-'fsmonitor', 'timeout', default='2'))
+'fsmonitor', 'walk_on_invalidate')
+self.timeout = float(self._ui.config('fsmonitor', 'timeout'))
 
 def get(self):
 try:
diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -107,6 +107,7 @@
 merge,
 pathutil,
 pycompat,
+registrar,
 scmutil,
 util,
 )
@@ -124,6 +125,22 @@
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('fsmonitor', 'mode',
+default='on',
+)
+configitem('fsmonitor', 'walk_on_invalidate',
+default=False,
+)
+configitem('fsmonitor', 'timeout',
+default='2',
+)
+configitem('fsmonitor', 'blacklistusers',
+default=list,
+)
+
 # This extension is incompatible with the following blacklisted extensions
 # and will disable itself when encountering one of these:
 _blacklist = ['largefiles', 'eol']



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


D892: fsmonitor: access copymap in new location

2017-10-01 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  fsmonitor has been busted since 
https://phab.mercurial-scm.org/rHG0865d25e8a8ad664e8da31ab1bf12f1fc9bf0c7a due 
to moving
  self._copymap. Fix it.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/fsmonitor/__init__.py

CHANGE DETAILS

diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -231,7 +231,7 @@
 dmap = self._map
 nonnormalset = getattr(self, '_nonnormalset', None)
 
-copymap = self._copymap
+copymap = self._map.copymap
 getkind = stat.S_IFMT
 dirkind = stat.S_IFDIR
 regkind = stat.S_IFREG



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


Re: [PATCH] formatter: fix default list/dict generator to be evaluated more than once

2017-10-01 Thread Augie Fackler
On Sun, Oct 01, 2017 at 09:25:25AM +0100, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1506843424 -3600
> #  Sun Oct 01 08:37:04 2017 +0100
> # Node ID 743f288540ff52670eb36e5728c4bf35fcca2a07
> # Parent  8de6dc4ab3304251a0bce4154603b784d4d519a0
> formatter: fix default list/dict generator to be evaluated more than once

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


Re: [PATCH] doctest: drop hack to run py2/3 tests selectively

2017-10-01 Thread Augie Fackler
On Sun, Oct 01, 2017 at 09:25:15AM +0100, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1506515928 -32400
> #  Wed Sep 27 21:38:48 2017 +0900
> # Node ID 8de6dc4ab3304251a0bce4154603b784d4d519a0
> # Parent  b52f22d9afa5a8abd4acd6aa27f8c2e413d087c1
> doctest: drop hack to run py2/3 tests selectively

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


Re: [PATCH] docker: try to follow the best practices for writing Dockerfiles

2017-10-01 Thread Augie Fackler
On Sun, Oct 01, 2017 at 06:51:49PM +0200, a.mux--- via Mercurial-devel wrote:
> # HG changeset patch
> # User muxator 
> # Date 1506812542 -7200
> #  Sun Oct 01 01:02:22 2017 +0200
> # Node ID b99e818a197220cf0f3a6d608bc3ddbdee6dcd18
> # Parent  0133ca39c68875e1d50e6ed48913e33e1f8f15ac
> docker: try to follow the best practices for writing Dockerfiles

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


mercurial@34422: 14 new changesets

2017-10-01 Thread Mercurial Commits
14 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/7de145167ae7
changeset:   34409:7de145167ae7
user:Boris Feld 
date:Fri Jun 30 03:43:55 2017 +0200
summary: configitems: register the 'profiling.output' config

https://www.mercurial-scm.org/repo/hg/rev/fecea78ff2af
changeset:   34410:fecea78ff2af
user:Boris Feld 
date:Fri Jun 30 03:43:56 2017 +0200
summary: configitems: register the 'profiling.showmax' config

https://www.mercurial-scm.org/repo/hg/rev/f5c16e6507e8
changeset:   34411:f5c16e6507e8
user:Boris Feld 
date:Fri Jun 30 03:43:57 2017 +0200
summary: configitems: register the 'profiling.showmin' config

https://www.mercurial-scm.org/repo/hg/rev/83dfbda40e67
changeset:   34412:83dfbda40e67
user:Boris Feld 
date:Fri Jun 30 03:44:00 2017 +0200
summary: configitems: register the 'profiling.type' config

https://www.mercurial-scm.org/repo/hg/rev/014d467f9d08
changeset:   34413:014d467f9d08
user:Boris Feld 
date:Thu Jul 06 14:50:17 2017 +0200
summary: effectflag: store an empty effect flag for the moment

https://www.mercurial-scm.org/repo/hg/rev/468646386e95
changeset:   34414:468646386e95
user:Boris Feld 
date:Thu Jul 06 14:51:08 2017 +0200
summary: tests: add tests for effect flags

https://www.mercurial-scm.org/repo/hg/rev/51aadc0d0da2
changeset:   34415:51aadc0d0da2
user:Boris Feld 
date:Thu Jul 06 14:52:34 2017 +0200
summary: effectflag: detect when description changed

https://www.mercurial-scm.org/repo/hg/rev/55ef17ec8e59
changeset:   34416:55ef17ec8e59
user:Boris Feld 
date:Thu Jul 06 14:53:48 2017 +0200
summary: effectflag: detect when user changed

https://www.mercurial-scm.org/repo/hg/rev/54af8de9bd09
changeset:   34417:54af8de9bd09
user:Boris Feld 
date:Thu Jul 06 14:54:22 2017 +0200
summary: effectflag: detect when date changed

https://www.mercurial-scm.org/repo/hg/rev/57980af73cfa
changeset:   34418:57980af73cfa
user:Boris Feld 
date:Thu Jul 06 14:55:12 2017 +0200
summary: effectflag: detect when branch changed

https://www.mercurial-scm.org/repo/hg/rev/fa26f5891e68
changeset:   34419:fa26f5891e68
user:Boris Feld 
date:Thu Jul 06 14:56:16 2017 +0200
summary: effectflag: detect when parents changed

https://www.mercurial-scm.org/repo/hg/rev/95759620d492
changeset:   34420:95759620d492
user:Boris Feld 
date:Thu Jul 06 14:58:44 2017 +0200
summary: effectflag: detect when meta changed

https://www.mercurial-scm.org/repo/hg/rev/187bc224554a
changeset:   34421:187bc224554a
user:Boris Feld 
date:Thu Jul 06 15:00:07 2017 +0200
summary: effectflag: detect when diff changed

https://www.mercurial-scm.org/repo/hg/rev/2fd06499dc8e
changeset:   34422:2fd06499dc8e
bookmark:@
tag: tip
user:Boris Feld 
date:Thu Aug 24 18:40:30 2017 +0200
summary: effectflag: document effect flag

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


D539: effectflag: detect when parents changed

2017-10-01 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfa26f5891e68: effectflag: detect when parents changed 
(authored by lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D539?vs=2110=2310

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

AFFECTED FILES
  mercurial/obsutil.py
  tests/test-obsmarkers-effectflag.t

CHANGE DETAILS

diff --git a/tests/test-obsmarkers-effectflag.t 
b/tests/test-obsmarkers-effectflag.t
--- a/tests/test-obsmarkers-effectflag.t
+++ b/tests/test-obsmarkers-effectflag.t
@@ -81,7 +81,7 @@
 check result
 
   $ hg debugobsolete --rev .
-  c85eff83a0340efd9da52b806a94c350222f3371 
da86aa2f19a30d6686b15cae15c7b6c908ec9699 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'rebase', 'user': 'test'}
+  c85eff83a0340efd9da52b806a94c350222f3371 
da86aa2f19a30d6686b15cae15c7b6c908ec9699 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '4', 'operation': 'rebase', 'user': 'test'}
 
 amend touching the diff
 ---
@@ -150,7 +150,7 @@
   rebasing 17:b57fed8d8322 "H1"
   merging H0
   $ hg debugobsolete -r tip
-  b57fed8d83228a8ae3748d8c3760a77638dd4f8c 
e509e2eb3df5d131ff7c02350bf2a9edd0c09478 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'rebase', 'user': 'test'}
+  b57fed8d83228a8ae3748d8c3760a77638dd4f8c 
e509e2eb3df5d131ff7c02350bf2a9edd0c09478 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '4', 'operation': 'rebase', 'user': 'test'}
 
 amend closing the branch should be detected as meta change
 --
diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -309,6 +309,7 @@
 EFFECTFLAGFIELD = "ef1"
 
 DESCCHANGED = 1 << 0 # action changed the description
+PARENTCHANGED = 1 << 2 # action change the parent
 USERCHANGED = 1 << 4 # the user changed
 DATECHANGED = 1 << 5 # the date changed
 BRANCHCHANGED = 1 << 6 # the branch changed
@@ -338,6 +339,10 @@
 if changectx.branch() != source.branch():
 effects |= BRANCHCHANGED
 
+# Check if at least one of the parent has changed
+if changectx.parents() != source.parents():
+effects |= PARENTCHANGED
+
 return effects
 
 def getobsoleted(repo, tr):



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


D542: effectflag: document effect flag

2017-10-01 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2fd06499dc8e: effectflag: document effect flag (authored by 
lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D542?vs=2288=2312

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

AFFECTED FILES
  mercurial/obsutil.py

CHANGE DETAILS

diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -307,7 +307,21 @@
 foreground = set(repo.set('%ln::', known))
 return set(c.node() for c in foreground)
 
-# logic around storing and using effect flags
+# effectflag field
+#
+# Effect-flag is a 1-byte bit field used to store what changed between a
+# changeset and its successor(s).
+#
+# The effect flag is stored in obs-markers metadata while we iterate on the
+# information design. That's why we have the EFFECTFLAGFIELD. If we come up
+# with an incompatible design for effect flag, we can store a new design under
+# another field name so we don't break readers. We plan to extend the existing
+# obsmarkers bit-field when the effect flag design will be stabilized.
+#
+# The effect-flag is placed behind an experimental flag
+# `effect-flags` set to off by default.
+#
+
 EFFECTFLAGFIELD = "ef1"
 
 DESCCHANGED = 1 << 0 # action changed the description



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


D536: effectflag: detect when user changed

2017-10-01 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG55ef17ec8e59: effectflag: detect when user changed 
(authored by lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D536?vs=2107=2308

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

AFFECTED FILES
  mercurial/obsutil.py
  tests/test-obsmarkers-effectflag.t

CHANGE DETAILS

diff --git a/tests/test-obsmarkers-effectflag.t 
b/tests/test-obsmarkers-effectflag.t
--- a/tests/test-obsmarkers-effectflag.t
+++ b/tests/test-obsmarkers-effectflag.t
@@ -40,7 +40,7 @@
 check result
 
   $ hg debugobsolete --rev .
-  ef4a313b1e0ade55718395d80e6b88c5ccd875eb 
5485c92d34330dac9d7a63dc07e1e3373835b964 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+  ef4a313b1e0ade55718395d80e6b88c5ccd875eb 
5485c92d34330dac9d7a63dc07e1e3373835b964 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '16', 'operation': 'amend', 'user': 'test'}
 
 amend touching the date only
 
@@ -106,7 +106,7 @@
 check result
 
   $ hg debugobsolete --rev .
-  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff 
a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '1', 'operation': 'amend', 'user': 'test'}
+  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff 
a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '17', 'operation': 'amend', 'user': 'test'}
 
 rebase not touching the diff
 
diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -309,6 +309,7 @@
 EFFECTFLAGFIELD = "ef1"
 
 DESCCHANGED = 1 << 0 # action changed the description
+USERCHANGED = 1 << 4 # the user changed
 
 def geteffectflag(relation):
 """ From an obs-marker relation, compute what changed between the
@@ -323,6 +324,10 @@
 if changectx.description() != source.description():
 effects |= DESCCHANGED
 
+# Check if user has changed
+if changectx.user() != source.user():
+effects |= USERCHANGED
+
 return effects
 
 def getobsoleted(repo, tr):



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


D538: effectflag: detect when branch changed

2017-10-01 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG57980af73cfa: effectflag: detect when branch changed 
(authored by lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D538?vs=2109=2309

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

AFFECTED FILES
  mercurial/obsutil.py
  tests/test-obsmarkers-effectflag.t

CHANGE DETAILS

diff --git a/tests/test-obsmarkers-effectflag.t 
b/tests/test-obsmarkers-effectflag.t
--- a/tests/test-obsmarkers-effectflag.t
+++ b/tests/test-obsmarkers-effectflag.t
@@ -65,7 +65,7 @@
 check result
 
   $ hg debugobsolete --rev .
-  bd3db8264ceebf1966319f5df3be7aac6acd1a8e 
14a01456e0574f0e0a0b15b2345486a6364a8d79 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+  bd3db8264ceebf1966319f5df3be7aac6acd1a8e 
14a01456e0574f0e0a0b15b2345486a6364a8d79 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '64', 'operation': 'amend', 'user': 'test'}
 
   $ hg up default
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -106,7 +106,7 @@
 check result
 
   $ hg debugobsolete --rev .
-  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff 
a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '49', 'operation': 'amend', 'user': 'test'}
+  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff 
a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '113', 'operation': 'amend', 'user': 'test'}
 
 rebase not touching the diff
 
diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -311,6 +311,7 @@
 DESCCHANGED = 1 << 0 # action changed the description
 USERCHANGED = 1 << 4 # the user changed
 DATECHANGED = 1 << 5 # the date changed
+BRANCHCHANGED = 1 << 6 # the branch changed
 
 def geteffectflag(relation):
 """ From an obs-marker relation, compute what changed between the
@@ -333,6 +334,10 @@
 if changectx.date() != source.date():
 effects |= DATECHANGED
 
+# Check if branch has changed
+if changectx.branch() != source.branch():
+effects |= BRANCHCHANGED
+
 return effects
 
 def getobsoleted(repo, tr):



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


D533: effectflag: store an empty effect flag for the moment

2017-10-01 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG014d467f9d08: effectflag: store an empty effect flag for 
the moment (authored by lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D533?vs=2286=2304

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

AFFECTED FILES
  mercurial/obsolete.py
  mercurial/obsutil.py

CHANGE DETAILS

diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -305,6 +305,19 @@
 foreground = set(repo.set('%ln::', known))
 return set(c.node() for c in foreground)
 
+# logic around storing and using effect flags
+EFFECTFLAGFIELD = "ef1"
+
+def geteffectflag(relation):
+""" From an obs-marker relation, compute what changed between the
+predecessor and the successor.
+"""
+effects = 0
+
+source = relation[0]
+
+return effects
+
 def getobsoleted(repo, tr):
 """return the set of pre-existing revisions obsoleted by a transaction"""
 torev = repo.unfiltered().changelog.nodemap.get
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -1043,6 +1043,11 @@
 if useoperation and operation:
 metadata['operation'] = operation
 
+# Effect flag metadata handling
+saveeffectflag = repo.ui.configbool('experimental',
+'effect-flags',
+False)
+
 tr = repo.transaction('add-obsolescence-marker')
 try:
 markerargs = []
@@ -1066,6 +1071,13 @@
 raise error.Abort(_("changeset %s cannot obsolete itself")
   % prec)
 
+# Effect flag can be different by relation
+if saveeffectflag:
+# The effect flag is saved in a versioned field name for future
+# evolution
+effectflag = obsutil.geteffectflag(rel)
+localmetadata[obsutil.EFFECTFLAGFIELD] = "%d" % effectflag
+
 # Creating the marker causes the hidden cache to become invalid,
 # which causes recomputation when we ask for prec.parents() above.
 # Resulting in n^2 behavior.  So let's prepare all of the args



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


D535: effectflag: detect when description changed

2017-10-01 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG51aadc0d0da2: effectflag: detect when description changed 
(authored by lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D535?vs=2106=2306

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

AFFECTED FILES
  mercurial/obsutil.py
  tests/test-obsmarkers-effectflag.t

CHANGE DETAILS

diff --git a/tests/test-obsmarkers-effectflag.t 
b/tests/test-obsmarkers-effectflag.t
--- a/tests/test-obsmarkers-effectflag.t
+++ b/tests/test-obsmarkers-effectflag.t
@@ -29,7 +29,7 @@
 check result
 
   $ hg debugobsolete --rev .
-  471f378eab4c5e25f6c77f785b27c936efb22874 
fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+  471f378eab4c5e25f6c77f785b27c936efb22874 
fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '1', 'operation': 'amend', 'user': 'test'}
 
 amend touching the user only
 
@@ -106,7 +106,7 @@
 check result
 
   $ hg debugobsolete --rev .
-  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff 
a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff 
a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '1', 'operation': 'amend', 'user': 'test'}
 
 rebase not touching the diff
 
diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -308,14 +308,21 @@
 # logic around storing and using effect flags
 EFFECTFLAGFIELD = "ef1"
 
+DESCCHANGED = 1 << 0 # action changed the description
+
 def geteffectflag(relation):
 """ From an obs-marker relation, compute what changed between the
 predecessor and the successor.
 """
 effects = 0
 
 source = relation[0]
 
+for changectx in relation[1]:
+# Check if description has changed
+if changectx.description() != source.description():
+effects |= DESCCHANGED
+
 return effects
 
 def getobsoleted(repo, tr):



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


D534: tests: add tests for effect flags

2017-10-01 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG468646386e95: tests: add tests for effect flags (authored 
by lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D534?vs=2105=2305

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

AFFECTED FILES
  tests/test-obsmarkers-effectflag.t

CHANGE DETAILS

diff --git a/tests/test-obsmarkers-effectflag.t 
b/tests/test-obsmarkers-effectflag.t
new file mode 100644
--- /dev/null
+++ b/tests/test-obsmarkers-effectflag.t
@@ -0,0 +1,167 @@
+Test the 'effect-flags' feature
+
+Global setup
+
+
+  $ . $TESTDIR/testlib/obsmarker-common.sh
+  $ cat >> $HGRCPATH < [ui]
+  > interactive = true
+  > [phases]
+  > publish=False
+  > [extensions]
+  > rebase =
+  > [experimental]
+  > evolution = all
+  > effect-flags = 1
+  > EOF
+
+  $ hg init $TESTTMP/effect-flags
+  $ cd $TESTTMP/effect-flags
+  $ mkcommit ROOT
+
+amend touching the description only
+---
+
+  $ mkcommit A0
+  $ hg commit --amend -m "A1"
+
+check result
+
+  $ hg debugobsolete --rev .
+  471f378eab4c5e25f6c77f785b27c936efb22874 
fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+
+amend touching the user only
+
+
+  $ mkcommit B0
+  $ hg commit --amend -u "bob "
+
+check result
+
+  $ hg debugobsolete --rev .
+  ef4a313b1e0ade55718395d80e6b88c5ccd875eb 
5485c92d34330dac9d7a63dc07e1e3373835b964 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+
+amend touching the date only
+
+
+  $ mkcommit B1
+  $ hg commit --amend -d "42 0"
+
+check result
+
+  $ hg debugobsolete --rev .
+  2ef0680ff45038ac28c9f1ff3644341f54487280 
4dd84345082e9e5291c2e6b3f335bbf8bf389378 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+
+amend touching the branch only
+
+
+  $ mkcommit B2
+  $ hg branch my-branch
+  marked working directory as branch my-branch
+  (branches are permanent and global, did you want a bookmark?)
+  $ hg commit --amend
+
+check result
+
+  $ hg debugobsolete --rev .
+  bd3db8264ceebf1966319f5df3be7aac6acd1a8e 
14a01456e0574f0e0a0b15b2345486a6364a8d79 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+
+  $ hg up default
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+rebase (parents change)
+---
+
+  $ mkcommit C0
+  $ mkcommit D0
+  $ hg rebase -r . -d 'desc(B0)'
+  rebasing 10:c85eff83a034 "D0" (tip)
+
+check result
+
+  $ hg debugobsolete --rev .
+  c85eff83a0340efd9da52b806a94c350222f3371 
da86aa2f19a30d6686b15cae15c7b6c908ec9699 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'rebase', 'user': 'test'}
+
+amend touching the diff
+---
+
+  $ mkcommit E0
+  $ echo 42 >> E0
+  $ hg commit --amend
+
+check result
+
+  $ hg debugobsolete --rev .
+  ebfe0333e0d96f68a917afd97c0a0af87f1c3b5f 
75781fdbdbf58a987516b00c980bccda1e9ae588 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+
+amend with multiple effect (desc and meta)
+---
+
+  $ mkcommit F0
+  $ hg branch my-other-branch
+  marked working directory as branch my-other-branch
+  $ hg commit --amend -m F1 -u "bob " -d "42 0"
+
+check result
+
+  $ hg debugobsolete --rev .
+  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff 
a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+
+rebase not touching the diff
+
+
+  $ cat << EOF > H0
+  > 0
+  > 1
+  > 2
+  > 3
+  > 4
+  > 5
+  > 6
+  > 7
+  > 8
+  > 9
+  > 10
+  > EOF
+  $ hg add H0
+  $ hg commit -m 'H0'
+  $ echo "H1" >> H0
+  $ hg commit -m "H1"
+  $ hg up -r "desc(H0)"
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat << EOF > H0
+  > H2
+  > 0
+  > 1
+  > 2
+  > 3
+  > 4
+  > 5
+  > 6
+  > 7
+  > 8
+  > 9
+  > 10
+  > EOF
+  $ hg commit -m "H2"
+  created new head
+  $ hg rebase -s "desc(H1)" -d "desc(H2)" -t :merge3
+  rebasing 17:b57fed8d8322 "H1"
+  merging H0
+  $ hg debugobsolete -r tip
+  b57fed8d83228a8ae3748d8c3760a77638dd4f8c 
e509e2eb3df5d131ff7c02350bf2a9edd0c09478 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'rebase', 'user': 'test'}
+
+amend closing the branch should be detected as meta change
+--
+
+  $ hg branch closedbranch
+  marked working directory as branch closedbranch
+  $ mkcommit G0
+  $ mkcommit I0
+  $ hg commit --amend --close-branch
+
+check result
+
+  $ hg debugobsolete -r .
+  2f599e54c1c6974299065cdf54e1ad640bfb7b5d 
12c6238b5e371eea00fd2013b12edce3f070928b 0 (Thu Jan 

Re: [PATCH 1 of 4] configitems: register the 'profiling.output' config

2017-10-01 Thread Gregory Szorc
On Sun, Oct 1, 2017 at 7:32 PM, Boris Feld  wrote:

> # HG changeset patch
> # User Boris Feld 
> # Date 1498787035 -7200
> #  Fri Jun 30 03:43:55 2017 +0200
> # Node ID 49eb5157513e5870b1842beb44420d00f334d133
> # Parent  7d2f71b7bc31acf1290ad3211481c5c77345a1da
> # EXP-Topic config.register.profiling
> configitems: register the 'profiling.output' config
>

Queued, thanks.


>
> diff -r 7d2f71b7bc31 -r 49eb5157513e mercurial/configitems.py
> --- a/mercurial/configitems.py  Sun Oct 01 16:46:02 2017 +0100
> +++ b/mercurial/configitems.py  Fri Jun 30 03:43:55 2017 +0200
> @@ -335,6 +335,9 @@
>  coreconfigitem('profiling', 'nested',
>  default=0,
>  )
> +coreconfigitem('profiling', 'output',
> +default=None,
> +)
>  coreconfigitem('profiling', 'sort',
>  default='inlinetime',
>  )
> ___
> 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 4] configitems: register the 'profiling.showmax' config

2017-10-01 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1498787036 -7200
#  Fri Jun 30 03:43:56 2017 +0200
# Node ID 5e5cd4ac398ab2d3c5c964adbf639cc5590fe7c1
# Parent  49eb5157513e5870b1842beb44420d00f334d133
# EXP-Topic config.register.profiling
configitems: register the 'profiling.showmax' config

diff -r 49eb5157513e -r 5e5cd4ac398a mercurial/configitems.py
--- a/mercurial/configitems.py  Fri Jun 30 03:43:55 2017 +0200
+++ b/mercurial/configitems.py  Fri Jun 30 03:43:56 2017 +0200
@@ -338,6 +338,9 @@
 coreconfigitem('profiling', 'output',
 default=None,
 )
+coreconfigitem('profiling', 'showmax',
+default=0.999,
+)
 coreconfigitem('profiling', 'sort',
 default='inlinetime',
 )
diff -r 49eb5157513e -r 5e5cd4ac398a mercurial/profiling.py
--- a/mercurial/profiling.pyFri Jun 30 03:43:55 2017 +0200
+++ b/mercurial/profiling.pyFri Jun 30 03:43:56 2017 +0200
@@ -138,7 +138,7 @@
 
 if profformat == 'chrome':
 showmin = ui.configwith(fraction, 'profiling', 'showmin', 0.005)
-showmax = ui.configwith(fraction, 'profiling', 'showmax', 0.999)
+showmax = ui.configwith(fraction, 'profiling', 'showmax')
 kwargs.update(minthreshold=showmin, maxthreshold=showmax)
 elif profformat == 'hotpath':
 # inconsistent config: profiling.showmin
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 4] configitems: register the 'profiling.output' config

2017-10-01 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1498787035 -7200
#  Fri Jun 30 03:43:55 2017 +0200
# Node ID 49eb5157513e5870b1842beb44420d00f334d133
# Parent  7d2f71b7bc31acf1290ad3211481c5c77345a1da
# EXP-Topic config.register.profiling
configitems: register the 'profiling.output' config

diff -r 7d2f71b7bc31 -r 49eb5157513e mercurial/configitems.py
--- a/mercurial/configitems.py  Sun Oct 01 16:46:02 2017 +0100
+++ b/mercurial/configitems.py  Fri Jun 30 03:43:55 2017 +0200
@@ -335,6 +335,9 @@
 coreconfigitem('profiling', 'nested',
 default=0,
 )
+coreconfigitem('profiling', 'output',
+default=None,
+)
 coreconfigitem('profiling', 'sort',
 default='inlinetime',
 )
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 3 of 4] configitems: register the 'profiling.showmin' config

2017-10-01 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1498787037 -7200
#  Fri Jun 30 03:43:57 2017 +0200
# Node ID dcee30ee38b6865c13b03bcbe4e817341dca1a15
# Parent  5e5cd4ac398ab2d3c5c964adbf639cc5590fe7c1
# EXP-Topic config.register.profiling
configitems: register the 'profiling.showmin' config

diff -r 5e5cd4ac398a -r dcee30ee38b6 mercurial/configitems.py
--- a/mercurial/configitems.py  Fri Jun 30 03:43:56 2017 +0200
+++ b/mercurial/configitems.py  Fri Jun 30 03:43:57 2017 +0200
@@ -341,6 +341,9 @@
 coreconfigitem('profiling', 'showmax',
 default=0.999,
 )
+coreconfigitem('profiling', 'showmin',
+default=dynamicdefault,
+)
 coreconfigitem('profiling', 'sort',
 default='inlinetime',
 )
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 4 of 4] configitems: register the 'profiling.type' config

2017-10-01 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1498787040 -7200
#  Fri Jun 30 03:44:00 2017 +0200
# Node ID f57cc93de27e7f6594f2588cd2496f6bddf7024c
# Parent  dcee30ee38b6865c13b03bcbe4e817341dca1a15
# EXP-Topic config.register.profiling
configitems: register the 'profiling.type' config

diff -r dcee30ee38b6 -r f57cc93de27e mercurial/configitems.py
--- a/mercurial/configitems.py  Fri Jun 30 03:43:57 2017 +0200
+++ b/mercurial/configitems.py  Fri Jun 30 03:44:00 2017 +0200
@@ -350,6 +350,9 @@
 coreconfigitem('profiling', 'statformat',
 default='hotpath',
 )
+coreconfigitem('profiling', 'type',
+default='stat',
+)
 coreconfigitem('progress', 'assume-tty',
 default=False,
 )
diff -r dcee30ee38b6 -r f57cc93de27e mercurial/profiling.py
--- a/mercurial/profiling.pyFri Jun 30 03:43:57 2017 +0200
+++ b/mercurial/profiling.pyFri Jun 30 03:44:00 2017 +0200
@@ -183,7 +183,7 @@
 profiler = encoding.environ.get('HGPROF')
 proffn = None
 if profiler is None:
-profiler = self._ui.config('profiling', 'type', default='stat')
+profiler = self._ui.config('profiling', 'type')
 if profiler not in ('ls', 'stat', 'flame'):
 # try load profiler from extension with the same name
 proffn = _loadprofiler(self._ui, profiler)
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@34408: 2 new changesets

2017-10-01 Thread Mercurial Commits
2 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/b6692ba7d5b0
changeset:   34407:b6692ba7d5b0
user:Simon Whitaker 
date:Sun Oct 01 12:54:35 2017 +0100
summary: obsmarker: crash more helpfully when metadata fields are >255bytes 
(issue5681)

https://www.mercurial-scm.org/repo/hg/rev/7d2f71b7bc31
changeset:   34408:7d2f71b7bc31
bookmark:@
tag: tip
user:Simon Whitaker 
date:Sun Oct 01 16:46:02 2017 +0100
summary: dirstate: implement __len__ on dirstatemap (issue5695)

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


Re: [PATCH] docker: try to be more adherent to the best practices for writing Dockerfiles

2017-10-01 Thread Antonio Muci via Mercurial-devel

Please ignore this patch.

I have just seen that the Fedora Dockerfiles need the same treatment.
I will send a single changeset.

Sorry for the noise.


On 10/01/2017 06:26 PM, a@inwind.it wrote:

# HG changeset patch
# User muxator 
# Date 1506812542 -7200
#  Sun Oct 01 01:02:22 2017 +0200
# Node ID 75d89e4aec93490431b81526c292766f4c08b38e
# Parent  0133ca39c68875e1d50e6ed48913e33e1f8f15ac
docker: try to be more adherent to the best practices for writing Dockerfiles

Merged multiple RUN instructions and sorted the arguments alphabetically
Reference: 
https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/

diff --git a/contrib/docker/centos5 b/contrib/docker/centos5
--- a/contrib/docker/centos5
+++ b/contrib/docker/centos5
@@ -1,9 +1,23 @@
  FROM centos:centos5
-RUN sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo
-RUN sed -i 
's/^#\(baseurl=\)http:\/\/mirror.centos.org\/centos/\1http:\/\/vault.centos.org/'
 /etc/yum.repos.d/*.repo
-RUN sed -i 's/\$releasever/5.11/' /etc/yum.repos.d/*.repo
-RUN yum install -y gcc make rpm-build gettext tar
-RUN yum install -y python-devel python-docutils
+RUN \
+   sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo && \
+   sed -i 
's/^#\(baseurl=\)http:\/\/mirror.centos.org\/centos/\1http:\/\/vault.centos.org/' 
/etc/yum.repos.d/*.repo && \
+   sed -i 's/\$releasever/5.11/' /etc/yum.repos.d/*.repo
+
+RUN yum install -y \
+   gcc \
+   gettext \
+   make \
+   python-devel \
+   python-docutils \
+   rpm-build \
+   tar
+
  # For creating repo meta data
-RUN yum install -y createrepo
-RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel 
bzip2-devel
+RUN yum install -y \
+   bzip2-devel \
+   createrepo \
+   ncurses-devel \
+   openssl-devel \
+   readline-devel \
+   zlib-devel
diff --git a/contrib/docker/centos6 b/contrib/docker/centos6
--- a/contrib/docker/centos6
+++ b/contrib/docker/centos6
@@ -1,11 +1,20 @@
  FROM centos:centos6
-RUN yum install -y gcc
-RUN yum install -y python-devel python-docutils
-RUN yum install -y make
-RUN yum install -y rpm-build
-RUN yum install -y gettext
-RUN yum install -y tar
+RUN yum install -y \
+   gcc \
+   gettext \
+   make \
+   python-devel \
+   python-docutils \
+   rpm-build \
+   tar
+
  # For creating repo meta data
  RUN yum install -y createrepo
+
  # For python
-RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel 
bzip2-devel
+RUN yum install -y \
+   bzip2-devel \
+   ncurses-devel \
+   openssl-devel \
+   readline-devel \
+   zlib-devel
diff --git a/contrib/docker/centos7 b/contrib/docker/centos7
--- a/contrib/docker/centos7
+++ b/contrib/docker/centos7
@@ -1,9 +1,12 @@
  FROM centos:centos7
-RUN yum install -y gcc
-RUN yum install -y python-devel python-docutils
-RUN yum install -y make
-RUN yum install -y rpm-build
-RUN yum install -y gettext
-RUN yum install -y tar
+RUN yum install -y \
+   gcc \
+   gettext \
+   make \
+   python-devel \
+   python-docutils \
+   rpm-build \
+   tar
+
  # For creating repo meta data
  RUN yum install -y createrepo


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


Re: [PATCH] docker: try to be more adherent to the best practices for writing Dockerfiles

2017-10-01 Thread Antonio Muci via Mercurial-devel

Please ignore also this patch.

I have just seen that the Fedora Dockerfiles require the same treatment.
I will send a single changeset.



On 10/01/2017 06:26 PM, a@inwind.it wrote:

# HG changeset patch
# User muxator 
# Date 1506812542 -7200
#  Sun Oct 01 01:02:22 2017 +0200
# Node ID 75d89e4aec93490431b81526c292766f4c08b38e
# Parent  0133ca39c68875e1d50e6ed48913e33e1f8f15ac
docker: try to be more adherent to the best practices for writing Dockerfiles

Merged multiple RUN instructions and sorted the arguments alphabetically
Reference: 
https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/

diff --git a/contrib/docker/centos5 b/contrib/docker/centos5
--- a/contrib/docker/centos5
+++ b/contrib/docker/centos5
@@ -1,9 +1,23 @@
  FROM centos:centos5
-RUN sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo
-RUN sed -i 
's/^#\(baseurl=\)http:\/\/mirror.centos.org\/centos/\1http:\/\/vault.centos.org/'
 /etc/yum.repos.d/*.repo
-RUN sed -i 's/\$releasever/5.11/' /etc/yum.repos.d/*.repo
-RUN yum install -y gcc make rpm-build gettext tar
-RUN yum install -y python-devel python-docutils
+RUN \
+   sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo && \
+   sed -i 
's/^#\(baseurl=\)http:\/\/mirror.centos.org\/centos/\1http:\/\/vault.centos.org/' 
/etc/yum.repos.d/*.repo && \
+   sed -i 's/\$releasever/5.11/' /etc/yum.repos.d/*.repo
+
+RUN yum install -y \
+   gcc \
+   gettext \
+   make \
+   python-devel \
+   python-docutils \
+   rpm-build \
+   tar
+
  # For creating repo meta data
-RUN yum install -y createrepo
-RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel 
bzip2-devel
+RUN yum install -y \
+   bzip2-devel \
+   createrepo \
+   ncurses-devel \
+   openssl-devel \
+   readline-devel \
+   zlib-devel
diff --git a/contrib/docker/centos6 b/contrib/docker/centos6
--- a/contrib/docker/centos6
+++ b/contrib/docker/centos6
@@ -1,11 +1,20 @@
  FROM centos:centos6
-RUN yum install -y gcc
-RUN yum install -y python-devel python-docutils
-RUN yum install -y make
-RUN yum install -y rpm-build
-RUN yum install -y gettext
-RUN yum install -y tar
+RUN yum install -y \
+   gcc \
+   gettext \
+   make \
+   python-devel \
+   python-docutils \
+   rpm-build \
+   tar
+
  # For creating repo meta data
  RUN yum install -y createrepo
+
  # For python
-RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel 
bzip2-devel
+RUN yum install -y \
+   bzip2-devel \
+   ncurses-devel \
+   openssl-devel \
+   readline-devel \
+   zlib-devel
diff --git a/contrib/docker/centos7 b/contrib/docker/centos7
--- a/contrib/docker/centos7
+++ b/contrib/docker/centos7
@@ -1,9 +1,12 @@
  FROM centos:centos7
-RUN yum install -y gcc
-RUN yum install -y python-devel python-docutils
-RUN yum install -y make
-RUN yum install -y rpm-build
-RUN yum install -y gettext
-RUN yum install -y tar
+RUN yum install -y \
+   gcc \
+   gettext \
+   make \
+   python-devel \
+   python-docutils \
+   rpm-build \
+   tar
+
  # For creating repo meta data
  RUN yum install -y createrepo


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


D891: cleanup: use urllibcompat for renamed methods on urllib request objects

2017-10-01 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/D891

AFFECTED FILES
  mercurial/byterange.py
  mercurial/httpconnection.py
  mercurial/keepalive.py
  mercurial/url.py

CHANGE DETAILS

diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -21,6 +21,7 @@
 keepalive,
 pycompat,
 sslutil,
+urllibcompat,
 util,
 )
 
@@ -119,7 +120,7 @@
 self.ui = ui
 
 def proxy_open(self, req, proxy, type_):
-host = req.get_host().split(':')[0]
+host = urllibcompat.gethost(req).split(':')[0]
 for e in self.no_list:
 if host == e:
 return None
@@ -166,10 +167,10 @@
 tunnel_host = 'https://' + tunnel_host
 new_tunnel = True
 else:
-tunnel_host = req.get_selector()
+tunnel_host = urllibcompat.getselector(req)
 new_tunnel = False
 
-if new_tunnel or tunnel_host == req.get_full_url(): # has proxy
+if new_tunnel or tunnel_host == urllibcompat.getfullurl(req): # has proxy
 u = util.url(tunnel_host)
 if new_tunnel or u.scheme == 'https': # only use CONNECT for HTTPS
 h.realhostport = ':'.join([u.host, (u.port or '443')])
@@ -320,9 +321,9 @@
 return keepalive.KeepAliveHandler._start_transaction(self, h, req)
 
 def https_open(self, req):
-# req.get_full_url() does not contain credentials and we may
-# need them to match the certificates.
-url = req.get_full_url()
+# urllibcompat.getfullurl() does not contain credentials
+# and we may need them to match the certificates.
+url = urllibcompat.getfullurl(req)
 user, password = self.pwmgr.find_stored_password(url)
 res = httpconnectionmod.readauthforuri(self.ui, url, user)
 if res:
@@ -406,7 +407,8 @@
 self, auth_header, host, req, headers)
 
 def retry_http_basic_auth(self, host, req, realm):
-user, pw = self.passwd.find_user_password(realm, req.get_full_url())
+user, pw = self.passwd.find_user_password(
+realm, urllibcompat.getfullurl(req))
 if pw is not None:
 raw = "%s:%s" % (user, pw)
 auth = 'Basic %s' % base64.b64encode(raw).strip()
diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
--- a/mercurial/keepalive.py
+++ b/mercurial/keepalive.py
@@ -93,6 +93,7 @@
 from .i18n import _
 from . import (
 pycompat,
+urllibcompat,
 util,
 )
 
@@ -205,7 +206,7 @@
 return self.do_open(HTTPConnection, req)
 
 def do_open(self, http_class, req):
-host = req.get_host()
+host = urllibcompat.gethost(req)
 if not host:
 raise urlerr.urlerror('no host given')
 
@@ -316,24 +317,26 @@
 if n in headers:
 skipheaders['skip_' + n.replace('-', '_')] = 1
 try:
-if req.has_data():
-data = req.get_data()
+if urllibcompat.hasdata(req):
+data = urllibcompat.getdata(req)
 h.putrequest(
-req.get_method(), req.get_selector(), **skipheaders)
+req.get_method(), urllibcompat.getselector(req),
+**skipheaders)
 if 'content-type' not in headers:
 h.putheader('Content-type',
 'application/x-www-form-urlencoded')
 if 'content-length' not in headers:
 h.putheader('Content-length', '%d' % len(data))
 else:
 h.putrequest(
-req.get_method(), req.get_selector(), **skipheaders)
+req.get_method(), urllibcompat.getselector(req),
+**skipheaders)
 except socket.error as err:
 raise urlerr.urlerror(err)
 for k, v in headers.items():
 h.putheader(k, v)
 h.endheaders()
-if req.has_data():
+if urllibcompat.hasdata(req):
 h.send(data)
 
 class HTTPHandler(KeepAliveHandler, urlreq.httphandler):
diff --git a/mercurial/httpconnection.py b/mercurial/httpconnection.py
--- a/mercurial/httpconnection.py
+++ b/mercurial/httpconnection.py
@@ -18,6 +18,7 @@
 from . import (
 httpclient,
 sslutil,
+urllibcompat,
 util,
 )
 
@@ -174,13 +175,14 @@
 # object. On Python 2.6.5, it's stored in the _tunnel_host
 # attribute which has no accessor.
 tunhost = getattr(req, '_tunnel_host', None)
-host = req.get_host()
+host = urllibcompat.gethost(req)
 if tunhost:
 proxyhost = host
 host = tunhost
 elif req.has_proxy():
-proxyhost = req.get_host()
-host = 

D888: keepalive: python 3 portability tweaks

2017-10-01 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/D888

AFFECTED FILES
  mercurial/keepalive.py

CHANGE DETAILS

diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
--- a/mercurial/keepalive.py
+++ b/mercurial/keepalive.py
@@ -92,6 +92,7 @@
 
 from .i18n import _
 from . import (
+pycompat,
 util,
 )
 
@@ -235,7 +236,8 @@
 # The string form of BadStatusLine is the status line. Add some context
 # to make the error message slightly more useful.
 except httplib.BadStatusLine as err:
-raise urlerr.urlerror(_('bad HTTP status line: %s') % err.line)
+raise urlerr.urlerror(
+_('bad HTTP status line: %s') % pycompat.sysbytes(err.line))
 except (socket.error, httplib.HTTPException) as err:
 raise urlerr.urlerror(err)
 
@@ -358,9 +360,12 @@
 
 
 def __init__(self, sock, debuglevel=0, strict=0, method=None):
+extrakw = {}
+if not pycompat.ispy3:
+extrakw['strict'] = True
+extrakw['buffering'] = True
 httplib.HTTPResponse.__init__(self, sock, debuglevel=debuglevel,
-  strict=True, method=method,
-  buffering=True)
+  method=method, **extrakw)
 self.fileno = sock.fileno
 self.code = None
 self._rbuf = ''



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


D885: httppasswordmgrdbproxy: specify exact arguments

2017-10-01 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We only ever call these functions in a single way, so let's just
  actually specify them. We need to do some string/bytes encoding
  dancing here for Python 3, so it'll help to know what arguments we
  need to convert.
  
  no-check-commit because I'm modifying functions that check-commit
  =
  
  does not like.

REPOSITORY
  rHG Mercurial

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

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
@@ -146,11 +146,11 @@
 self._mgr = urlreq.httppasswordmgrwithdefaultrealm()
 return self._mgr
 
-def add_password(self, *args, **kwargs):
-return self._get_mgr().add_password(*args, **kwargs)
+def add_password(self, realm, uris, user, passwd):
+return self._get_mgr().add_password(realm, uris, user, passwd)
 
-def find_user_password(self, *args, **kwargs):
-return self._get_mgr().find_user_password(*args, **kwargs)
+def find_user_password(self, realm, uri):
+return self._get_mgr().find_user_password(realm, uri)
 
 def _catchterm(*args):
 raise error.SignalInterrupt



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


D887: httppeer: use native strings for headers

2017-10-01 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  On Python 3, we need to use unicodes, rather than bytes. This lets
  test-pull.t get a lot further along.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/httppeer.py

CHANGE DETAILS

diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -221,33 +221,34 @@
 argsio = io.BytesIO(strargs)
 argsio.length = len(strargs)
 data = _multifile(argsio, data)
-headers['X-HgArgs-Post'] = len(strargs)
+headers[r'X-HgArgs-Post'] = len(strargs)
 else:
 if len(args) > 0:
 httpheader = self.capable('httpheader')
 if httpheader:
 headersize = int(httpheader.split(',', 1)[0])
 if headersize > 0:
 # The headers can typically carry more data than the URL.
 encargs = urlreq.urlencode(sorted(args.items()))
-for header, value in encodevalueinheaders(encargs, 'X-HgArg',
+for header, value in encodevalueinheaders(encargs, r'X-HgArg',
   headersize):
 headers[header] = value
 varyheaders.append(header)
 else:
 q += sorted(args.items())
-qs = '?%s' % urlreq.urlencode(q)
-cu = "%s%s" % (self._url, qs)
+qs = '?%s' % urlreq.urlencode([
+(pycompat.strurl(qq[0]), pycompat.strurl(qq[1])) for qq in q])
+cu = r"%s%s" % (pycompat.strurl(self._url), qs)
 size = 0
 if util.safehasattr(data, 'length'):
 size = data.length
 elif data is not None:
 size = len(data)
 if size and self.ui.configbool('ui', 'usehttp2'):
-headers['Expect'] = '100-Continue'
-headers['X-HgHttp2'] = '1'
-if data is not None and 'Content-Type' not in headers:
-headers['Content-Type'] = 'application/mercurial-0.1'
+headers[r'Expect'] = r'100-Continue'
+headers[r'X-HgHttp2'] = r'1'
+if data is not None and r'Content-Type' not in headers:
+headers[r'Content-Type'] = r'application/mercurial-0.1'
 
 # Tell the server we accept application/mercurial-0.2 and multiple
 # compression formats if the server is capable of emitting those
@@ -281,7 +282,7 @@
 varyheaders.append(header)
 
 if varyheaders:
-headers['Vary'] = ','.join(varyheaders)
+headers[r'Vary'] = r','.join(varyheaders)
 
 req = self._requestbuilder(cu, data, headers)
 



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


D886: ui: convert to/from Optional[bytes] to Optional[str] in password manager

2017-10-01 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This password manager proxy is roughly the right-looking layer to
  convert between strings and bytes. Many of these arguments can be
  None, so we have a helper method to make the conversion preserve Nones
  without exploding.

REPOSITORY
  rHG Mercurial

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

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
@@ -135,6 +135,19 @@
 """,
 }
 
+def _maybestrurl(maybebytes):
+if maybebytes is None:
+return None
+if pycompat.ispy3:
+return pycompat.strurl(maybebytes)
+return maybebytes
+
+def _maybebytesurl(maybestr):
+if maybestr is None:
+return None
+if pycompat.ispy3:
+return pycompat.bytesurl(maybestr)
+return maybestr
 
 class httppasswordmgrdbproxy(object):
 """Delays loading urllib2 until it's needed."""
@@ -147,10 +160,18 @@
 return self._mgr
 
 def add_password(self, realm, uris, user, passwd):
-return self._get_mgr().add_password(realm, uris, user, passwd)
+if isinstance(uris, tuple):
+uris = tuple(_maybestrurl(u) for u in uris)
+else:
+uris = _maybestrurl(uris)
+return self._get_mgr().add_password(
+_maybestrurl(realm), uris,
+_maybestrurl(user), _maybestrurl(passwd))
 
 def find_user_password(self, realm, uri):
-return self._get_mgr().find_user_password(realm, uri)
+return tuple(_maybebytesurl(v) for v in
+ self._get_mgr().find_user_password(_maybestrurl(realm),
+_maybestrurl(uri)))
 
 def _catchterm(*args):
 raise error.SignalInterrupt



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


D889: url: use native strings for header values

2017-10-01 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/D889

AFFECTED FILES
  mercurial/url.py

CHANGE DETAILS

diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -19,6 +19,7 @@
 error,
 httpconnection as httpconnectionmod,
 keepalive,
+pycompat,
 sslutil,
 util,
 )
@@ -495,13 +496,13 @@
 # agent string for anything, clients should be able to define whatever
 # user agent they deem appropriate.
 agent = 'mercurial/proto-1.0 (Mercurial %s)' % util.version()
-opener.addheaders = [('User-agent', agent)]
+opener.addheaders = [(r'User-agent', pycompat.sysstr(agent))]
 
 # This header should only be needed by wire protocol requests. But it has
 # been sent on all requests since forever. We keep sending it for backwards
 # compatibility reasons. Modern versions of the wire protocol use
 # X-HgProto- for advertising client support.
-opener.addheaders.append(('Accept', 'application/mercurial-0.1'))
+opener.addheaders.append((r'Accept', r'application/mercurial-0.1'))
 return opener
 
 def open(ui, url_, data=None):



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


D890: urllibcompat: new library to help abstract out some python3 urllib2 stuff

2017-10-01 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Doing a new file instead of pycompat because I'm starting to feel like
  pycompat is getting a little enormous in terms of scope.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/urllibcompat.py

CHANGE DETAILS

diff --git a/mercurial/urllibcompat.py b/mercurial/urllibcompat.py
new file mode 100644
--- /dev/null
+++ b/mercurial/urllibcompat.py
@@ -0,0 +1,36 @@
+from __future__ import absolute_import
+
+from . import pycompat
+
+if pycompat.ispy3:
+
+def getfullurl(req):
+return req.full_url
+
+def gethost(req):
+return req.host
+
+def getselector(req):
+return req.selector
+
+def getdata(req):
+return req.data
+
+def hasdata(req):
+return req.data is not None
+else:
+
+def gethost(req):
+return req.get_host()
+
+def getselector(req):
+return req.get_selector()
+
+def getfullurl(req):
+return req.get_full_url()
+
+def getdata(req):
+return req.get_data()
+
+def hasdata(req):
+return req.has_data()



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


[PATCH] docker: try to be more adherent to the best practices for writing Dockerfiles

2017-10-01 Thread a.mux--- via Mercurial-devel
# HG changeset patch
# User muxator 
# Date 1506812542 -7200
#  Sun Oct 01 01:02:22 2017 +0200
# Node ID 75d89e4aec93490431b81526c292766f4c08b38e
# Parent  0133ca39c68875e1d50e6ed48913e33e1f8f15ac
docker: try to be more adherent to the best practices for writing Dockerfiles

Merged multiple RUN instructions and sorted the arguments alphabetically
Reference: 
https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/

diff --git a/contrib/docker/centos5 b/contrib/docker/centos5
--- a/contrib/docker/centos5
+++ b/contrib/docker/centos5
@@ -1,9 +1,23 @@
 FROM centos:centos5
-RUN sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo
-RUN sed -i 
's/^#\(baseurl=\)http:\/\/mirror.centos.org\/centos/\1http:\/\/vault.centos.org/'
 /etc/yum.repos.d/*.repo
-RUN sed -i 's/\$releasever/5.11/' /etc/yum.repos.d/*.repo
-RUN yum install -y gcc make rpm-build gettext tar
-RUN yum install -y python-devel python-docutils
+RUN \
+   sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo && \
+   sed -i 
's/^#\(baseurl=\)http:\/\/mirror.centos.org\/centos/\1http:\/\/vault.centos.org/'
 /etc/yum.repos.d/*.repo && \
+   sed -i 's/\$releasever/5.11/' /etc/yum.repos.d/*.repo
+
+RUN yum install -y \
+   gcc \
+   gettext \
+   make \
+   python-devel \
+   python-docutils \
+   rpm-build \
+   tar
+
 # For creating repo meta data
-RUN yum install -y createrepo
-RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel 
bzip2-devel
+RUN yum install -y \
+   bzip2-devel \
+   createrepo \
+   ncurses-devel \
+   openssl-devel \
+   readline-devel \
+   zlib-devel
diff --git a/contrib/docker/centos6 b/contrib/docker/centos6
--- a/contrib/docker/centos6
+++ b/contrib/docker/centos6
@@ -1,11 +1,20 @@
 FROM centos:centos6
-RUN yum install -y gcc
-RUN yum install -y python-devel python-docutils
-RUN yum install -y make
-RUN yum install -y rpm-build
-RUN yum install -y gettext
-RUN yum install -y tar
+RUN yum install -y \
+   gcc \
+   gettext \
+   make \
+   python-devel \
+   python-docutils \
+   rpm-build \
+   tar
+
 # For creating repo meta data
 RUN yum install -y createrepo
+
 # For python
-RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel 
bzip2-devel
+RUN yum install -y \
+   bzip2-devel \
+   ncurses-devel \
+   openssl-devel \
+   readline-devel \
+   zlib-devel
diff --git a/contrib/docker/centos7 b/contrib/docker/centos7
--- a/contrib/docker/centos7
+++ b/contrib/docker/centos7
@@ -1,9 +1,12 @@
 FROM centos:centos7
-RUN yum install -y gcc
-RUN yum install -y python-devel python-docutils
-RUN yum install -y make
-RUN yum install -y rpm-build
-RUN yum install -y gettext
-RUN yum install -y tar
+RUN yum install -y \
+   gcc \
+   gettext \
+   make \
+   python-devel \
+   python-docutils \
+   rpm-build \
+   tar
+
 # For creating repo meta data
 RUN yum install -y createrepo
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 7 of 7] extdata: abort if external command exits with non-zero status

2017-10-01 Thread FUJIWARA Katsunori
At Sun, 01 Oct 2017 13:00:18 +0100,
Yuya Nishihara wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1506856910 -3600
> #  Sun Oct 01 12:21:50 2017 +0100
> # Node ID 86c51cf6c4ff8a9a01e34e365c8fbc50415d072e
> # Parent  b3a36705720f5ed1e7cc5129b27450ca59c7952b
> extdata: abort if external command exits with non-zero status
> 
> It could be a warning, but a warning in template output would be unreadable.

> diff --git a/tests/test-extdata.t b/tests/test-extdata.t
> --- a/tests/test-extdata.t
> +++ b/tests/test-extdata.t
> @@ -12,6 +12,7 @@ test revset support
>> filedata = file:extdata.txt
>> notes = notes.txt
>> shelldata = shell:cat extdata.txt | grep 2

Just nit:

I sometime forget that filtering by grep might cause non-zero exit
code. So, hint like "use `| grep PATTERN | cat` to allow empty
external data" or so will prevent me from falling into a pitfall in
the future :-)


> +  > fail = shell:false
>> EOF
>$ cat <<'EOF' > extdata.txt
>> 2 another comment on 2
> @@ -50,6 +51,9 @@ test bad extdata() revset source
>$ hg log -qr "extdata(unknown)"
>abort: unknown extdata source 'unknown'
>[255]
> +  $ hg log -qr "extdata(fail)"
> +  abort: extdata command 'false' failed: exited with status 1
> +  [255]
>  
>  test template support:
>  
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

-- 
--
[FUJIWARA Katsunori] fo...@lares.dti.ne.jp
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D884: dirstate: implement __len__ on dirstatemap (issue5695)

2017-10-01 Thread swhitaker (Simon Whitaker)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7d2f71b7bc31: dirstate: implement __len__ on dirstatemap 
(issue5695) (authored by swhitaker, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D884?vs=2295=2296

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -1300,6 +1300,9 @@
 def iteritems(self):
 return self._map.iteritems()
 
+def __len__(self):
+return len(self._map)
+
 def __iter__(self):
 return iter(self._map)
 



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


D884: dirstate: implement __len__ on dirstatemap (issue5695)

2017-10-01 Thread swhitaker (Simon Whitaker)
swhitaker 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/D884

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -1300,6 +1300,9 @@
 def iteritems(self):
 return self._map.iteritems()
 
+def __len__(self):
+return len(self._map)
+
 def __iter__(self):
 return iter(self._map)
 



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


[Bug 5695] New: Crash on attempting to fetch length of dirstate map

2017-10-01 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5695

Bug ID: 5695
   Summary: Crash on attempting to fetch length of dirstate map
   Product: Mercurial
   Version: 4.3-rc
  Hardware: PC
OS: Mac OS
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: swhita...@fb.com
CC: mercurial-devel@mercurial-scm.org

perftweaks._trackdirstatesizes is crashing because it (legitimately) calls
len() on dirstate._map, but the new dirstatemap class introduced in b36881c6
doesn't implement len().

hg-crew (0133ca3|remote/@) $ hg version
Mercurial Distributed SCM (version 4.3-rc+7-ec0025a85466)
Facebook Mercurial release: dev

(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2017 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
hg-crew (0133ca3|remote/@) $ hg st
Traceback (most recent call last):
  File "/Users/swhitaker/src/facebook-hg-rpms/hg-crew/mercurial/dispatch.py",
line 311, in _callcatch
return scmutil.callcatch(ui, func)
  File "/Users/swhitaker/src/facebook-hg-rpms/hg-crew/mercurial/scmutil.py",
line 151, in callcatch
return func()
  File "/Users/swhitaker/src/facebook-hg-rpms/hg-crew/mercurial/dispatch.py",
line 293, in _runcatchfunc
return _dispatch(req)
  File "/Users/swhitaker/src/facebook-hg-rpms/hg-crew/mercurial/dispatch.py",
line 929, in _dispatch
cmdpats, cmdoptions)
  File
"/Users/swhitaker/src/facebook-hg-rpms/fb-hgext/hgext3rd/fastpartialmatch.py",
line 105, in _runcommand
res = orig(lui, repo, cmd, fullargs, ui, *args, **kwargs)
  File "/Users/swhitaker/src/facebook-hg-rpms/fb-hgext/hgext3rd/undo.py", line
113, in _runcommandwrapper
result = orig(lui, repo, cmd, fullargs, *args)
  File "/Users/swhitaker/src/facebook-hg-rpms/hg-crew/hgext/journal.py", line
84, in runcommand
return orig(lui, repo, cmd, fullargs, *args)
  File
"/Users/swhitaker/src/facebook-hg-rpms/fb-hgext/fastmanifest/__init__.py", line
181, in _logonexit
r = orig(ui, repo, cmd, fullargs, *args)
  File "/Users/swhitaker/src/facebook-hg-rpms/fb-hgext/hgext3rd/perftweaks.py",
line 271, in _tracksparseprofiles
res = runcommand(lui, repo, *args)
  File "/Users/swhitaker/src/facebook-hg-rpms/fb-hgext/hgext3rd/perftweaks.py",
line 267, in _trackdirstatesizes
lui.log('dirstate_size', '', dirstate_size=len(dirstate._map))
TypeError: object of type 'dirstatemap' has no len()

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


mercurial@34406: 2 new changesets

2017-10-01 Thread Mercurial Commits
2 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/9ecc622ca23f
changeset:   34405:9ecc622ca23f
user:Kyle Lippincott 
date:Sun Oct 01 02:53:10 2017 -0700
summary: deb: install zsh completions to /usr/share/zsh/vendor-completions

https://www.mercurial-scm.org/repo/hg/rev/0133ca39c688
changeset:   34406:0133ca39c688
bookmark:@
tag: tip
user:Kyle Lippincott 
date:Sun Oct 01 03:31:32 2017 -0700
summary: deb: build and install chg

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


D865: obsmarker: crash more helpfully when metadata fields are >255 bytes (issue5681)

2017-10-01 Thread swhitaker (Simon Whitaker)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb6692ba7d5b0: obsmarker: crash more helpfully when metadata 
fields are 255bytes (issue5681) (authored by swhitaker, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D865?vs=2255=2294#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D865?vs=2255=2294

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

AFFECTED FILES
  mercurial/obsolete.py
  tests/test-obsolete-bounds-checking.t

CHANGE DETAILS

diff --git a/tests/test-obsolete-bounds-checking.t 
b/tests/test-obsolete-bounds-checking.t
new file mode 100644
--- /dev/null
+++ b/tests/test-obsolete-bounds-checking.t
@@ -0,0 +1,23 @@
+Create a repo, set the username to something more than 255 bytes, then run hg 
amend on it.
+
+  $ unset HGUSER
+  $ cat >> $HGRCPATH << EOF
+  > [ui]
+  > username = 

 
+  > [extensions]
+  > amend =
+  > [experimental]
+  > stabilization=createmarkers,exchange
+  > EOF
+  $ hg init tmpa
+  $ cd tmpa
+  $ echo a > a
+  $ hg add
+  adding a
+  $ hg commit -m "Initial commit"
+  $ echo a >> a
+  $ hg amend 2>&1 | egrep -v '^(\*\*|  )'
+  transaction abort!
+  rollback completed
+  Traceback (most recent call last):
+  mercurial.error.ProgrammingError: obsstore metadata value cannot be longer 
than 255 bytes (value 
"
 " for key "user" is 285 bytes)
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -416,6 +416,14 @@
 for key, value in metadata:
 lk = len(key)
 lv = len(value)
+if lk > 255:
+msg = ('obsstore metadata key cannot be longer than 255 bytes'
+   ' (key "%s" is %u bytes)') % (key, lk)
+raise error.ProgrammingError(msg)
+if lv > 255:
+msg = ('obsstore metadata value cannot be longer than 255 bytes'
+   ' (value "%s" for key "%s" is %u bytes)') % (value, key, lv)
+raise error.ProgrammingError(msg)
 data.append(lk)
 data.append(lv)
 totalsize += lk + lv



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


D865: obsmarker: crash more helpfully when metadata fields are >255 bytes (issue5681)

2017-10-01 Thread yuja (Yuya Nishihara)
yuja accepted this revision.
yuja added a comment.
This revision is now accepted and ready to land.


  Removed translation marker and queued, thanks.
  
  > obsmarker: crash more helpfully when metadata fields are >255 bytes 
(issue5681)
  
  s/255 bytes/255bytes/ to silence test-check-commit.t

REPOSITORY
  rHG Mercurial

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

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


mercurial@34404: 47 new changesets

2017-10-01 Thread Mercurial Commits
47 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/8cbcee0b923d
changeset:   34358:8cbcee0b923d
user:Yuya Nishihara 
date:Wed Sep 27 19:04:32 2017 +0900
summary: py3: remove use of str() in hgwebdir

https://www.mercurial-scm.org/repo/hg/rev/ee10eb665036
changeset:   34359:ee10eb665036
user:Yuya Nishihara 
date:Wed Sep 27 19:08:23 2017 +0900
summary: py3: replace str(None) with literal in convcmd.py

https://www.mercurial-scm.org/repo/hg/rev/f435097d13c9
changeset:   34360:f435097d13c9
user:Yuya Nishihara 
date:Wed Sep 27 19:11:28 2017 +0900
summary: py3: manually escape control character to be embedded in win 
filename error

https://www.mercurial-scm.org/repo/hg/rev/7508a7dc95c1
changeset:   34361:7508a7dc95c1
user:Yuya Nishihara 
date:Wed Sep 27 19:13:43 2017 +0900
summary: py3: replace bytes[n] with slicing in checkwinfilename()

https://www.mercurial-scm.org/repo/hg/rev/b76937fafe8a
changeset:   34362:b76937fafe8a
user:Yuya Nishihara 
date:Wed Sep 27 19:27:41 2017 +0900
summary: py3: work around bytes/unicode divergence in parsedate()

https://www.mercurial-scm.org/repo/hg/rev/880e47351d1a
changeset:   34363:880e47351d1a
user:Gregory Szorc 
date:Thu Sep 28 12:17:30 2017 +0200
summary: tests: add tests for clone bundles with --uncompressed

https://www.mercurial-scm.org/repo/hg/rev/ff406f3e57b2
changeset:   34364:ff406f3e57b2
user:Gregory Szorc 
date:Thu Sep 28 15:24:54 2017 +0100
summary: exchange: perform stream clone with clone bundle with 
--uncompressed

https://www.mercurial-scm.org/repo/hg/rev/cd3f39716fd3
changeset:   34365:cd3f39716fd3
user:Boris Feld 
date:Sat Sep 30 10:09:29 2017 +0100
summary: exchange: fix test for remote support of binary phases

https://www.mercurial-scm.org/repo/hg/rev/d00910b286cd
changeset:   34366:d00910b286cd
user:Yuya Nishihara 
date:Fri Sep 22 22:45:02 2017 +0900
summary: copytrace: use ctx.mutable() instead of adhoc constant of 
non-public phases

https://www.mercurial-scm.org/repo/hg/rev/f61f5af5ed31
changeset:   34367:f61f5af5ed31
parent:  34366:d00910b286cd
parent:  34354:2f427b57bf90
user:Martin von Zweigbergk 
date:Sat Sep 30 07:52:48 2017 -0700
summary: merge with stable

https://www.mercurial-scm.org/repo/hg/rev/00cf44b7baa9
changeset:   34368:00cf44b7baa9
user:Augie Fackler 
date:Fri Sep 29 11:55:26 2017 -0400
summary: bugzilla: remove superfluous pass statements

https://www.mercurial-scm.org/repo/hg/rev/5adbd3806ef7
changeset:   34369:5adbd3806ef7
user:Augie Fackler 
date:Sat Sep 30 07:42:47 2017 -0400
summary: convert: remove superfluous pass statements

https://www.mercurial-scm.org/repo/hg/rev/d0db41af73c0
changeset:   34370:d0db41af73c0
user:Augie Fackler 
date:Sat Sep 30 07:42:59 2017 -0400
summary: branchmap: remove superfluous pass statements

https://www.mercurial-scm.org/repo/hg/rev/635553ca6eb9
changeset:   34371:635553ca6eb9
user:Augie Fackler 
date:Sat Sep 30 07:43:11 2017 -0400
summary: byterange: remove superfluous pass statements

https://www.mercurial-scm.org/repo/hg/rev/2a360445afa0
changeset:   34372:2a360445afa0
user:Augie Fackler 
date:Sat Sep 30 07:43:26 2017 -0400
summary: cmdutil: remove superfluous pass statements

https://www.mercurial-scm.org/repo/hg/rev/76b334b9f45c
changeset:   34373:76b334b9f45c
user:Augie Fackler 
date:Sat Sep 30 07:43:40 2017 -0400
summary: commandserver: remove superfluous pass statements

https://www.mercurial-scm.org/repo/hg/rev/100814e14b77
changeset:   34374:100814e14b77
user:Augie Fackler 
date:Sat Sep 30 07:43:53 2017 -0400
summary: exchange: remove superfluous pass statements

https://www.mercurial-scm.org/repo/hg/rev/ebf2c1b0c70c
changeset:   34375:ebf2c1b0c70c
user:Augie Fackler 
date:Sat Sep 30 07:44:08 2017 -0400
summary: formatter: remove superfluous pass statements

https://www.mercurial-scm.org/repo/hg/rev/4741428606ed
changeset:   34376:4741428606ed
user:Augie Fackler 
date:Sat Sep 30 07:44:20 2017 -0400
summary: hgweb: remove superfluous pass statements

https://www.mercurial-scm.org/repo/hg/rev/a14642bdf364
changeset:   34377:a14642bdf364
user:Augie Fackler 
date:Sat Sep 30 07:44:34 2017 -0400
summary: localrepo: remove superfluous pass statements

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

The 'attrs' library is now available within Mercurial -- a better namedtuple

2017-10-01 Thread Siddharth Agarwal

Hi everyone --

The attrs library is now available to use within Mercurial as 
'mercurial.thirdparty.attrs'. attrs is basically a better version of 
collections.namedtuple with none of the weird semantics (e.g. you can't 
compare a tuple and an attr) and no runtime performance cost (especially 
with slots turned on).


The documentation for attrs is available at [1]. See e51c8ffa1ffa [2] 
for an example of how to use attrs.


Please feel free to send cleanup patches to move existing tuples or 
namedtuples to use attrs.


[1] http://www.attrs.org/en/stable/
[2] https://www.mercurial-scm.org/repo/hg/rev/e51c8ffa1ffa

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


D883: deb: build and install chg

2017-10-01 Thread spectral (Kyle Lippincott)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0133ca39c688: deb: build and install chg (authored by 
spectral, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D883?vs=2281=2291

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

AFFECTED FILES
  contrib/debian/rules
  tests/test-debian-packages.t

CHANGE DETAILS

diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t
--- a/tests/test-debian-packages.t
+++ b/tests/test-debian-packages.t
@@ -24,3 +24,9 @@
 zsh completions should be in the common package
   $ dpkg --contents mercurial-common_*.deb | egrep 'zsh.*[^/]$'
   * ./usr/share/zsh/vendor-completions/_hg (glob)
+chg should be installed alongside hg, in the 'mercurial' package
+  $ dpkg --contents mercurial_*.deb | egrep 'chg$'
+  * ./usr/bin/chg (glob)
+chg should come with a man page
+  $ dpkg --contents mercurial_*.deb | egrep 'man.*chg'
+  * ./usr/share/man/man1/chg.1.gz (glob)
diff --git a/contrib/debian/rules b/contrib/debian/rules
--- a/contrib/debian/rules
+++ b/contrib/debian/rules
@@ -16,6 +16,11 @@
 
 override_dh_install:
python$(PYVERS) setup.py install --root $(CURDIR)/debian/mercurial 
--install-layout=deb
+   # chg
+   make -C contrib/chg \
+   DESTDIR=$(CURDIR)/debian/mercurial \
+   PREFIX=/usr \
+   clean install
# remove arch-independent python stuff
find $(CURDIR)/debian/mercurial/usr/lib \
! -name '*.so' ! -type d -delete , \
@@ -31,6 +36,7 @@
cp contrib/hgk $(CURDIR)/debian/mercurial-common/usr/share/mercurial
mkdir -p $(CURDIR)/debian/mercurial-common/etc/mercurial/hgrc.d/
cp contrib/debian/*.rc 
$(CURDIR)/debian/mercurial-common/etc/mercurial/hgrc.d/
+   # completions
mkdir -p 
$(CURDIR)/debian/mercurial-common/usr/share/bash-completion/completions
cp contrib/bash_completion 
$(CURDIR)/debian/mercurial-common/usr/share/bash-completion/completions/hg
mkdir -p 
$(CURDIR)/debian/mercurial-common/usr/share/zsh/vendor-completions



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


D882: deb: install zsh completions to /usr/share/zsh/vendor-completions

2017-10-01 Thread spectral (Kyle Lippincott)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9ecc622ca23f: deb: install zsh completions to 
/usr/share/zsh/vendor-completions (authored by spectral, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D882?vs=2280=2290

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

AFFECTED FILES
  contrib/debian/rules
  tests/test-debian-packages.t

CHANGE DETAILS

diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t
--- a/tests/test-debian-packages.t
+++ b/tests/test-debian-packages.t
@@ -21,3 +21,6 @@
 mercurial-common should have py but no .so or pyc
   $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers.*so)'
   * ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py (glob)
+zsh completions should be in the common package
+  $ dpkg --contents mercurial-common_*.deb | egrep 'zsh.*[^/]$'
+  * ./usr/share/zsh/vendor-completions/_hg (glob)
diff --git a/contrib/debian/rules b/contrib/debian/rules
--- a/contrib/debian/rules
+++ b/contrib/debian/rules
@@ -33,4 +33,6 @@
cp contrib/debian/*.rc 
$(CURDIR)/debian/mercurial-common/etc/mercurial/hgrc.d/
mkdir -p 
$(CURDIR)/debian/mercurial-common/usr/share/bash-completion/completions
cp contrib/bash_completion 
$(CURDIR)/debian/mercurial-common/usr/share/bash-completion/completions/hg
+   mkdir -p 
$(CURDIR)/debian/mercurial-common/usr/share/zsh/vendor-completions
+   cp contrib/zsh_completion 
$(CURDIR)/debian/mercurial-common/usr/share/zsh/vendor-completions/_hg
rm $(CURDIR)/debian/mercurial-common/usr/bin/hg



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


D883: deb: build and install chg

2017-10-01 Thread yuja (Yuya Nishihara)
yuja accepted this revision.
yuja added a comment.
This revision is now accepted and ready to land.


  It's probably better to hook override_dh_auto_build, but we don't care the 
correctness
  of the Debian packaging. Queued, thanks.

REPOSITORY
  rHG Mercurial

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

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


D877: releasenotes: display release notes when no filename is specified

2017-10-01 Thread rishabhmadan96 (Rishabh Madan)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG159a6f7e09a9: releasenotes: display release notes when no 
filename is specified (authored by rishabhmadan96, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D877?vs=2263=2289#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D877?vs=2263=2289

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

AFFECTED FILES
  hgext/releasenotes.py
  tests/test-releasenotes-formatting.t

CHANGE DETAILS

diff --git a/tests/test-releasenotes-formatting.t 
b/tests/test-releasenotes-formatting.t
--- a/tests/test-releasenotes-formatting.t
+++ b/tests/test-releasenotes-formatting.t
@@ -434,3 +434,26 @@
   $ hg releasenotes -l -c
   abort: cannot use both '--list' and '--check'
   [255]
+
+Display release notes for specified revs if no file is mentioned
+
+  $ hg init relnotes-nofile
+  $ cd relnotes-nofile
+
+  $ touch fix1
+  $ hg -q commit -A -l - << EOF
+  > commit 1
+  > 
+  > .. fix:: Title of First Fix
+  > 
+  >First paragraph of fix 1.
+  > EOF
+
+  $ hg releasenote -r .
+  Bug Fixes
+  =
+  
+  Title of First Fix
+  --
+  
+  First paragraph of fix 1.
diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -576,6 +576,9 @@
 
 incoming = parsenotesfromrevisions(repo, sections.names(), revs)
 
+if file_ is None:
+return ui.write(serializenotes(sections, incoming))
+
 try:
 with open(file_, 'rb') as fh:
 notes = parsereleasenotesfile(sections, fh.read())



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


D541: effectflag: detect when diff changed

2017-10-01 Thread lothiraldan (Boris Feld)
lothiraldan marked an inline comment as done.
lothiraldan added inline comments.

INLINE COMMENTS

> martinvonz wrote in obsutil.py:370-377
> Oops, I didn't mean to drop _prepare_hunk,  I just don't like StopIteration 
> and wanted to make _getdifffiles() a generator instead and simplified a bit 
> too much. The following would probably work, but maybe StopIteration is fine 
> and should get used it :-)
> 
>   def _getdifflines(iterdiff):
>   """return a cleaned up lines"""
>   for lines in iterdiff:
>   yield _prepare_hunk(lines)
>   while True:
>   yield None
>   
>   leftiter = _getdifflines(leftdiff)
>   rightiter = _getdifflines(rightdiff)
>   while True:
>   left, right = next(leftiter), next(rightiter)
>   if (left, right) == (None, None):
>   return True
>   if left != right:
>   return False

I've updated the patch with using next with a default value, tell me if it's 
better.

REPOSITORY
  rHG Mercurial

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

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


D541: effectflag: detect when diff changed

2017-10-01 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 2287.
lothiraldan marked 2 inline comments as done.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D541?vs=2258=2287

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

AFFECTED FILES
  mercurial/obsutil.py
  tests/test-obsmarkers-effectflag.t

CHANGE DETAILS

diff --git a/tests/test-obsmarkers-effectflag.t 
b/tests/test-obsmarkers-effectflag.t
--- a/tests/test-obsmarkers-effectflag.t
+++ b/tests/test-obsmarkers-effectflag.t
@@ -93,7 +93,7 @@
 check result
 
   $ hg debugobsolete --rev .
-  ebfe0333e0d96f68a917afd97c0a0af87f1c3b5f 
75781fdbdbf58a987516b00c980bccda1e9ae588 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+  ebfe0333e0d96f68a917afd97c0a0af87f1c3b5f 
75781fdbdbf58a987516b00c980bccda1e9ae588 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '8', 'operation': 'amend', 'user': 'test'}
 
 amend with multiple effect (desc and meta)
 ---
diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -312,6 +312,7 @@
 
 DESCCHANGED = 1 << 0 # action changed the description
 METACHANGED = 1 << 1 # action change the meta
+DIFFCHANGED = 1 << 3 # action change diff introduced by the changeset
 PARENTCHANGED = 1 << 2 # action change the parent
 USERCHANGED = 1 << 4 # the user changed
 DATECHANGED = 1 << 5 # the date changed
@@ -332,6 +333,47 @@
 
 return not any(pattern.match(metakey) for pattern in METABLACKLIST)
 
+def _prepare_hunk(hunk):
+"""Drop all information but the username and patch"""
+cleanhunk = []
+for line in hunk.splitlines():
+if line.startswith(b'# User') or not line.startswith(b'#'):
+if line.startswith(b'@@'):
+line = b'@@\n'
+cleanhunk.append(line)
+return cleanhunk
+
+def _getdifflines(iterdiff):
+"""return a cleaned up lines"""
+lines = next(iterdiff, None)
+
+if lines is None:
+return lines
+
+return _prepare_hunk(lines)
+
+def _cmpdiff(leftctx, rightctx):
+"""return True if both ctx introduce the "same diff"
+
+This is a first and basic implementation, with many shortcoming.
+"""
+
+# Leftctx or right ctx might be filtered, so we need to use the contexts
+# with an unfiltered repository to safely compute the diff
+leftunfi = leftctx._repo.unfiltered()[leftctx.rev()]
+leftdiff = leftunfi.diff(git=1)
+rightunfi = rightctx._repo.unfiltered()[rightctx.rev()]
+rightdiff = rightunfi.diff(git=1)
+
+left, right = (0, 0)
+while None not in (left, right):
+left = _getdifflines(leftdiff)
+right = _getdifflines(rightdiff)
+
+if left != right:
+return False
+return True
+
 def geteffectflag(relation):
 """ From an obs-marker relation, compute what changed between the
 predecessor and the successor.
@@ -371,6 +413,10 @@
 if ctxmeta != srcmeta:
 effects |= METACHANGED
 
+# Check if the diff has changed
+if not _cmpdiff(source, changectx):
+effects |= DIFFCHANGED
+
 return effects
 
 def getobsoleted(repo, tr):



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


D542: effectflag: document effect flag

2017-10-01 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 2288.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D542?vs=2259=2288

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

AFFECTED FILES
  mercurial/obsutil.py

CHANGE DETAILS

diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -307,7 +307,21 @@
 foreground = set(repo.set('%ln::', known))
 return set(c.node() for c in foreground)
 
-# logic around storing and using effect flags
+# effectflag field
+#
+# Effect-flag is a 1-byte bit field used to store what changed between a
+# changeset and its successor(s).
+#
+# The effect flag is stored in obs-markers metadata while we iterate on the
+# information design. That's why we have the EFFECTFLAGFIELD. If we come up
+# with an incompatible design for effect flag, we can store a new design under
+# another field name so we don't break readers. We plan to extend the existing
+# obsmarkers bit-field when the effect flag design will be stabilized.
+#
+# The effect-flag is placed behind an experimental flag
+# `effect-flags` set to off by default.
+#
+
 EFFECTFLAGFIELD = "ef1"
 
 DESCCHANGED = 1 << 0 # action changed the description



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


D533: effectflag: store an empty effect flag for the moment

2017-10-01 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 2286.
lothiraldan edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D533?vs=2104=2286

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

AFFECTED FILES
  mercurial/obsolete.py
  mercurial/obsutil.py

CHANGE DETAILS

diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -305,6 +305,19 @@
 foreground = set(repo.set('%ln::', known))
 return set(c.node() for c in foreground)
 
+# logic around storing and using effect flags
+EFFECTFLAGFIELD = "ef1"
+
+def geteffectflag(relation):
+""" From an obs-marker relation, compute what changed between the
+predecessor and the successor.
+"""
+effects = 0
+
+source = relation[0]
+
+return effects
+
 def getobsoleted(repo, tr):
 """return the set of pre-existing revisions obsoleted by a transaction"""
 torev = repo.unfiltered().changelog.nodemap.get
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -1035,6 +1035,11 @@
 if useoperation and operation:
 metadata['operation'] = operation
 
+# Effect flag metadata handling
+saveeffectflag = repo.ui.configbool('experimental',
+'effect-flags',
+False)
+
 tr = repo.transaction('add-obsolescence-marker')
 try:
 markerargs = []
@@ -1058,6 +1063,13 @@
 raise error.Abort(_("changeset %s cannot obsolete itself")
   % prec)
 
+# Effect flag can be different by relation
+if saveeffectflag:
+# The effect flag is saved in a versioned field name for future
+# evolution
+effectflag = obsutil.geteffectflag(rel)
+localmetadata[obsutil.EFFECTFLAGFIELD] = "%d" % effectflag
+
 # Creating the marker causes the hidden cache to become invalid,
 # which causes recomputation when we ask for prec.parents() above.
 # Resulting in n^2 behavior.  So let's prepare all of the args



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


D872: releasenotes: add test showing TypeError with no file specified

2017-10-01 Thread yuja (Yuya Nishihara)
yuja accepted this revision.
yuja added a comment.
This revision is now accepted and ready to land.


  Folded into https://phab.mercurial-scm.org/D877 since traceback message isn't 
reproducible.

REPOSITORY
  rHG Mercurial

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

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


D878: tests: expect parsers.so in cext, parsers.py in pure (test-debian-packages)

2017-10-01 Thread spectral (Kyle Lippincott)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3d936da4f97b: tests: expect parsers.so in cext, parsers.py 
in pure (test-debian-packages) (authored by spectral, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D878?vs=2264=2282

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

AFFECTED FILES
  tests/test-debian-packages.t

CHANGE DETAILS

diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t
--- a/tests/test-debian-packages.t
+++ b/tests/test-debian-packages.t
@@ -12,12 +12,12 @@
   $ cd "$TESTDIR"/..
   $ make deb > $OUTPUTDIR/build.log 2>&1
   $ cd $OUTPUTDIR
-  $ ls *.deb
+  $ ls *.deb | grep -v 'dbg'
   mercurial-common_*.deb (glob)
   mercurial_*.deb (glob)
 main deb should have .so but no .py
   $ dpkg --contents mercurial_*.deb | egrep '(localrepo|parsers)'
-  * ./usr/lib/python2.7/dist-packages/mercurial/parsers*.so (glob)
+  * ./usr/lib/python2.7/dist-packages/mercurial/cext/parsers*.so (glob)
 mercurial-common should have py but no .so or pyc
-  $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers)'
+  $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers.*so)'
   * ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py (glob)



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


D879: tests: add "have" check for dpkg builddeps

2017-10-01 Thread spectral (Kyle Lippincott)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG13d3f8aaed87: tests: add have check for dpkg 
builddeps (authored by spectral, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D879?vs=2265=2283

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

AFFECTED FILES
  tests/hghave.py
  tests/test-debian-packages.t

CHANGE DETAILS

diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t
--- a/tests/test-debian-packages.t
+++ b/tests/test-debian-packages.t
@@ -1,4 +1,4 @@
-#require test-repo slow debhelper
+#require test-repo slow debhelper debdeps
 
   $ . "$TESTDIR/helpers-testrepo.sh"
   $ testrepohgenv
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -587,6 +587,13 @@
   br'to run debian/rules with given parameter')
 return dpkg and dh and dh_py2 and debuild
 
+@check("debdeps",
+   "debian build dependencies (run dpkg-checkbuilddeps in contrib/)")
+def has_debdeps():
+# just check exit status (ignoring output)
+path = '%s/../contrib/debian/control' % os.environ['TESTDIR']
+return matchoutput('dpkg-checkbuilddeps %s' % path, br'')
+
 @check("demandimport", "demandimport enabled")
 def has_demandimport():
 return os.environ.get('HGDEMANDIMPORT') != 'disable'



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


D875: hgweb: use parsebool for parsing diff query string options

2017-10-01 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG407ebe7a9b93: hgweb: use parsebool for parsing diff query 
string options (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D875?vs=2254=2285

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

AFFECTED FILES
  mercurial/hgweb/webcommands.py
  mercurial/hgweb/webutil.py

CHANGE DETAILS

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -177,12 +177,8 @@
 for k in ('ignorews', 'ignorewsamount', 'ignorewseol', 'ignoreblanklines'):
 v = req.form.get(k, [None])[0]
 if v is not None:
-try:
-v = bool(int(v))
-except ValueError:
-v = True
-
-setattr(diffopts, k, v)
+v = util.parsebool(v)
+setattr(diffopts, k, v if v is not None else True)
 
 return diffopts
 
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -865,9 +865,10 @@
 
 The ``ignorews``, ``ignorewsamount``, ``ignorewseol``, and
 ``ignoreblanklines`` query string arguments have the same meaning as
-their ``[annotate]`` config equivalents. A value of ``0`` sets the
-whitespace option to false. All other values are true. If not defined,
-the server default settings are used.
+their ``[annotate]`` config equivalents. It uses the hgrc boolean
+parsing logic to interpret the value. e.g. ``0`` and ``false`` are
+false and ``1`` and ``true`` are true. If not defined, the server
+default settings are used.
 
 The ``fileannotate`` template is rendered.
 """



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


D880: hgweb: remove extra

2017-10-01 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG689f6cdccef5: hgweb: remove extra /div (authored by 
indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D880?vs=2276=2284

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

AFFECTED FILES
  mercurial/templates/gitweb/map

CHANGE DETAILS

diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
--- a/mercurial/templates/gitweb/map
+++ b/mercurial/templates/gitweb/map
@@ -348,5 +348,4 @@
 
 At end of lines:
 
-  
-  '
+  '



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


D883: deb: build and install chg

2017-10-01 Thread spectral (Kyle Lippincott)
spectral 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/D883

AFFECTED FILES
  contrib/debian/rules
  tests/test-debian-packages.t

CHANGE DETAILS

diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t
--- a/tests/test-debian-packages.t
+++ b/tests/test-debian-packages.t
@@ -24,3 +24,9 @@
 zsh completions should be in the common package
   $ dpkg --contents mercurial-common_*.deb | egrep 'zsh.*[^/]$'
   * ./usr/share/zsh/vendor-completions/_hg (glob)
+chg should be installed alongside hg, in the 'mercurial' package
+  $ dpkg --contents mercurial_*.deb | egrep 'chg$'
+  * ./usr/bin/chg (glob)
+chg should come with a man page
+  $ dpkg --contents mercurial_*.deb | egrep 'man.*chg'
+  * ./usr/share/man/man1/chg.1.gz (glob)
diff --git a/contrib/debian/rules b/contrib/debian/rules
--- a/contrib/debian/rules
+++ b/contrib/debian/rules
@@ -16,6 +16,11 @@
 
 override_dh_install:
python$(PYVERS) setup.py install --root $(CURDIR)/debian/mercurial 
--install-layout=deb
+   # chg
+   make -C contrib/chg \
+   DESTDIR=$(CURDIR)/debian/mercurial \
+   PREFIX=/usr \
+   clean install
# remove arch-independent python stuff
find $(CURDIR)/debian/mercurial/usr/lib \
! -name '*.so' ! -type d -delete , \
@@ -31,6 +36,7 @@
cp contrib/hgk $(CURDIR)/debian/mercurial-common/usr/share/mercurial
mkdir -p $(CURDIR)/debian/mercurial-common/etc/mercurial/hgrc.d/
cp contrib/debian/*.rc 
$(CURDIR)/debian/mercurial-common/etc/mercurial/hgrc.d/
+   # completions
mkdir -p 
$(CURDIR)/debian/mercurial-common/usr/share/bash-completion/completions
cp contrib/bash_completion 
$(CURDIR)/debian/mercurial-common/usr/share/bash-completion/completions/hg
mkdir -p 
$(CURDIR)/debian/mercurial-common/usr/share/zsh/vendor-completions



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


D882: deb: install zsh completions to /usr/share/zsh/vendor-completions

2017-10-01 Thread spectral (Kyle Lippincott)
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This location is used by debian (and ubuntu) to store completions provided by
  other deb packages.  The default fpath appears to have this before any of the
  zsh-provided instances of the completions, so this should take precedence.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/debian/rules
  tests/test-debian-packages.t

CHANGE DETAILS

diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t
--- a/tests/test-debian-packages.t
+++ b/tests/test-debian-packages.t
@@ -21,3 +21,6 @@
 mercurial-common should have py but no .so or pyc
   $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers.*so)'
   * ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py (glob)
+zsh completions should be in the common package
+  $ dpkg --contents mercurial-common_*.deb | egrep 'zsh.*[^/]$'
+  * ./usr/share/zsh/vendor-completions/_hg (glob)
diff --git a/contrib/debian/rules b/contrib/debian/rules
--- a/contrib/debian/rules
+++ b/contrib/debian/rules
@@ -33,4 +33,6 @@
cp contrib/debian/*.rc 
$(CURDIR)/debian/mercurial-common/etc/mercurial/hgrc.d/
mkdir -p 
$(CURDIR)/debian/mercurial-common/usr/share/bash-completion/completions
cp contrib/bash_completion 
$(CURDIR)/debian/mercurial-common/usr/share/bash-completion/completions/hg
+   mkdir -p 
$(CURDIR)/debian/mercurial-common/usr/share/zsh/vendor-completions
+   cp contrib/zsh_completion 
$(CURDIR)/debian/mercurial-common/usr/share/zsh/vendor-completions/_hg
rm $(CURDIR)/debian/mercurial-common/usr/bin/hg



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


D875: hgweb: use parsebool for parsing diff query string options

2017-10-01 Thread yuja (Yuya Nishihara)
yuja accepted this revision.
yuja added inline comments.
This revision is now accepted and ready to land.

INLINE COMMENTS

> webutil.py:181
> +v = util.parsebool(v)
> +setattr(diffopts, k, v if v is not None else True)
>  

It might be better to ignore an invalid boolean, instead of falling back to 
True.

REPOSITORY
  rHG Mercurial

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

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


D541: effectflag: detect when diff changed

2017-10-01 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> lothiraldan wrote in obsutil.py:370-377
> No that doesn't work because if you rebase a changeset, context would change 
> and the diff would be detected as different, that's why we call 
> `_prepare_hunk`

Oops, I didn't mean to drop _prepare_hunk,  I just don't like StopIteration and 
wanted to make _getdifffiles() a generator instead and simplified a bit too 
much. The following would probably work, but maybe StopIteration is fine and 
should get used it :-)

  def _getdifflines(iterdiff):
  """return a cleaned up lines"""
  for lines in iterdiff:
  yield _prepare_hunk(lines)
  while True:
  yield None
  
  leftiter = _getdifflines(leftdiff)
  rightiter = _getdifflines(rightdiff)
  while True:
  left, right = next(leftiter), next(rightiter)
  if (left, right) == (None, None):
  return True
  if left != right:
  return False

REPOSITORY
  rHG Mercurial

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

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


mercurial@34357: new changeset

2017-10-01 Thread Mercurial Commits
New changeset in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/c41444a39de2
changeset:   34357:c41444a39de2
bookmark:@
tag: tip
parent:  34350:f975cb7c4dbe
user:Jun Wu 
date:Wed Sep 27 18:07:48 2017 -0700
summary: config: use copy-on-write to improve copy performance

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


D877: releasenotes: display release notes when no filename is specified

2017-10-01 Thread pulkit (Pulkit Goyal)
pulkit accepted this revision.
pulkit added a comment.


  Can you also update the doc as a follow-up as it says `parse release notes 
from commit messages into an output file` which is not always the case now.

REPOSITORY
  rHG Mercurial

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

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


D880: hgweb: remove extra

2017-10-01 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This was accidentally added in 
https://phab.mercurial-scm.org/rHG6797f1fbc6426c7ee691f3ee21610d33e4825c61.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/templates/gitweb/map

CHANGE DETAILS

diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
--- a/mercurial/templates/gitweb/map
+++ b/mercurial/templates/gitweb/map
@@ -348,5 +348,4 @@
 
 At end of lines:
 
-  
-  '
+  '



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


D850: hgweb: add HTML elements to control whitespace settings for annotate

2017-10-01 Thread yuja (Yuya Nishihara)
yuja added inline comments.

INLINE COMMENTS

> map:352
> +  
> +  '

Maybe extra ?

REPOSITORY
  rHG Mercurial

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

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


D879: tests: add "have" check for dpkg builddeps

2017-10-01 Thread spectral (Kyle Lippincott)
spectral 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/D879

AFFECTED FILES
  tests/hghave.py
  tests/test-debian-packages.t

CHANGE DETAILS

diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t
--- a/tests/test-debian-packages.t
+++ b/tests/test-debian-packages.t
@@ -1,4 +1,4 @@
-#require test-repo slow debhelper
+#require test-repo slow debhelper debdeps
 
   $ . "$TESTDIR/helpers-testrepo.sh"
   $ testrepohgenv
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -587,6 +587,13 @@
   br'to run debian/rules with given parameter')
 return dpkg and dh and dh_py2 and debuild
 
+@check("debdeps",
+   "debian build dependencies (run dpkg-checkbuilddeps in contrib/)")
+def has_debdeps():
+# just check exit status (ignoring output)
+path = '%s/../contrib/debian/control' % os.environ['TESTDIR']
+return matchoutput('dpkg-checkbuilddeps %s' % path, br'')
+
 @check("demandimport", "demandimport enabled")
 def has_demandimport():
 return os.environ.get('HGDEMANDIMPORT') != 'disable'



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


D878: tests: expect parsers.so in cext, parsers.py in pure (test-debian-packages)

2017-10-01 Thread spectral (Kyle Lippincott)
spectral 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/D878

AFFECTED FILES
  tests/test-debian-packages.t

CHANGE DETAILS

diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t
--- a/tests/test-debian-packages.t
+++ b/tests/test-debian-packages.t
@@ -12,12 +12,12 @@
   $ cd "$TESTDIR"/..
   $ make deb > $OUTPUTDIR/build.log 2>&1
   $ cd $OUTPUTDIR
-  $ ls *.deb
+  $ ls *.deb | grep -v 'dbg'
   mercurial-common_*.deb (glob)
   mercurial_*.deb (glob)
 main deb should have .so but no .py
   $ dpkg --contents mercurial_*.deb | egrep '(localrepo|parsers)'
-  * ./usr/lib/python2.7/dist-packages/mercurial/parsers*.so (glob)
+  * ./usr/lib/python2.7/dist-packages/mercurial/cext/parsers*.so (glob)
 mercurial-common should have py but no .so or pyc
-  $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers)'
+  $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers.*so)'
   * ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py (glob)



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


D877: releasenotes: display release notes when no filename is specified

2017-10-01 Thread rishabhmadan96 (Rishabh Madan)
rishabhmadan96 updated this revision to Diff 2263.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D877?vs=2261=2263

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

AFFECTED FILES
  hgext/releasenotes.py
  tests/test-releasenotes-formatting.t

CHANGE DETAILS

diff --git a/tests/test-releasenotes-formatting.t 
b/tests/test-releasenotes-formatting.t
--- a/tests/test-releasenotes-formatting.t
+++ b/tests/test-releasenotes-formatting.t
@@ -435,42 +435,25 @@
   abort: cannot use both '--list' and '--check'
   [255]
 
-Raise error when no filename is specified with --rev
+Display release notes for specified revs if no file is mentioned
 
   $ hg init relnotes-nofile
   $ cd relnotes-nofile
+
+  $ touch fix1
+  $ hg -q commit -A -l - << EOF
+  > commit 1
+  > 
+  > .. fix:: Title of First Fix
+  > 
+  >First paragraph of fix 1.
+  > EOF
+
   $ hg releasenote -r .
-  ** unknown exception encountered, please report by visiting
-  ** https://mercurial-scm.org/wiki/BugTracker
-  ** Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
-  ** Mercurial Distributed SCM (version 4.3.3+701-c4594d38b2da+20171001)
-  ** Extensions loaded: releasenotes
-  Traceback (most recent call last):
-File "/tmp/hgtests.5N93rp/install/bin/hg", line 47, in 
-  dispatch.run()
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
81, in run
-  status = (dispatch(req) or 0) & 255
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
163, in dispatch
-  ret = _runcatch(req)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
303, in _runcatch
-  return _callcatch(ui, _runcatchfunc)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
311, in _callcatch
-  return scmutil.callcatch(ui, func)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/scmutil.py", line 
151, in callcatch
-  return func()
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
293, in _runcatchfunc
-  return _dispatch(req)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
929, in _dispatch
-  cmdpats, cmdoptions)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
691, in runcommand
-  ret = _runcommand(ui, options, cmd, d)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
937, in _runcommand
-  return cmdfunc()
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
926, in 
-  d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/util.py", line 
1180, in check
-  return func(*args, **kwargs)
-File "/tmp/hgtests.5N93rp/install/lib/python/hgext/releasenotes.py", line 
580, in releasenotes
-  with open(file_, 'rb') as fh:
-  TypeError: coercing to Unicode: need string or buffer, NoneType found
-  [1]
+  Bug Fixes
+  =
+  
+  Title of First Fix
+  --
+  
+  First paragraph of fix 1.
diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -576,6 +576,9 @@
 
 incoming = parsenotesfromrevisions(repo, sections.names(), revs)
 
+if file_ is None:
+return ui.write(serializenotes(sections, incoming))
+
 try:
 with open(file_, 'rb') as fh:
 notes = parsereleasenotesfile(sections, fh.read())



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


D877: releasenotes: display release notes when no filename is specified

2017-10-01 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  Apart from the nit, the patch looks good to me.

INLINE COMMENTS

> releasenotes.py:579
>  
> +if file_==None:
> +return ui.write(serializenotes(sections, incoming))

nit: `if file is None`

REPOSITORY
  rHG Mercurial

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

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


D808: config: use copy-on-write to improve copy performance

2017-10-01 Thread yuja (Yuya Nishihara)
yuja added inline comments.

INLINE COMMENTS

> yuja wrote in config.py:180
> Perhaps we need preparewrite() here?

This won't be problem as long as we parse/read file only once per config object,
so accepted. Please send a follow up.

REPOSITORY
  rHG Mercurial

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

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


D874: hghave: check for debuild being installed as well

2017-10-01 Thread spectral (Kyle Lippincott)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG200eadbcf0b0: hghave: check for debuild being installed as 
well (authored by spectral, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D874?vs=2249=2262

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

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -581,7 +581,11 @@
  br'dh is a part of debhelper.', ignorestatus=True)
 dh_py2 = matchoutput('dh_python2 --help',
  br'other supported Python versions')
-return dpkg and dh and dh_py2
+# debuild comes from the 'devscripts' package, though you might want
+# the 'build-debs' package instead, which has a dependency on devscripts.
+debuild = matchoutput('debuild --help',
+  br'to run debian/rules with given parameter')
+return dpkg and dh and dh_py2 and debuild
 
 @check("demandimport", "demandimport enabled")
 def has_demandimport():



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


[PATCH 6 of 7] extdata: use subprocess so we don't have to chdir() manually

2017-10-01 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1506856376 -3600
#  Sun Oct 01 12:12:56 2017 +0100
# Node ID b3a36705720f5ed1e7cc5129b27450ca59c7952b
# Parent  88bc2465f1c9dd7c9a7f76eec68530b1a62f3794
extdata: use subprocess so we don't have to chdir() manually

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -13,6 +13,7 @@ import hashlib
 import os
 import re
 import socket
+import subprocess
 import weakref
 
 from .i18n import _
@@ -1038,20 +1039,18 @@ def extdatasource(repo, source):
 raise error.Abort(_("unknown extdata source '%s'") % source)
 
 data = {}
-if spec.startswith("shell:"):
-# external commands should be run relative to the repo root
-cmd = spec[6:]
-cwd = os.getcwd()
-os.chdir(repo.root)
-try:
-src = util.popen(cmd)
-finally:
-os.chdir(cwd)
-else:
-# treat as a URL or file
-src = url.open(repo.ui, spec)
-
+src = proc = None
 try:
+if spec.startswith("shell:"):
+# external commands should be run relative to the repo root
+cmd = spec[6:]
+proc = subprocess.Popen(cmd, shell=True, bufsize=-1,
+close_fds=util.closefds,
+stdout=subprocess.PIPE, cwd=repo.root)
+src = proc.stdout
+else:
+# treat as a URL or file
+src = url.open(repo.ui, spec)
 for l in src:
 if " " in l:
 k, v = l.strip().split(" ", 1)
@@ -1064,7 +1063,10 @@ def extdatasource(repo, source):
 except (error.LookupError, error.RepoLookupError):
 pass # we ignore data for nodes that don't exist locally
 finally:
-src.close()
+if proc:
+proc.communicate()
+if src:
+src.close()
 
 return data
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 3 of 7] templater: add experimental support for extdata

2017-10-01 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1506852789 -3600
#  Sun Oct 01 11:13:09 2017 +0100
# Node ID 2b81a9a4752373722a9a568c7031dcf53171cc6b
# Parent  2c9054ec242d781c0bda1d0d0ab0b26b5b93f012
templater: add experimental support for extdata

This is minimal and non-controversial implementation of extdata() template
function. Originally extdata sources were exposed to the keyword namespace,
but I've changed it to a plain function for simplicity.

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -24,6 +24,7 @@ from . import (
 registrar,
 revset as revsetmod,
 revsetlang,
+scmutil,
 templatefilters,
 templatekw,
 util,
@@ -629,6 +630,22 @@ def diff(context, mapping, args):
 
 return ''.join(chunks)
 
+@templatefunc('extdata(source)', argspec='source')
+def extdata(context, mapping, args):
+"""Show a text read from the specified extdata source. (EXPERIMENTAL)"""
+if 'source' not in args:
+# i18n: "extdata" is a keyword
+raise error.ParseError(_('extdata expects one argument'))
+
+source = evalstring(context, mapping, args['source'])
+cache = mapping['cache'].setdefault('extdata', {})
+ctx = mapping['ctx']
+if source in cache:
+data = cache[source]
+else:
+data = cache[source] = scmutil.extdatasource(ctx.repo(), source)
+return data.get(ctx.rev(), '')
+
 @templatefunc('files(pattern)')
 def files(context, mapping, args):
 """All files of the current changeset matching the pattern. See
diff --git a/tests/test-extdata.t b/tests/test-extdata.t
--- a/tests/test-extdata.t
+++ b/tests/test-extdata.t
@@ -10,12 +10,19 @@ test revset support
   $ cat <<'EOF' >> .hg/hgrc
   > [extdata]
   > filedata = file:extdata.txt
+  > notes = notes.txt
   > shelldata = shell:cat extdata.txt | grep 2
   > EOF
   $ cat <<'EOF' > extdata.txt
-  > 2
+  > 2 another comment on 2
   > 3
   > EOF
+  $ cat <<'EOF' > notes.txt
+  > f6ed this change is great!
+  > e834 this is buggy :(
+  > 0625 first post
+  > bogusnode gives no error
+  > EOF
 
   $ hg log -qr "extdata(filedata)"
   2:f6ed99a58333
@@ -43,6 +50,31 @@ test bad extdata() revset source
   abort: unknown extdata source 'unknown'
   [255]
 
+test template support:
+
+  $ hg log -r:3 -T "{node|short}{if(extdata('notes'), ' # 
{extdata('notes')}')}\n"
+  06254b906311 # first post
+  e8342c9a2ed1 # this is buggy :(
+  f6ed99a58333 # this change is great!
+  9de260b1e88e
+
+test template cache:
+
+  $ hg log -r:3 -T '{rev} "{extdata("notes")}" "{extdata("shelldata")}"\n'
+  0 "first post" ""
+  1 "this is buggy :(" ""
+  2 "this change is great!" "another comment on 2"
+  3 "" ""
+
+test bad extdata() template source
+
+  $ hg log -T "{extdata()}\n"
+  hg: parse error: extdata expects one argument
+  [255]
+  $ hg log -T "{extdata('unknown')}\n"
+  abort: unknown extdata source 'unknown'
+  [255]
+
 we don't fix up relative file URLs, but we do run shell commands in repo root
 
   $ mkdir sub
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 7] revset: add experimental support for extdata

2017-10-01 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1506851400 -3600
#  Sun Oct 01 10:50:00 2017 +0100
# Node ID 2c9054ec242d781c0bda1d0d0ab0b26b5b93f012
# Parent  4bcad24c850624811d6f4d1aa6d982c01270d2fd
revset: add experimental support for extdata

This is minimal and non-controversial implementation of extdata() revset.
Originally extdata sources were exposed to the symbol namespace, but I've
changed it to a plain function for simplicity.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -786,6 +786,17 @@ def contentdivergent(repo, subset, x):
 contentdivergent = obsmod.getrevs(repo, 'contentdivergent')
 return subset & contentdivergent
 
+@predicate('extdata(source)', safe=False, weight=100)
+def extdata(repo, subset, x):
+"""Changesets in the specified extdata source. (EXPERIMENTAL)"""
+# i18n: "extdata" is a keyword
+args = getargsdict(x, 'extdata', 'source')
+source = getstring(args.get('source'),
+   # i18n: "extdata" is a keyword
+   _('extdata takes at least 1 string argument'))
+data = scmutil.extdatasource(repo, source)
+return subset & baseset(data)
+
 @predicate('extinct()', safe=True)
 def extinct(repo, subset, x):
 """Obsolete changesets with obsolete descendants only.
diff --git a/tests/test-extdata.t b/tests/test-extdata.t
new file mode 100644
--- /dev/null
+++ b/tests/test-extdata.t
@@ -0,0 +1,56 @@
+  $ hg init repo
+  $ cd repo
+  $ for n in 0 1 2 3; do
+  >   echo $n > $n
+  >   hg ci -qAm $n
+  > done
+
+test revset support
+
+  $ cat <<'EOF' >> .hg/hgrc
+  > [extdata]
+  > filedata = file:extdata.txt
+  > shelldata = shell:cat extdata.txt | grep 2
+  > EOF
+  $ cat <<'EOF' > extdata.txt
+  > 2
+  > 3
+  > EOF
+
+  $ hg log -qr "extdata(filedata)"
+  2:f6ed99a58333
+  3:9de260b1e88e
+  $ hg log -qr "extdata(shelldata)"
+  2:f6ed99a58333
+
+test weight of extdata() revset
+
+  $ hg debugrevspec -p optimized "extdata(filedata) & 3"
+  * optimized:
+  (andsmally
+(func
+  (symbol 'extdata')
+  (symbol 'filedata'))
+(symbol '3'))
+  3
+
+test bad extdata() revset source
+
+  $ hg log -qr "extdata()"
+  hg: parse error: extdata takes at least 1 string argument
+  [255]
+  $ hg log -qr "extdata(unknown)"
+  abort: unknown extdata source 'unknown'
+  [255]
+
+we don't fix up relative file URLs, but we do run shell commands in repo root
+
+  $ mkdir sub
+  $ cd sub
+  $ hg log -qr "extdata(filedata)"
+  abort: error: No such file or directory
+  [255]
+  $ hg log -qr "extdata(shelldata)"
+  2:f6ed99a58333
+
+  $ cd ..
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 7] extdata: add extdatasource reader

2017-10-01 Thread Yuya Nishihara
# HG changeset patch
# User Matt Mackall 
# Date 1473794045 18000
#  Tue Sep 13 14:14:05 2016 -0500
# Node ID 4bcad24c850624811d6f4d1aa6d982c01270d2fd
# Parent  8a89dfa01997bb3dd9e89aa167f2b28ed865e9fc
extdata: add extdatasource reader

This adds basic support for extdata, a way to add external data
sources for revsets and templates. An extdata data source is simply a
list of lines of the form:

[]\n

An extdata source is configured thusly:

[extdata]
name = 

urls of the form shell: are launch shell commands to generate data.

This patch is slightly modified by Yuya Nishihara as follows:

 - fix typo
 - remove unused function
 - remove future expansion point for parameter (which can be added later
   as the extdata revset/template are experimental)

You can see the original patch at
https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-September/088426.html

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -35,6 +35,7 @@ from . import (
 pycompat,
 revsetlang,
 similar,
+url,
 util,
 )
 
@@ -1016,6 +1017,56 @@ class filecache(object):
 except KeyError:
 raise AttributeError(self.name)
 
+def extdatasource(repo, source):
+"""Gather a map of rev -> value dict from the specified source
+
+A source spec is treated as a URL, with a special case shell: type
+for parsing the output from a shell command.
+
+The data is parsed as a series of newline-separated records where
+each record is a revision specifier optionally followed by a space
+and a freeform string value. If the revision is known locally, it
+is converted to a rev, otherwise the record is skipped.
+
+Note that both key and value are treated as UTF-8 and converted to
+the local encoding. This allows uniformity between local and
+remote data sources.
+"""
+
+spec = repo.ui.config("extdata", source)
+if not spec:
+raise error.Abort(_("unknown extdata source '%s'") % source)
+
+data = {}
+if spec.startswith("shell:"):
+# external commands should be run relative to the repo root
+cmd = spec[6:]
+cwd = os.getcwd()
+os.chdir(repo.root)
+try:
+src = util.popen(cmd)
+finally:
+os.chdir(cwd)
+else:
+# treat as a URL or file
+src = url.open(repo.ui, spec)
+
+try:
+for l in src.readlines():
+if " " in l:
+k, v = l.strip().split(" ", 1)
+else:
+k, v = l.strip(), ""
+
+k = encoding.tolocal(k)
+if k in repo:
+# we ignore data for nodes that don't exist locally
+data[repo[k].rev()] = encoding.tolocal(v)
+finally:
+src.close()
+
+return data
+
 def _locksub(repo, lock, envvar, cmd, environ=None, *args, **kwargs):
 if lock is None:
 raise error.LockInheritanceContractViolation(
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 7 of 7] extdata: abort if external command exits with non-zero status

2017-10-01 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1506856910 -3600
#  Sun Oct 01 12:21:50 2017 +0100
# Node ID 86c51cf6c4ff8a9a01e34e365c8fbc50415d072e
# Parent  b3a36705720f5ed1e7cc5129b27450ca59c7952b
extdata: abort if external command exits with non-zero status

It could be a warning, but a warning in template output would be unreadable.

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1039,7 +1039,7 @@ def extdatasource(repo, source):
 raise error.Abort(_("unknown extdata source '%s'") % source)
 
 data = {}
-src = proc = None
+src = proc = err = None
 try:
 if spec.startswith("shell:"):
 # external commands should be run relative to the repo root
@@ -1065,8 +1065,13 @@ def extdatasource(repo, source):
 finally:
 if proc:
 proc.communicate()
+if proc.returncode != 0:
+err = (_("extdata command '%s' failed: %s")
+   % (cmd, util.explainexit(proc.returncode)[0]))
 if src:
 src.close()
+if err:
+raise error.Abort(err)
 
 return data
 
diff --git a/tests/test-extdata.t b/tests/test-extdata.t
--- a/tests/test-extdata.t
+++ b/tests/test-extdata.t
@@ -12,6 +12,7 @@ test revset support
   > filedata = file:extdata.txt
   > notes = notes.txt
   > shelldata = shell:cat extdata.txt | grep 2
+  > fail = shell:false
   > EOF
   $ cat <<'EOF' > extdata.txt
   > 2 another comment on 2
@@ -50,6 +51,9 @@ test bad extdata() revset source
   $ hg log -qr "extdata(unknown)"
   abort: unknown extdata source 'unknown'
   [255]
+  $ hg log -qr "extdata(fail)"
+  abort: extdata command 'false' failed: exited with status 1
+  [255]
 
 test template support:
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 4 of 7] extdata: ignore ambiguous identifier as well

2017-10-01 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1506855401 -3600
#  Sun Oct 01 11:56:41 2017 +0100
# Node ID 18b0ae593fb5f391878567cd0f676c623847614e
# Parent  2b81a9a4752373722a9a568c7031dcf53171cc6b
extdata: ignore ambiguous identifier as well

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1059,9 +1059,10 @@ def extdatasource(repo, source):
 k, v = l.strip(), ""
 
 k = encoding.tolocal(k)
-if k in repo:
-# we ignore data for nodes that don't exist locally
+try:
 data[repo[k].rev()] = encoding.tolocal(v)
+except (error.LookupError, error.RepoLookupError):
+pass # we ignore data for nodes that don't exist locally
 finally:
 src.close()
 
diff --git a/tests/test-extdata.t b/tests/test-extdata.t
--- a/tests/test-extdata.t
+++ b/tests/test-extdata.t
@@ -1,6 +1,6 @@
   $ hg init repo
   $ cd repo
-  $ for n in 0 1 2 3; do
+  $ for n in 0 1 2 3 4 5 6 7 8 9 10 11; do
   >   echo $n > $n
   >   hg ci -qAm $n
   > done
@@ -22,6 +22,7 @@ test revset support
   > e834 this is buggy :(
   > 0625 first post
   > bogusnode gives no error
+  > a ambiguous node gives no error
   > EOF
 
   $ hg log -qr "extdata(filedata)"
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 5 of 7] extdata: just use iterator to read lines one by one

2017-10-01 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1506855507 -3600
#  Sun Oct 01 11:58:27 2017 +0100
# Node ID 88bc2465f1c9dd7c9a7f76eec68530b1a62f3794
# Parent  18b0ae593fb5f391878567cd0f676c623847614e
extdata: just use iterator to read lines one by one

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1052,7 +1052,7 @@ def extdatasource(repo, source):
 src = url.open(repo.ui, spec)
 
 try:
-for l in src.readlines():
+for l in src:
 if " " in l:
 k, v = l.strip().split(" ", 1)
 else:
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D877: releasenotes: display release notes when no filename is specified

2017-10-01 Thread rishabhmadan96 (Rishabh Madan)
rishabhmadan96 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  If the filename is not specified while using --rev, the notes for the 
specified
  revs will just be displayed on screen.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/releasenotes.py
  tests/test-releasenotes-formatting.t

CHANGE DETAILS

diff --git a/tests/test-releasenotes-formatting.t 
b/tests/test-releasenotes-formatting.t
--- a/tests/test-releasenotes-formatting.t
+++ b/tests/test-releasenotes-formatting.t
@@ -435,42 +435,25 @@
   abort: cannot use both '--list' and '--check'
   [255]
 
-Raise error when no filename is specified with --rev
+Display release notes for specified revs if no file is mentioned
 
   $ hg init relnotes-nofile
   $ cd relnotes-nofile
+
+  $ touch fix1
+  $ hg -q commit -A -l - << EOF
+  > commit 1
+  > 
+  > .. fix:: Title of First Fix
+  > 
+  >First paragraph of fix 1.
+  > EOF
+
   $ hg releasenote -r .
-  ** unknown exception encountered, please report by visiting
-  ** https://mercurial-scm.org/wiki/BugTracker
-  ** Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
-  ** Mercurial Distributed SCM (version 4.3.3+701-c4594d38b2da+20171001)
-  ** Extensions loaded: releasenotes
-  Traceback (most recent call last):
-File "/tmp/hgtests.5N93rp/install/bin/hg", line 47, in 
-  dispatch.run()
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
81, in run
-  status = (dispatch(req) or 0) & 255
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
163, in dispatch
-  ret = _runcatch(req)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
303, in _runcatch
-  return _callcatch(ui, _runcatchfunc)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
311, in _callcatch
-  return scmutil.callcatch(ui, func)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/scmutil.py", line 
151, in callcatch
-  return func()
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
293, in _runcatchfunc
-  return _dispatch(req)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
929, in _dispatch
-  cmdpats, cmdoptions)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
691, in runcommand
-  ret = _runcommand(ui, options, cmd, d)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
937, in _runcommand
-  return cmdfunc()
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
926, in 
-  d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/util.py", line 
1180, in check
-  return func(*args, **kwargs)
-File "/tmp/hgtests.5N93rp/install/lib/python/hgext/releasenotes.py", line 
580, in releasenotes
-  with open(file_, 'rb') as fh:
-  TypeError: coercing to Unicode: need string or buffer, NoneType found
-  [1]
+  Bug Fixes
+  =
+  
+  Title of First Fix
+  --
+  
+  First paragraph of fix 1.
diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -576,6 +576,9 @@
 
 incoming = parsenotesfromrevisions(repo, sections.names(), revs)
 
+if file_==None:
+return ui.write(serializenotes(sections, incoming))
+
 try:
 with open(file_, 'rb') as fh:
 notes = parsereleasenotesfile(sections, fh.read())



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


D541: effectflag: detect when diff changed

2017-10-01 Thread lothiraldan (Boris Feld)
lothiraldan marked 3 inline comments as done.
lothiraldan added inline comments.

INLINE COMMENTS

> martinvonz wrote in obsutil.py:360
> I see this as an argument against storing it in the obsmarker. Can we remove 
> all shortcomings before it's no longer experimental?
> 
> But, as I said before, the feature is experimental, so we have some time to 
> decide whether to calculate it at obsmarker creation time or on the fly 
> (possibly with caching).

Yes we should be able to remove all shortcomings before it's no longer 
experimental. I think we should have this diff of diff algorithm somewhere else 
in core, I think they would be other users of the algorithm, maybe phabsend?

> martinvonz wrote in obsutil.py:370-377
> I haven't tested this, but I think the following would remove the need for 
> _getdifflines():
> 
>   leftiter = itertools.chain(leftdiff, itertools.repeat(None))
>   rightiter = itertools.chain(rightdiff, itertools.repeat(None))
>   while True:
>   left, right = next(leftiter), next(rightiter)
>   if left is None and right is None:
>   return True
>   if left != right:
>   return False

No that doesn't work because if you rebase a changeset, context would change 
and the diff would be detected as different, that's why we call `_prepare_hunk`

REPOSITORY
  rHG Mercurial

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

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


D865: obsmarker: fix crash when metadata fields are >255 bytes (issue5681)

2017-10-01 Thread ikostia (Kostia Balytskyi)
ikostia accepted this revision.
ikostia added a comment.


  LGTM

REPOSITORY
  rHG Mercurial

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

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


D542: effectflag: document effect flag

2017-10-01 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 2259.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D542?vs=2113=2259

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

AFFECTED FILES
  mercurial/obsutil.py

CHANGE DETAILS

diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -307,7 +307,21 @@
 foreground = set(repo.set('%ln::', known))
 return set(c.node() for c in foreground)
 
-# logic around storing and using effect flags
+# effectflag field
+#
+# Effect-flag is a 1-byte bit field used to store what changed between a
+# changeset and its successor(s).
+#
+# The effect flag is stored in obs-markers metadata while we iterate on the
+# information design. That's why we have the EFFECTFLAGFIELD. If we come up
+# with an incompatible design for effect flag, we can store a new design under
+# another field name so we don't break readers. We plan to extend the existing
+# obsmarkers bit-field when the effect flag design will be stabilized.
+#
+# The effect-flag is placed behind an experimental flag
+# `effect-flags` set to off by default.
+#
+
 EFFECTFLAGFIELD = "ef1"
 
 DESCCHANGED = 1 << 0 # action changed the description



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


D540: effectflag: detect when meta changed

2017-10-01 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 2257.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D540?vs=2111=2257

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

AFFECTED FILES
  mercurial/obsutil.py
  tests/test-obsmarkers-effectflag.t

CHANGE DETAILS

diff --git a/tests/test-obsmarkers-effectflag.t 
b/tests/test-obsmarkers-effectflag.t
--- a/tests/test-obsmarkers-effectflag.t
+++ b/tests/test-obsmarkers-effectflag.t
@@ -164,4 +164,4 @@
 check result
 
   $ hg debugobsolete -r .
-  2f599e54c1c6974299065cdf54e1ad640bfb7b5d 
12c6238b5e371eea00fd2013b12edce3f070928b 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '0', 'operation': 'amend', 'user': 'test'}
+  2f599e54c1c6974299065cdf54e1ad640bfb7b5d 
12c6238b5e371eea00fd2013b12edce3f070928b 0 (Thu Jan 01 00:00:00 1970 +) 
{'ef1': '2', 'operation': 'amend', 'user': 'test'}
diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -7,6 +7,8 @@
 
 from __future__ import absolute_import
 
+import re
+
 from . import (
 phases,
 util
@@ -309,11 +311,27 @@
 EFFECTFLAGFIELD = "ef1"
 
 DESCCHANGED = 1 << 0 # action changed the description
+METACHANGED = 1 << 1 # action change the meta
 PARENTCHANGED = 1 << 2 # action change the parent
 USERCHANGED = 1 << 4 # the user changed
 DATECHANGED = 1 << 5 # the date changed
 BRANCHCHANGED = 1 << 6 # the branch changed
 
+METABLACKLIST = [
+re.compile('^branch$'),
+re.compile('^.*-source$'),
+re.compile('^.*_source$'),
+re.compile('^source$'),
+]
+
+def metanotblacklisted(metaitem):
+""" Check that the key of a meta item (extrakey, extravalue) does not
+match at least one of the blacklist pattern
+"""
+metakey = metaitem[0]
+
+return not any(pattern.match(metakey) for pattern in METABLACKLIST)
+
 def geteffectflag(relation):
 """ From an obs-marker relation, compute what changed between the
 predecessor and the successor.
@@ -343,6 +361,16 @@
 if changectx.parents() != source.parents():
 effects |= PARENTCHANGED
 
+# Check if other meta has changed
+changeextra = changectx.extra().items()
+ctxmeta = filter(metanotblacklisted, changeextra)
+
+sourceextra = source.extra().items()
+srcmeta = filter(metanotblacklisted, sourceextra)
+
+if ctxmeta != srcmeta:
+effects |= METACHANGED
+
 return effects
 
 def getobsoleted(repo, tr):



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


D532: obsolete: clean createmarkers part about operation

2017-10-01 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 2256.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D532?vs=2233=2256

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

AFFECTED FILES
  mercurial/obsolete.py

CHANGE DETAILS

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -1029,10 +1029,13 @@
 metadata = {}
 if 'user' not in metadata:
 metadata['user'] = repo.ui.username()
+
+# Operation metadata handling
 useoperation = repo.ui.configbool('experimental',
 'stabilization.track-operation')
 if useoperation and operation:
 metadata['operation'] = operation
+
 tr = repo.transaction('add-obsolescence-marker')
 try:
 markerargs = []



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


D865: obsmarker: fix crash when metadata fields are >255 bytes (issue5681)

2017-10-01 Thread swhitaker (Simon Whitaker)
swhitaker updated this revision to Diff 2255.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D865?vs=2229=2255

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

AFFECTED FILES
  mercurial/obsolete.py
  tests/test-obsolete-bounds-checking.t

CHANGE DETAILS

diff --git a/tests/test-obsolete-bounds-checking.t 
b/tests/test-obsolete-bounds-checking.t
new file mode 100644
--- /dev/null
+++ b/tests/test-obsolete-bounds-checking.t
@@ -0,0 +1,23 @@
+Create a repo, set the username to something more than 255 bytes, then run hg 
amend on it.
+
+  $ unset HGUSER
+  $ cat >> $HGRCPATH << EOF
+  > [ui]
+  > username = 

 
+  > [extensions]
+  > amend =
+  > [experimental]
+  > stabilization=createmarkers,exchange
+  > EOF
+  $ hg init tmpa
+  $ cd tmpa
+  $ echo a > a
+  $ hg add
+  adding a
+  $ hg commit -m "Initial commit"
+  $ echo a >> a
+  $ hg amend 2>&1 | egrep -v '^(\*\*|  )'
+  transaction abort!
+  rollback completed
+  Traceback (most recent call last):
+  mercurial.error.ProgrammingError: obsstore metadata value cannot be longer 
than 255 bytes (value 
"
 " for key "user" is 285 bytes)
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -416,6 +416,14 @@
 for key, value in metadata:
 lk = len(key)
 lv = len(value)
+if lk > 255:
+msg = _('obsstore metadata key cannot be longer than 255 bytes'
+' (key "%s" is %u bytes)') % (key, lk)
+raise error.ProgrammingError(msg)
+if lv > 255:
+msg = _('obsstore metadata value cannot be longer than 255 bytes'
+' (value "%s" for key "%s" is %u bytes)') % (value, key, lv)
+raise error.ProgrammingError(msg)
 data.append(lk)
 data.append(lv)
 totalsize += lk + lv



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


D875: hgweb: use parsebool for parsing diff query string options

2017-10-01 Thread indygreg (Gregory Szorc)
indygreg 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/D875

AFFECTED FILES
  mercurial/hgweb/webcommands.py
  mercurial/hgweb/webutil.py

CHANGE DETAILS

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -177,12 +177,8 @@
 for k in ('ignorews', 'ignorewsamount', 'ignorewseol', 'ignoreblanklines'):
 v = req.form.get(k, [None])[0]
 if v is not None:
-try:
-v = bool(int(v))
-except ValueError:
-v = True
-
-setattr(diffopts, k, v)
+v = util.parsebool(v)
+setattr(diffopts, k, v if v is not None else True)
 
 return diffopts
 
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -865,9 +865,10 @@
 
 The ``ignorews``, ``ignorewsamount``, ``ignorewseol``, and
 ``ignoreblanklines`` query string arguments have the same meaning as
-their ``[annotate]`` config equivalents. A value of ``0`` sets the
-whitespace option to false. All other values are true. If not defined,
-the server default settings are used.
+their ``[annotate]`` config equivalents. It uses the hgrc boolean
+parsing logic to interpret the value. e.g. ``0`` and ``false`` are
+false and ``1`` and ``true`` are true. If not defined, the server
+default settings are used.
 
 The ``fileannotate`` template is rendered.
 """



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


D873: releasenotes: raise error when no filename specified

2017-10-01 Thread rishabhmadan96 (Rishabh Madan)
rishabhmadan96 added a comment.


  In https://phab.mercurial-scm.org/D873#14703, @pulkit wrote:
  
  > Can't we just output the releasenotes using ui.write() if no file name is 
specified. I sometimes wanted to check what releasenotes my commit will produce 
and I needed to mention a file.
  
  
  Seems to be a good idea :). Maybe we can close this one and I'll just send a 
new patch right away.

REPOSITORY
  rHG Mercurial

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

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


D867: thirdparty: vendor attrs

2017-10-01 Thread sid0 (Siddharth Agarwal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG765eb17a7eb8: thirdparty: vendor attrs (authored by sid0, 
committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D867?vs=2244=2253

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

AFFECTED FILES
  mercurial/thirdparty/__init__.py
  mercurial/thirdparty/attr/LICENSE.txt
  mercurial/thirdparty/attr/__init__.py
  mercurial/thirdparty/attr/_compat.py
  mercurial/thirdparty/attr/_config.py
  mercurial/thirdparty/attr/_funcs.py
  mercurial/thirdparty/attr/_make.py
  mercurial/thirdparty/attr/converters.py
  mercurial/thirdparty/attr/exceptions.py
  mercurial/thirdparty/attr/filters.py
  mercurial/thirdparty/attr/validators.py
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -709,6 +709,8 @@
 'mercurial.hgweb',
 'mercurial.httpclient',
 'mercurial.pure',
+'mercurial.thirdparty',
+'mercurial.thirdparty.attr',
 'hgext', 'hgext.convert', 'hgext.fsmonitor',
 'hgext.fsmonitor.pywatchman', 'hgext.highlight',
 'hgext.largefiles', 'hgext.zeroconf', 'hgext3rd',
diff --git a/mercurial/thirdparty/attr/validators.py 
b/mercurial/thirdparty/attr/validators.py
new file mode 100644
--- /dev/null
+++ b/mercurial/thirdparty/attr/validators.py
@@ -0,0 +1,166 @@
+"""
+Commonly useful validators.
+"""
+
+from __future__ import absolute_import, division, print_function
+
+from ._make import attr, attributes, and_, _AndValidator
+
+
+__all__ = [
+"and_",
+"in_",
+"instance_of",
+"optional",
+"provides",
+]
+
+
+@attributes(repr=False, slots=True, hash=True)
+class _InstanceOfValidator(object):
+type = attr()
+
+def __call__(self, inst, attr, value):
+"""
+We use a callable class to be able to change the ``__repr__``.
+"""
+if not isinstance(value, self.type):
+raise TypeError(
+"'{name}' must be {type!r} (got {value!r} that is a "
+"{actual!r})."
+.format(name=attr.name, type=self.type,
+actual=value.__class__, value=value),
+attr, self.type, value,
+)
+
+def __repr__(self):
+return (
+""
+.format(type=self.type)
+)
+
+
+def instance_of(type):
+"""
+A validator that raises a :exc:`TypeError` if the initializer is called
+with a wrong type for this particular attribute (checks are perfomed using
+:func:`isinstance` therefore it's also valid to pass a tuple of types).
+
+:param type: The type to check for.
+:type type: type or tuple of types
+
+:raises TypeError: With a human readable error message, the attribute
+(of type :class:`attr.Attribute`), the expected type, and the value it
+got.
+"""
+return _InstanceOfValidator(type)
+
+
+@attributes(repr=False, slots=True, hash=True)
+class _ProvidesValidator(object):
+interface = attr()
+
+def __call__(self, inst, attr, value):
+"""
+We use a callable class to be able to change the ``__repr__``.
+"""
+if not self.interface.providedBy(value):
+raise TypeError(
+"'{name}' must provide {interface!r} which {value!r} "
+"doesn't."
+.format(name=attr.name, interface=self.interface, value=value),
+attr, self.interface, value,
+)
+
+def __repr__(self):
+return (
+""
+.format(interface=self.interface)
+)
+
+
+def provides(interface):
+"""
+A validator that raises a :exc:`TypeError` if the initializer is called
+with an object that does not provide the requested *interface* (checks are
+performed using ``interface.providedBy(value)`` (see `zope.interface
+`_).
+
+:param zope.interface.Interface interface: The interface to check for.
+
+:raises TypeError: With a human readable error message, the attribute
+(of type :class:`attr.Attribute`), the expected interface, and the
+value it got.
+"""
+return _ProvidesValidator(interface)
+
+
+@attributes(repr=False, slots=True, hash=True)
+class _OptionalValidator(object):
+validator = attr()
+
+def __call__(self, inst, attr, value):
+if value is None:
+return
+
+self.validator(inst, attr, value)
+
+def __repr__(self):
+return (
+""
+.format(what=repr(self.validator))
+)
+
+
+def optional(validator):
+"""
+A validator that makes an attribute optional.  An optional attribute is one
+which can be set to ``None`` in addition to satisfying the requirements of
+the sub-validator.
+
+:param validator: A validator (or a list of validators) that is 

D871: python3: don't byte mangle third-party packages

2017-10-01 Thread sid0 (Siddharth Agarwal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9fb9f8440b71: python3: dont byte mangle third-party 
packages (authored by sid0, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D871?vs=2246=2251

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

AFFECTED FILES
  mercurial/__init__.py

CHANGE DETAILS

diff --git a/mercurial/__init__.py b/mercurial/__init__.py
--- a/mercurial/__init__.py
+++ b/mercurial/__init__.py
@@ -34,6 +34,9 @@
 # selectors2 is already dual-version clean, don't try and mangle it
 if fullname.startswith('mercurial.selectors2'):
 return None
+# third-party packages are expected to be dual-version clean
+if fullname.startswith('mercurial.thirdparty'):
+return None
 # zstd is already dual-version clean, don't try and mangle it
 if fullname.startswith('mercurial.zstd'):
 return None



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


D868: changelog: use attrs instead of namedtuple

2017-10-01 Thread sid0 (Siddharth Agarwal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe51c8ffa1ffa: changelog: use attrs instead of namedtuple 
(authored by sid0, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D868?vs=2232=2252#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D868?vs=2232=2252

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

AFFECTED FILES
  mercurial/changelog.py

CHANGE DETAILS

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -7,14 +7,15 @@
 
 from __future__ import absolute_import
 
-import collections
-
 from .i18n import _
 from .node import (
 bin,
 hex,
 nullid,
 )
+from .thirdparty import (
+attr,
+)
 
 from . import (
 encoding,
@@ -142,10 +143,16 @@
 return appender(opener, name, mode, buf)
 return _delay
 
-_changelogrevision = collections.namedtuple(u'changelogrevision',
-(u'manifest', u'user', u'date',
- u'files', u'description',
- u'extra'))
+@attr.s
+class _changelogrevision(object):
+# Extensions might modify _defaultextra, so let the constructor below pass
+# it in
+extra = attr.ib()
+manifest = attr.ib(default=nullid)
+user = attr.ib(default='')
+date = attr.ib(default=(0, 0))
+files = attr.ib(default=[])
+description = attr.ib(default='')
 
 class changelogrevision(object):
 """Holds results of a parsed changelog revision.
@@ -162,14 +169,7 @@
 
 def __new__(cls, text):
 if not text:
-return _changelogrevision(
-manifest=nullid,
-user='',
-date=(0, 0),
-files=[],
-description='',
-extra=_defaultextra,
-)
+return _changelogrevision(extra=_defaultextra)
 
 self = super(changelogrevision, cls).__new__(cls)
 # We could return here and implement the following as an __init__.



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


D866: tests: disable lints on mercurial/thirdparty

2017-10-01 Thread sid0 (Siddharth Agarwal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG41401f502c83: tests: disable lints on mercurial/thirdparty 
(authored by sid0, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D866?vs=2230=2250

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

AFFECTED FILES
  contrib/import-checker.py
  tests/test-check-code.t
  tests/test-check-module-imports.t
  tests/test-check-pylint.t

CHANGE DETAILS

diff --git a/tests/test-check-pylint.t b/tests/test-check-pylint.t
--- a/tests/test-check-pylint.t
+++ b/tests/test-check-pylint.t
@@ -12,6 +12,7 @@
   $ touch $TESTTMP/fakerc
   $ pylint --rcfile=$TESTTMP/fakerc --disable=all \
   >   --enable=W0102 --reports=no \
+  >   --ignore=thirdparty \
   >   mercurial hgdemandimport hgext hgext3rd
(?)
    (?)
diff --git a/tests/test-check-module-imports.t 
b/tests/test-check-module-imports.t
--- a/tests/test-check-module-imports.t
+++ b/tests/test-check-module-imports.t
@@ -25,6 +25,7 @@
   > -X doc/gendoc.py \
   > -X doc/hgmanpage.py \
   > -X i18n/posplit \
+  > -X mercurial/thirdparty \
   > -X tests/hypothesishelpers.py \
   > -X tests/test-commit-interactive.t \
   > -X tests/test-contrib-check-code.t \
diff --git a/tests/test-check-code.t b/tests/test-check-code.t
--- a/tests/test-check-code.t
+++ b/tests/test-check-code.t
@@ -7,9 +7,11 @@
 New errors are not allowed. Warnings are strongly discouraged.
 (The writing "no-che?k-code" is for not skipping this file when checking.)
 
-  $ testrepohg locate -X contrib/python-zstandard \
-  > -X hgext/fsmonitor/pywatchman |
-  > sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
+  $ testrepohg locate \
+  > -X contrib/python-zstandard \
+  > -X hgext/fsmonitor/pywatchman \
+  > -X mercurial/thirdparty \
+  > | sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
   Skipping i18n/polib.py it has no-che?k-code (glob)
   Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob)
   Skipping mercurial/httpclient/_readers.py it has no-che?k-code (glob)
diff --git a/contrib/import-checker.py b/contrib/import-checker.py
--- a/contrib/import-checker.py
+++ b/contrib/import-checker.py
@@ -35,6 +35,8 @@
 'mercurial.pure.mpatch',
 'mercurial.pure.osutil',
 'mercurial.pure.parsers',
+# third-party imports should be directly imported
+'mercurial.thirdparty',
 )
 
 # Whitelist of symbols that can be directly imported.



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


D874: hghave: check for debuild being installed as well

2017-10-01 Thread spectral (Kyle Lippincott)
spectral 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/D874

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -581,7 +581,11 @@
  br'dh is a part of debhelper.', ignorestatus=True)
 dh_py2 = matchoutput('dh_python2 --help',
  br'other supported Python versions')
-return dpkg and dh and dh_py2
+# debuild comes from the 'devscripts' package, though you might want
+# the 'build-debs' package instead, which has a dependency on devscripts.
+debuild = matchoutput('debuild --help',
+  br'to run debian/rules with given parameter')
+return dpkg and dh and dh_py2 and debuild
 
 @check("demandimport", "demandimport enabled")
 def has_demandimport():



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


[Bug 5693] New: Allow running Ansible playbook on Vagrant environment without vault secrets

2017-10-01 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5693

Bug ID: 5693
   Summary: Allow running Ansible playbook on Vagrant environment
without vault secrets
   Product: Mercurial
   Version: unspecified
  Hardware: PC
OS: Mac OS
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: infrastructure
  Assignee: kbullock+mercur...@ringworld.org
  Reporter: kbullock+mercur...@ringworld.org
CC: kbullock+mercur...@ringworld.org,
mercurial-devel@mercurial-scm.org

We have several contributors who have access to the infra repo but not the
actual infrastructure. To let them test Ansible changes locally before sending
patches, we should set up a playbook to run against the Vagrant environment
that doesn't require the production secrets.

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


D873: releasenotes: raise error when no filename specified

2017-10-01 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  Can't we just output the releasenotes using ui.write() if no file name is 
specified. I sometimes wanted to check what releasenotes my commit will produce 
and I needed to mention a file.

REPOSITORY
  rHG Mercurial

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

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


D873: releasenotes: raise error when no filename specified

2017-10-01 Thread rishabhmadan96 (Rishabh Madan)
rishabhmadan96 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Earlier, not specifying filename with --rev raised a really long TypeError.
  This patch just raises a small error to specify the filename.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/releasenotes.py
  tests/test-releasenotes-formatting.t

CHANGE DETAILS

diff --git a/tests/test-releasenotes-formatting.t 
b/tests/test-releasenotes-formatting.t
--- a/tests/test-releasenotes-formatting.t
+++ b/tests/test-releasenotes-formatting.t
@@ -440,37 +440,5 @@
   $ hg init relnotes-nofile
   $ cd relnotes-nofile
   $ hg releasenote -r .
-  ** unknown exception encountered, please report by visiting
-  ** https://mercurial-scm.org/wiki/BugTracker
-  ** Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
-  ** Mercurial Distributed SCM (version 4.3.3+701-c4594d38b2da+20171001)
-  ** Extensions loaded: releasenotes
-  Traceback (most recent call last):
-File "/tmp/hgtests.5N93rp/install/bin/hg", line 47, in 
-  dispatch.run()
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
81, in run
-  status = (dispatch(req) or 0) & 255
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
163, in dispatch
-  ret = _runcatch(req)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
303, in _runcatch
-  return _callcatch(ui, _runcatchfunc)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
311, in _callcatch
-  return scmutil.callcatch(ui, func)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/scmutil.py", line 
151, in callcatch
-  return func()
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
293, in _runcatchfunc
-  return _dispatch(req)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
929, in _dispatch
-  cmdpats, cmdoptions)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
691, in runcommand
-  ret = _runcommand(ui, options, cmd, d)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
937, in _runcommand
-  return cmdfunc()
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
926, in 
-  d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
-File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/util.py", line 
1180, in check
-  return func(*args, **kwargs)
-File "/tmp/hgtests.5N93rp/install/lib/python/hgext/releasenotes.py", line 
580, in releasenotes
-  with open(file_, 'rb') as fh:
-  TypeError: coercing to Unicode: need string or buffer, NoneType found
-  [1]
+  abort: Specify release notes filename
+  [255]
diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -573,6 +573,8 @@
 revs = scmutil.revrange(repo, [rev or 'not public()'])
 if opts.get('check'):
 return checkadmonitions(ui, repo, sections.names(), revs)
+if opts.get('rev') and file_==None:
+raise error.Abort(_('Specify release notes filename'))
 
 incoming = parsenotesfromrevisions(repo, sections.names(), revs)
 



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


D872: releasenotes: add test showing TypeError with no file specified

2017-10-01 Thread rishabhmadan96 (Rishabh Madan)
rishabhmadan96 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The releasenotes command throws a TypeError when no filename is specified with
  the --rev flag.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-releasenotes-formatting.t

CHANGE DETAILS

diff --git a/tests/test-releasenotes-formatting.t 
b/tests/test-releasenotes-formatting.t
--- a/tests/test-releasenotes-formatting.t
+++ b/tests/test-releasenotes-formatting.t
@@ -434,3 +434,43 @@
   $ hg releasenotes -l -c
   abort: cannot use both '--list' and '--check'
   [255]
+
+Raise error when no filename is specified with --rev
+
+  $ hg init relnotes-nofile
+  $ cd relnotes-nofile
+  $ hg releasenote -r .
+  ** unknown exception encountered, please report by visiting
+  ** https://mercurial-scm.org/wiki/BugTracker
+  ** Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
+  ** Mercurial Distributed SCM (version 4.3.3+701-c4594d38b2da+20171001)
+  ** Extensions loaded: releasenotes
+  Traceback (most recent call last):
+File "/tmp/hgtests.5N93rp/install/bin/hg", line 47, in 
+  dispatch.run()
+File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
81, in run
+  status = (dispatch(req) or 0) & 255
+File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
163, in dispatch
+  ret = _runcatch(req)
+File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
303, in _runcatch
+  return _callcatch(ui, _runcatchfunc)
+File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
311, in _callcatch
+  return scmutil.callcatch(ui, func)
+File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/scmutil.py", line 
151, in callcatch
+  return func()
+File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
293, in _runcatchfunc
+  return _dispatch(req)
+File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
929, in _dispatch
+  cmdpats, cmdoptions)
+File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
691, in runcommand
+  ret = _runcommand(ui, options, cmd, d)
+File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
937, in _runcommand
+  return cmdfunc()
+File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/dispatch.py", line 
926, in 
+  d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
+File "/tmp/hgtests.5N93rp/install/lib/python/mercurial/util.py", line 
1180, in check
+  return func(*args, **kwargs)
+File "/tmp/hgtests.5N93rp/install/lib/python/hgext/releasenotes.py", line 
580, in releasenotes
+  with open(file_, 'rb') as fh:
+  TypeError: coercing to Unicode: need string or buffer, NoneType found
+  [1]



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


D871: python3: don't byte mangle third-party packages

2017-10-01 Thread sid0 (Siddharth Agarwal)
sid0 updated this revision to Diff 2246.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D871?vs=2243=2246

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

AFFECTED FILES
  mercurial/__init__.py

CHANGE DETAILS

diff --git a/mercurial/__init__.py b/mercurial/__init__.py
--- a/mercurial/__init__.py
+++ b/mercurial/__init__.py
@@ -34,6 +34,9 @@
 # selectors2 is already dual-version clean, don't try and mangle it
 if fullname.startswith('mercurial.selectors2'):
 return None
+# third-party packages are expected to be dual-version clean
+if fullname.startswith('mercurial.thirdparty'):
+return None
 # zstd is already dual-version clean, don't try and mangle it
 if fullname.startswith('mercurial.zstd'):
 return None



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


D785: context: also consider path conflicts when clearing unknown files

2017-10-01 Thread kiilerix (Mads Kiilerich)
kiilerix added inline comments.

INLINE COMMENTS

> test-pathconflicts-basic.t:38
>1 files updated, 0 files merged, 1 files removed, 0 files unresolved
> +  $ rm a~853701544ac3+
>  

I don't know about these `~hash` files, but including the `+` in the name 
definitely seems wrong.

REPOSITORY
  rHG Mercurial

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

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


D867: thirdparty: vendor attrs

2017-10-01 Thread sid0 (Siddharth Agarwal)
sid0 updated this revision to Diff 2244.
sid0 edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D867?vs=2231=2244

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

AFFECTED FILES
  mercurial/thirdparty/__init__.py
  mercurial/thirdparty/attr/LICENSE.txt
  mercurial/thirdparty/attr/__init__.py
  mercurial/thirdparty/attr/_compat.py
  mercurial/thirdparty/attr/_config.py
  mercurial/thirdparty/attr/_funcs.py
  mercurial/thirdparty/attr/_make.py
  mercurial/thirdparty/attr/converters.py
  mercurial/thirdparty/attr/exceptions.py
  mercurial/thirdparty/attr/filters.py
  mercurial/thirdparty/attr/validators.py
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -709,6 +709,8 @@
 'mercurial.hgweb',
 'mercurial.httpclient',
 'mercurial.pure',
+'mercurial.thirdparty',
+'mercurial.thirdparty.attr',
 'hgext', 'hgext.convert', 'hgext.fsmonitor',
 'hgext.fsmonitor.pywatchman', 'hgext.highlight',
 'hgext.largefiles', 'hgext.zeroconf', 'hgext3rd',
diff --git a/mercurial/thirdparty/attr/validators.py 
b/mercurial/thirdparty/attr/validators.py
new file mode 100644
--- /dev/null
+++ b/mercurial/thirdparty/attr/validators.py
@@ -0,0 +1,166 @@
+"""
+Commonly useful validators.
+"""
+
+from __future__ import absolute_import, division, print_function
+
+from ._make import attr, attributes, and_, _AndValidator
+
+
+__all__ = [
+"and_",
+"in_",
+"instance_of",
+"optional",
+"provides",
+]
+
+
+@attributes(repr=False, slots=True, hash=True)
+class _InstanceOfValidator(object):
+type = attr()
+
+def __call__(self, inst, attr, value):
+"""
+We use a callable class to be able to change the ``__repr__``.
+"""
+if not isinstance(value, self.type):
+raise TypeError(
+"'{name}' must be {type!r} (got {value!r} that is a "
+"{actual!r})."
+.format(name=attr.name, type=self.type,
+actual=value.__class__, value=value),
+attr, self.type, value,
+)
+
+def __repr__(self):
+return (
+""
+.format(type=self.type)
+)
+
+
+def instance_of(type):
+"""
+A validator that raises a :exc:`TypeError` if the initializer is called
+with a wrong type for this particular attribute (checks are perfomed using
+:func:`isinstance` therefore it's also valid to pass a tuple of types).
+
+:param type: The type to check for.
+:type type: type or tuple of types
+
+:raises TypeError: With a human readable error message, the attribute
+(of type :class:`attr.Attribute`), the expected type, and the value it
+got.
+"""
+return _InstanceOfValidator(type)
+
+
+@attributes(repr=False, slots=True, hash=True)
+class _ProvidesValidator(object):
+interface = attr()
+
+def __call__(self, inst, attr, value):
+"""
+We use a callable class to be able to change the ``__repr__``.
+"""
+if not self.interface.providedBy(value):
+raise TypeError(
+"'{name}' must provide {interface!r} which {value!r} "
+"doesn't."
+.format(name=attr.name, interface=self.interface, value=value),
+attr, self.interface, value,
+)
+
+def __repr__(self):
+return (
+""
+.format(interface=self.interface)
+)
+
+
+def provides(interface):
+"""
+A validator that raises a :exc:`TypeError` if the initializer is called
+with an object that does not provide the requested *interface* (checks are
+performed using ``interface.providedBy(value)`` (see `zope.interface
+`_).
+
+:param zope.interface.Interface interface: The interface to check for.
+
+:raises TypeError: With a human readable error message, the attribute
+(of type :class:`attr.Attribute`), the expected interface, and the
+value it got.
+"""
+return _ProvidesValidator(interface)
+
+
+@attributes(repr=False, slots=True, hash=True)
+class _OptionalValidator(object):
+validator = attr()
+
+def __call__(self, inst, attr, value):
+if value is None:
+return
+
+self.validator(inst, attr, value)
+
+def __repr__(self):
+return (
+""
+.format(what=repr(self.validator))
+)
+
+
+def optional(validator):
+"""
+A validator that makes an attribute optional.  An optional attribute is one
+which can be set to ``None`` in addition to satisfying the requirements of
+the sub-validator.
+
+:param validator: A validator (or a list of validators) that is used for
+non-``None`` values.
+:type validator: callable or :class:`list` 

D871: python3: don't byte mangle third-party packages

2017-10-01 Thread sid0 (Siddharth Agarwal)
sid0 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Third-party packages are already expected to be dual-version clean.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/__init__.py

CHANGE DETAILS

diff --git a/mercurial/__init__.py b/mercurial/__init__.py
--- a/mercurial/__init__.py
+++ b/mercurial/__init__.py
@@ -31,6 +31,9 @@
 # Only handle Mercurial-related modules.
 if not fullname.startswith(('mercurial.', 'hgext.', 'hgext3rd.')):
 return None
+# third-party packages are expected to be dual-version clean
+if fullname.startswith('mercurial.thirdparty'):
+return None
 # selectors2 is already dual-version clean, don't try and mangle it
 if fullname.startswith('mercurial.selectors2'):
 return None



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


D865: obsmarker: fix crash when metadata fields are >255 bytes (issue5681)

2017-10-01 Thread ikostia (Kostia Balytskyi)
ikostia added a comment.


  That is why we raise `ProgrammingError`, not some sort of `UserError`. If 
your extension writes metadata longer than 255 chars, it is a bad extension. 
Your proposal is weird, because it is quietly modifying things, IMO this is 
much worse. I'd rather be forced to change my name to something shorter than 
having it truncated at some arbitrary position.

REPOSITORY
  rHG Mercurial

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

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


D778: merge: backup conflicting directories when getting files

2017-10-01 Thread kiilerix (Mads Kiilerich)
kiilerix added inline comments.

INLINE COMMENTS

> merge.py:1175
> +absf = repo.wjoin(p)
> +break
>  orig = scmutil.origpath(ui, repo, absf)

This seems quite a bit slower. But I guess it never will happen in tight loops? 
If we have to backup a lot of files, then we have lost anyway?

REPOSITORY
  rHG Mercurial

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

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


[Bug 5692] New: Bundle seeking after interrupt behavior regressed

2017-10-01 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5692

Bug ID: 5692
   Summary: Bundle seeking after interrupt behavior regressed
   Product: Mercurial
   Version: default branch
  Hardware: All
OS: All
Status: UNCONFIRMED
  Keywords: regression
  Severity: bug
  Priority: urgent
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: gregory.sz...@gmail.com
CC: mercurial-devel@mercurial-scm.org
Depends on: 4784

From https://phab.mercurial-scm.org/D705#13479 21c2df59a1da regressed
ad41739c6b2b. This regression should get fixed before the next release. Filing
a bug to increase the visibility.


Referenced Bugs:

https://bz.mercurial-scm.org/show_bug.cgi?id=4784
[Bug 4784] Bundle2 client handles dropped HTTP(S) connections poorly, with
cryptic error messages
-- 
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


  1   2   >