D7465: filemerge: fix a missing attribute usage

2019-11-20 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Flagged by both pytype and VSCode.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

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



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


D7464: filemerge: drop a default argument to appease pytype

2019-11-20 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The function slices and takes the length of this argument without internally
  setting it if not provided.  There was no bug here because both callers passed
  the argument.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

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



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


D7463: wireprotov1server: capture Abort type before accessing the `hint` attribute

2019-11-20 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Although the previous code worked, pytypes complained because `exc` is caught
  above as `BundleValueError, Abort, PushRaced`, and the other two don't have 
this
  attribute.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/wireprotov1server.py

CHANGE DETAILS

diff --git a/mercurial/wireprotov1server.py b/mercurial/wireprotov1server.py
--- a/mercurial/wireprotov1server.py
+++ b/mercurial/wireprotov1server.py
@@ -679,7 +679,7 @@
 if not getattr(exc, 'duringunbundle2', False):
 try:
 raise
-except error.Abort:
+except error.Abort as exc:
 # The old code we moved used procutil.stderr directly.
 # We did not change it to minimise code change.
 # This need to be moved to something proper.



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


D7462: py3: make doc strings containing the deprected '\.' escape sequence raw strings

2019-11-20 Thread dploch (Daniel Ploch)
dploch 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/D7462

AFFECTED FILES
  mercurial/match.py

CHANGE DETAILS

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -543,7 +543,7 @@
 
 
 class patternmatcher(basematcher):
-"""Matches a set of (kind, pat, source) against a 'root' directory.
+r"""Matches a set of (kind, pat, source) against a 'root' directory.
 
 >>> kindpats = [
 ... (b're', br'.*\.c$', b''),
@@ -1152,7 +1152,7 @@
 
 
 def patkind(pattern, default=None):
-'''If pattern is 'kind:pat' with a known kind, return kind.
+r'''If pattern is 'kind:pat' with a known kind, return kind.
 
 >>> patkind(br're:.*\.c$')
 're'



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


[PATCH STABLE] singlehead: making config item a bool again

2019-11-20 Thread Georges Racinet
# HG changeset patch
# User Georges Racinet 
# Date 1574273222 -3600
#  Wed Nov 20 19:07:02 2019 +0100
# Branch stable
# Node ID c557e15674ea6adfe1b034e5b4af1e26bca850dd
# Parent  ca3dca416f8d5863ca6f5a4a6a6bb835dcd5feeb
# EXP-Topic single_head_is_boolean
singlehead: making config item a bool again

with the use of `configsuboptions`, the main config item has become
a string (unless it's just the default value).

This makes it in particular hard to override in a cascade of HGRC files,
as we do in Heptapod to re-allow multiple heads on specific repositories
while the default behaviour is to forbid them. The added test case reflects
that use-case

diff -r ca3dca416f8d -r c557e15674ea mercurial/localrepo.py
--- a/mercurial/localrepo.pyTue Nov 05 21:35:19 2019 +0900
+++ b/mercurial/localrepo.pyWed Nov 20 19:07:02 2019 +0100
@@ -2090,6 +2090,8 @@
 b'experimental', b'single-head-per-branch'
 )
 singlehead, singleheadsub = r
+if singlehead is not None and not isinstance(singlehead, bool):
+singlehead = stringutil.parsebool(singlehead)
 if singlehead:
 accountclosed = singleheadsub.get(
 b"account-closed-heads", False
diff -r ca3dca416f8d -r c557e15674ea tests/test-single-head.t
--- a/tests/test-single-head.t  Tue Nov 05 21:35:19 2019 +0900
+++ b/tests/test-single-head.t  Wed Nov 20 19:07:02 2019 +0100
@@ -259,3 +259,28 @@
   abort: rejecting multiple heads on branch "branch_A"
   (3 heads: 49003e504178 5254bcccab93 42b9fe70a3c1)
   [255]
+
+
+Test that config can be overriden as the boolean it is
+--
+
+  $ cat <> $TESTTMP/single-head-server/.hg/hgrc
+  > [experimental]
+  > single-head-per-branch = no
+  > EOF
+
+let's make a new, non closed head, but because of previous test, we'll also
+push c_aL0 and c_aM0.
+
+  $ hg out
+  $ hg up 'desc("c_aG0")'
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ mkcommit c_aN0
+  created new head
+  $ hg push -f
+  pushing to $TESTTMP/single-head-server
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 3 files
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7204: fsmonitor: reapply b1f62cd39b5c

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


  Same question as for D7203  Out of 
curiosity, was the fix submitted upstream too ?

REPOSITORY
  rHG Mercurial

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

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

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


D7203: fsmonitor: reapply dd35abc409ee

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


  Out of curiosity, was the fix submitted upstream too ?

REPOSITORY
  rHG Mercurial

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

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

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


mercurial@43718: 8 new changesets

2019-11-20 Thread Mercurial Commits
8 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/7f443cce2972
changeset:   43711:7f443cce2972
parent:  43709:039fbd14d4e2
user:Martin von Zweigbergk 
date:Fri Nov 15 14:41:00 2019 -0800
summary: commit: rewrite check for `hg ci ` being a directory

https://www.mercurial-scm.org/repo/hg/rev/f965b1027fb0
changeset:   43712:f965b1027fb0
user:Martin von Zweigbergk 
date:Fri Nov 15 14:47:31 2019 -0800
summary: commit: drop unused "vdirs" argument from 
repo.checkcommitpatterns()

https://www.mercurial-scm.org/repo/hg/rev/95d2eab0a7b9
changeset:   43713:95d2eab0a7b9
user:Martin von Zweigbergk 
date:Fri Nov 15 15:36:09 2019 -0800
summary: dirstate: include explicit matches in match.traversedir calls

https://www.mercurial-scm.org/repo/hg/rev/deacffd227e2
changeset:   43714:deacffd227e2
user:Martin von Zweigbergk 
date:Fri Nov 15 15:36:14 2019 -0800
summary: dirstate: stop caring about match.explicitdir

https://www.mercurial-scm.org/repo/hg/rev/5e1b0470cee7
changeset:   43715:5e1b0470cee7
user:Martin von Zweigbergk 
date:Fri Nov 15 14:50:13 2019 -0800
summary: match: remove explicitdir attribute

https://www.mercurial-scm.org/repo/hg/rev/33cff871d3b9
changeset:   43716:33cff871d3b9
user:Jordi Gutiérrez Hermoso 
date:Fri Nov 15 16:02:01 2019 -0500
summary: hgweb: add a status property to file list context

https://www.mercurial-scm.org/repo/hg/rev/6feaee05bac5
changeset:   43717:6feaee05bac5
user:Jordi Gutiérrez Hermoso 
date:Fri Nov 15 15:56:25 2019 -0500
summary: hgweb: add files to the json changeset template

https://www.mercurial-scm.org/repo/hg/rev/d155bf11cf22
changeset:   43718:d155bf11cf22
bookmark:@
tag: tip
user:Jordi Gutiérrez Hermoso 
date:Fri Nov 15 15:58:56 2019 -0500
summary: hgweb: add diffs to the json changeset template

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


D7461: py3: wrap a __func__ in sysbytes() before logging as bytes

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

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/remotefilelog/basestore.py

CHANGE DETAILS

diff --git a/hgext/remotefilelog/basestore.py b/hgext/remotefilelog/basestore.py
--- a/hgext/remotefilelog/basestore.py
+++ b/hgext/remotefilelog/basestore.py
@@ -441,7 +441,10 @@
 i = 0
 while i < self.numattempts:
 if i > 0:
-retrylog(b're-attempting (n=%d) %s\n' % (i, funcname))
+retrylog(
+b're-attempting (n=%d) %s\n'
+% (i, pycompat.sysbytes(funcname))
+)
 self.markforrefresh()
 i += 1
 try:



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


D7460: tests: add more tests for "hg shelve --delete"

2019-11-20 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.
mharbison72 accepted this revision.


  LGTM

REPOSITORY
  rHG Mercurial

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

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

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


D7458: shelve: add the missing `create` parameter to the bundlerepo constructor

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


  In D7458#109743 , @dlax wrote:
  
  > Good catch.
  > On the other hand, it's not clear to me what's the point of this "create" 
argument given `bundlerepo.instance()` will just use it to raise Abort if it is 
true.
  
  I think it’s so that the factory method is the same for each repo type, 
though I didn’t verify that’s still the case.  I am surprised that this 
parameter doesn’t default to False.  See 386f04d6ecb3 
.  
But I didn’t know if changing the signature on stable would be ok, or if there 
was a valid reason for the current signature.

REPOSITORY
  rHG Mercurial

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

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

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


D7460: tests: add more tests for "hg shelve --delete"

2019-11-20 Thread dlax (Denis Laxalde)
dlax updated this revision to Diff 18250.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7460?vs=18249=18250

BRANCH
  default

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

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

AFFECTED FILES
  tests/test-shelve.t

CHANGE DETAILS

diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -951,6 +951,16 @@
   +++ b/jungle
   @@ -0,0 +1,1 @@
   +babar
+
+Test shelve --delete
+
+  $ hg shelve --list
+  default (*s ago)changes to: create conflict (glob)
+  $ hg shelve --delete doesnotexist
+  abort: shelved change 'doesnotexist' not found
+  [255]
+  $ hg shelve --delete default
+
   $ cd ..
 
 Test visibility of in-memory changes inside transaction to external hook



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


D7460: tests: add more tests for "hg shelve --delete"

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

INLINE COMMENTS

> test-shelve.t:958
> +  $ hg shelve --list
> +  default (1s ago)changes to: create conflict
> +  $ hg shelve --delete doesnotexist

The exact time should probably be globbed away.

REPOSITORY
  rHG Mercurial

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

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

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


D7458: shelve: add the missing `create` parameter to the bundlerepo constructor

2019-11-20 Thread dlax (Denis Laxalde)
dlax added a comment.
dlax accepted this revision.


  Good catch.
  
  On the other hand, it's not clear to me what's the point of this "create" 
argument given `bundlerepo.instance()` will just use it to raise Abort if it is 
true.

REPOSITORY
  rHG Mercurial

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

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

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


D7460: tests: add more tests for "hg shelve --delete"

2019-11-20 Thread dlax (Denis Laxalde)
dlax created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It appears that the only tests for "hg shelve --delete" concern command
  errors (e.g. incompatible command options). Adding some more to check
  that non-existent names are handled and a success case.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-shelve.t

CHANGE DETAILS

diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -951,6 +951,16 @@
   +++ b/jungle
   @@ -0,0 +1,1 @@
   +babar
+
+Test shelve --delete
+
+  $ hg shelve --list
+  default (1s ago)changes to: create conflict
+  $ hg shelve --delete doesnotexist
+  abort: shelved change 'doesnotexist' not found
+  [255]
+  $ hg shelve --delete default
+
   $ cd ..
 
 Test visibility of in-memory changes inside transaction to external hook



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