[PATCH V2] subrepo: config option to disable subrepositories

2017-11-04 Thread Gregory Szorc
# HG changeset patch
# User Gregory Szorc 
# Date 1509855814 25200
#  Sat Nov 04 21:23:34 2017 -0700
# Branch stable
# Node ID 5aa341ccc69b7d9e7e3fdf2fe6f24317a1c4658f
# Parent  f445b10dc7fb3495d24d1c22b0996148864c77f7
subrepo: config option to disable subrepositories

Subrepositories are a lesser-used feature that has a history of security
vulnerabilities. Previous subrepo vulnerabilities have resulted in
arbitrary code execution during `hg clone`. This is one of the worst
kind of vulnerabilities a version control system can have.

An aspect of the security concern is that Mercurial supports
non-Mercurial subrepositories. (Git and Subversion are supported by
default.) While the Mercurial developers try to keep up with
development of other version control systems, it is effectively
impossible for us to keep tabs on all 3rd party changes and their
security impact. Every time Mercurial attempts to call out into
another [version control] tool, we run a higher risk of accidentally
introducing a security vulnerability. This is what's referred to as
"surface area for "attack" in computer security speak.

Since subrepos have a history of vulnerabilities, increase our
exposure to security issues in other tools, and aren't widely used
or a critical feature to have enabled by default, it makes sense
for the feature to be optional.

This commit introduces a config flag to control whether subrepos are
enabled. The default of having them enabled remains unchanged.

The mechanism by which the patch works is two pronged:

1) It effectively short-circuits the parsing of .hgsubstate files.
   Even if an .hgsubstate exists, it will be parsed as if it is
   empty and Mercurial won't think there are subrepos to operate on.
2) It disables special functionality related to .hgsub and .hgsubstate
   files. Normally, .hgsubstate is managed automatically. With the
   subrepos feature disabled, this file is treated as a normal file.

In the future, we'd like to introduce per VCS controls for subrepos.
For example, it might be prudent to disable 3rd party subrepo types
for security reasons but leave Mercurial subrepos enabled. As I thought
about what these future config options would look like, I couldn't
think of a great way to shoehorn them into [ui], where most existing
subrepo options are (there is also [subpaths]). I think we'll
eventually have sufficient complexity for subrepos to warrant their
own config section. So that's what I implemented here.

I also thought "enable" was too generic. The introduced flag
essentially controls whether subrepos can be checked out. So I
named the option "checkout." It takes a boolean value. For per-type
options, I was thinking we could use e.g. "checkout:git = false."

There are likely some corner cases with this patch. Known deficiencies
are annotated as such in the added test. IMO the biggest deficiency
is interaction with dirstate and status. I think subrepo paths should
be ignored when subrepo checkout is disabled. Implementing that will
require a different approach - one that doesn't virtually blank out
.hgsubstate.

This commit should receive extra review scrutiny because there
are tons of random references to .hgsub, .hgsubstate, and ctx.substate
throughout the code base. I'm not sure if I touched all the ones we
need to touch and if the ones we did touch needed to be touched.

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -959,7 +959,8 @@ class queue(object):
 p1, p2 = repo.dirstate.parents()
 repo.setparents(p1, merge)
 
-if all_files and '.hgsubstate' in all_files:
+if (all_files and '.hgsubstate' in all_files
+and subrepo.checkoutenabled(repo.ui)):
 wctx = repo[None]
 pctx = repo['.']
 overwrite = False
@@ -1205,8 +1206,11 @@ class queue(object):
 if opts.get('include') or opts.get('exclude') or pats:
 # detect missing files in pats
 def badfn(f, msg):
-if f != '.hgsubstate': # .hgsubstate is auto-created
-raise error.Abort('%s: %s' % (f, msg))
+# .hgsubstate is auto-created
+if f == '.hgsubstate' and subrepo.checkoutenabled(repo):
+return
+
+raise error.Abort('%s: %s' % (f, msg))
 match = scmutil.match(repo[None], pats, opts, badfn=badfn)
 changes = repo.status(match=match)
 else:
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -811,6 +811,9 @@ coreconfigitem('smtp', 'username',
 coreconfigitem('sparse', 'missingwarning',
 default=True,
 )
+coreconfigitem('subrepos', 'checkout',
+default=True,
+)
 coreconfigitem('templates', '.*',
 default=None,
 generic=True,
diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
--- 

Re: [PATCH] pathutil: add doctests for canonpath()

2017-11-04 Thread Yuya Nishihara
On Sat, 04 Nov 2017 22:23:32 -0400, Matt Harbison wrote:
> On Sat, 04 Nov 2017 22:11:21 -0400, Yuya Nishihara  wrote:
> > My concern is that the doctest is too limited in scope to cover possible  
> > bugs
> > caused by Windows drive letter. Maybe we could add a safer alternative to
> > os.path.relpath() and ban the use by check-code.
> 
> Seems like a good idea.  There are a few more uses of it, and I'm pretty  
> sure that at least cmdutil._conflictsmsg() is broke too, based on passing  
> repo.root and cwd.  (I guess thg doesn't use this function?)
> 
> I haven't been able to create the issue with the origpath code, and like I  
> said in the 'share --relative' patch, the error is useful there.  Is this  
> one of those things we can ban, but just record the few places it's needed  
> in test-check-code.t?

Perhaps os.path.relpath() can be replaced with two functions, which are:

 a) always return a relative path; raise Abort if not possible
 b) try to return a relative path only if possible; an absolute path otherwise

On Unix, they both are mapped to os.path.relpath.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] pathutil: add doctests for canonpath()

2017-11-04 Thread Matt Harbison

On Sat, 04 Nov 2017 22:11:21 -0400, Yuya Nishihara  wrote:


On Sat, 4 Nov 2017 09:16:03 -0400, Matt Harbison wrote:

> On Nov 4, 2017, at 4:03 AM, Yuya Nishihara  wrote:
>> On Fri, 03 Nov 2017 23:26:40 -0400, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison 
>> # Date 1509762170 14400
>> #  Fri Nov 03 22:22:50 2017 -0400
>> # Node ID 7d9abeb82f021b4b96162a719f4a44a0175c0828
>> # Parent  3649c3f2cd90c8aec395ca8af5adae33defff12c
>> pathutil: add doctests for canonpath()
>>
>> This is a followup to f445b10dc7fb.  Since there's no way to ensure  
that more
>> drive letters than C: exist, this seems like the only way to test  
it.  This is
>> enough to catch the f445b10dc7fb scenario, as well as CWD outside of  
the repo

>> when the path isn't prefixed with path/to/repo.
>
> Maybe we can add an hghave rule to check if d: drive exists, is  
different from

> the TESTTMP, and can chdir into it?

I thought about that, but this allows everyone running tests on Windows  
to be able to see the error if it regresses, regardless of their  
setup.  That seems important, given how few people run Windows tests.   
I’m not sure what the Windows test system is currently configured to  
do, for instance (it’s been a WIP because of some unexpected errors  
running under buildbot, and I don’t think it is totally squared away  
yet).


Okay, that makes some sense. I'll queue this patch, thanks.

My concern is that the doctest is too limited in scope to cover possible  
bugs

caused by Windows drive letter. Maybe we could add a safer alternative to
os.path.relpath() and ban the use by check-code.


Seems like a good idea.  There are a few more uses of it, and I'm pretty  
sure that at least cmdutil._conflictsmsg() is broke too, based on passing  
repo.root and cwd.  (I guess thg doesn't use this function?)


I haven't been able to create the issue with the origpath code, and like I  
said in the 'share --relative' patch, the error is useful there.  Is this  
one of those things we can ban, but just record the few places it's needed  
in test-check-code.t?

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


Re: [PATCH] pathutil: add doctests for canonpath()

2017-11-04 Thread Yuya Nishihara
On Sat, 4 Nov 2017 09:16:03 -0400, Matt Harbison wrote:
> > On Nov 4, 2017, at 4:03 AM, Yuya Nishihara  wrote:
> >> On Fri, 03 Nov 2017 23:26:40 -0400, Matt Harbison wrote:
> >> # HG changeset patch
> >> # User Matt Harbison 
> >> # Date 1509762170 14400
> >> #  Fri Nov 03 22:22:50 2017 -0400
> >> # Node ID 7d9abeb82f021b4b96162a719f4a44a0175c0828
> >> # Parent  3649c3f2cd90c8aec395ca8af5adae33defff12c
> >> pathutil: add doctests for canonpath()
> >> 
> >> This is a followup to f445b10dc7fb.  Since there's no way to ensure that 
> >> more
> >> drive letters than C: exist, this seems like the only way to test it.  
> >> This is
> >> enough to catch the f445b10dc7fb scenario, as well as CWD outside of the 
> >> repo
> >> when the path isn't prefixed with path/to/repo.
> > 
> > Maybe we can add an hghave rule to check if d: drive exists, is different 
> > from
> > the TESTTMP, and can chdir into it?
> 
> I thought about that, but this allows everyone running tests on Windows to be 
> able to see the error if it regresses, regardless of their setup.  That seems 
> important, given how few people run Windows tests.  I’m not sure what the 
> Windows test system is currently configured to do, for instance (it’s been a 
> WIP because of some unexpected errors running under buildbot, and I don’t 
> think it is totally squared away yet).

Okay, that makes some sense. I'll queue this patch, thanks.

My concern is that the doctest is too limited in scope to cover possible bugs
caused by Windows drive letter. Maybe we could add a safer alternative to
os.path.relpath() and ban the use by check-code.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] subrepo: config option to disable subrepositories

2017-11-04 Thread Gregory Szorc
On Fri, Nov 3, 2017 at 11:57 PM, Yuya Nishihara  wrote:

> On Fri, 03 Nov 2017 17:28:27 -0700, Gregory Szorc wrote:
> > # HG changeset patch
> > # User Gregory Szorc 
> > # Date 1509755155 25200
> > #  Fri Nov 03 17:25:55 2017 -0700
> > # Branch stable
> > # Node ID f2390c369bfebf32f26f5a2e4aa5620224a7c8ea
> > # Parent  f445b10dc7fb3495d24d1c22b0996148864c77f7
> > subrepo: config option to disable subrepositories
>
> > +``enablesubrepos``
> > +Whether the subrepositories feature is enabled. If disabled,
> > +subrepositories are effectively ignored by the Mercurial client.
> > +(default: True)
>
> We might want to select subrepo types to be enabled since hg subrepo is
> more widely used and considered less broken.
>

I would like per-type controls as well.

I would prefer to start with a simple patch providing a master switch. We
can add per-type switches in later. But we should have a plan for the
option names so the end state has a reasonable UI.

I'll try to send out a V2 in the next few hours...


>
> > +TODO buggy because localrepository.commit() managed its file contents
> > +  $ hg commit -m 'manually add .hgsubstate'
> > +  nothing changed
> > +  [1]
> > +
> > +... but hg commit --amend works (this relies on a regression in 4.4)
> > +
> > +  $ hg commit --amend
> > +  saved backup bundle to $TESTTMP/testrepo0/.hg/strip-
> backup/addf99df3e66-ab5c9ff8-amend.hg (glob)
>
> Yeah, it's the issue5677.
>
> https://bz.mercurial-scm.org/show_bug.cgi?id=5677
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[Bug 5733] New: test-convert-bzr-directories.t fails with older bzr

2017-11-04 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5733

Bug ID: 5733
   Summary: test-convert-bzr-directories.t fails with older bzr
   Product: Mercurial
   Version: 4.4
  Hardware: PC
OS: All
Status: UNCONFIRMED
  Severity: bug
  Priority: normal
 Component: convert
  Assignee: bugzi...@mercurial-scm.org
  Reporter: matt_harbi...@yahoo.com
CC: duri...@gmail.com, kbullock+mercur...@ringworld.org,
mercurial-devel@mercurial-scm.org, timel...@gmail.com

Originally reported by timeless[1], but I ran into this myself a few months ago
on CentOS 7 with the distro package for bzr and a source build of a newer hg. 
I tracked it to this change:

changeset:   32495:a234b32b744a
branch:  stable
parent:  32493:334632380e22
user:Kevin Bullock 
date:Tue Jul 19 11:00:32 2016 -0500
summary: convert: update use of deprecated bzrlib property

So I figured my mistake was not updating bzr as well.

[1]
https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-November/107332.html

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


[Bug 5732] New: amend doesn't respect removed/missing state, but uses filesystem state

2017-11-04 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5732

Bug ID: 5732
   Summary: amend doesn't respect removed/missing state, but uses
filesystem state
   Product: Mercurial
   Version: 4.4
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Keywords: regression
  Severity: bug
  Priority: urgent
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: y...@tcha.org
CC: mercurial-devel@mercurial-scm.org, singh...@gmail.com

Spotted when fixing the bug 5677.

STR:

  $ hg init $TESTTMP/repo4
  $ cd $TESTTMP/repo4

 create a file to be removed

  $ echo a > a
  $ hg add a
  $ hg ci -m0

 create a file to be missing

  $ echo b > b
  $ hg add b
  $ hg ci -m1

 missing file should not be removed

  $ rm b
  $ hg amend
  nothing changed
  [1]

 removed file should be removed even if the file exists in working directory

  $ hg forget a
BROKEN: missing file is removed, and removed file is not removed
  $ hg amend
  saved backup bundle to * (glob)
  $ hg status --change .

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


Re: [PATCH] pathutil: add doctests for canonpath()

2017-11-04 Thread Matt Harbison

> On Nov 4, 2017, at 4:03 AM, Yuya Nishihara  wrote:
> 
>> On Fri, 03 Nov 2017 23:26:40 -0400, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison 
>> # Date 1509762170 14400
>> #  Fri Nov 03 22:22:50 2017 -0400
>> # Node ID 7d9abeb82f021b4b96162a719f4a44a0175c0828
>> # Parent  3649c3f2cd90c8aec395ca8af5adae33defff12c
>> pathutil: add doctests for canonpath()
>> 
>> This is a followup to f445b10dc7fb.  Since there's no way to ensure that more
>> drive letters than C: exist, this seems like the only way to test it.  This 
>> is
>> enough to catch the f445b10dc7fb scenario, as well as CWD outside of the repo
>> when the path isn't prefixed with path/to/repo.
> 
> Maybe we can add an hghave rule to check if d: drive exists, is different from
> the TESTTMP, and can chdir into it?

I thought about that, but this allows everyone running tests on Windows to be 
able to see the error if it regresses, regardless of their setup.  That seems 
important, given how few people run Windows tests.  I’m not sure what the 
Windows test system is currently configured to do, for instance (it’s been a 
WIP because of some unexpected errors running under buildbot, and I don’t think 
it is totally squared away yet).
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] [v2] outgoing: respect ":pushurl" paths (issue5365)

2017-11-04 Thread Pulkit Goyal
You can use the `--flag` option of `hg email` to add email flags like V2.

On Sat, Nov 4, 2017 at 11:48 AM, Yuya Nishihara  wrote:
> On Fri, 3 Nov 2017 14:07:54 -0700, Hollis Blanchard wrote:
>> # HG changeset patch
>> # User Hollis Blanchard 
>> # Date 1509731952 25200
>> #  Fri Nov 03 10:59:12 2017 -0700
>> # Branch stable
>> # Node ID a952cae0303fa38d1b246561704071d41bbfa1ea
>> # Parent  f445b10dc7fb3495d24d1c22b0996148864c77f7
>> [v2] outgoing: respect ":pushurl" paths (issue5365)
>>
>> Make 'hg outgoing' respect "paths.default:pushurl" in addition to
>> "paths.default-push".
>>
>> 'hg outgoing' has always meant "what will happen if I run 'hg push'?" and 
>> it's
>> still documented that way:
>>
>> Show changesets not found in the specified destination repository or the
>> default push location. These are the changesets that would be pushed if a
>> push was requested.
>>
>> If the user uses the now-deprecated "paths.default-push" path, it continues 
>> to
>> work that way. However, as described at
>> https://bz.mercurial-scm.org/show_bug.cgi?id=5365, it doesn't behave the same
>> with "paths.default:pushurl".
>>
>> Why does it matter? Similar to the bugzilla reporter, I have a read-only 
>> mirror
>> of a non-Mercurial repository:
>>
>>   upstream -> imported mirror -> user clone
>>  ^---/
>>
>> Users push directly to upstream, and that content is then imported into the
>> mirror. However, those repositories are not the same; it's possible that the
>> mirroring has either broken completely, or an import process is running and 
>> not
>> yet complete. In those cases, 'hg outgoing' will list changesets that have
>> already been pushed.
>>
>> Mozilla's desired behavior described in bug 5365 can be accomplished through
>> other means (e.g. 'hg outgoing default'), preserving the consistency and
>> meaning of 'hg outgoing'.
>
> I heard from Greg that the current behavior was intentional.
>
> https://bz.mercurial-scm.org/show_bug.cgi?id=5365#c3
> https://www.mercurial-scm.org/pipermail/mercurial-devel/2014-September/062091.html
>
> Just to be clear, I'm not against this patch, but this will be a breaking
> change for some users.
> ___
> 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


D1323: py3: handle keyword arguments in hgext/uncommit.py

2017-11-04 Thread pulkit (Pulkit Goyal)
pulkit 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/D1323

AFFECTED FILES
  hgext/uncommit.py

CHANGE DETAILS

diff --git a/hgext/uncommit.py b/hgext/uncommit.py
--- a/hgext/uncommit.py
+++ b/hgext/uncommit.py
@@ -29,6 +29,7 @@
 error,
 node,
 obsolete,
+pycompat,
 registrar,
 scmutil,
 )
@@ -152,6 +153,7 @@
 deleted in the changeset will be left unchanged, and so will remain
 modified in the working directory.
 """
+opts = pycompat.byteskwargs(opts)
 
 with repo.wlock(), repo.lock():
 wctx = repo[None]



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


D1317: py3: handle keyword arguments in hgext/hgk.py

2017-11-04 Thread pulkit (Pulkit Goyal)
pulkit 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/D1317

AFFECTED FILES
  hgext/hgk.py

CHANGE DETAILS

diff --git a/hgext/hgk.py b/hgext/hgk.py
--- a/hgext/hgk.py
+++ b/hgext/hgk.py
@@ -48,6 +48,7 @@
 commands,
 obsolete,
 patch,
+pycompat,
 registrar,
 scmutil,
 util,
@@ -79,6 +80,7 @@
 inferrepo=True)
 def difftree(ui, repo, node1=None, node2=None, *files, **opts):
 """diff trees from two commits"""
+
 def __difftree(repo, node1, node2, files=None):
 assert node2 is not None
 if files is None:
@@ -102,7 +104,7 @@
 ##
 
 while True:
-if opts['stdin']:
+if opts[r'stdin']:
 try:
 line = util.bytesinput(ui.fin, ui.fout).split(' ')
 node1 = line[0]
@@ -118,8 +120,8 @@
 else:
 node2 = node1
 node1 = repo.changelog.parents(node1)[0]
-if opts['patch']:
-if opts['pretty']:
+if opts[r'patch']:
+if opts[r'pretty']:
 catcommit(ui, repo, node2, "")
 m = scmutil.match(repo[node1], files)
 diffopts = patch.difffeatureopts(ui)
@@ -130,7 +132,7 @@
 ui.write(chunk)
 else:
 __difftree(repo, node1, node2, files=files)
-if not opts['stdin']:
+if not opts[r'stdin']:
 break
 
 def catcommit(ui, repo, n, prefix, ctx=None):
@@ -183,7 +185,7 @@
 # strings
 #
 prefix = ""
-if opts['stdin']:
+if opts[r'stdin']:
 try:
 (type, r) = util.bytesinput(ui.fin, ui.fout).split(' ')
 prefix = ""
@@ -201,7 +203,7 @@
 return 1
 n = repo.lookup(r)
 catcommit(ui, repo, n, prefix)
-if opts['stdin']:
+if opts[r'stdin']:
 try:
 (type, r) = util.bytesinput(ui.fin, ui.fout).split(' ')
 except EOFError:
@@ -340,14 +342,15 @@
 else:
 full = None
 copy = [x for x in revs]
-revtree(ui, copy, repo, full, opts['max_count'], opts['parents'])
+revtree(ui, copy, repo, full, opts[r'max_count'], opts[r'parents'])
 
 @command('view',
 [('l', 'limit', '',
  _('limit number of changes displayed'), _('NUM'))],
 _('[-l LIMIT] [REVRANGE]'))
 def view(ui, repo, *etc, **opts):
 "start interactive history viewer"
+opts = pycompat.byteskwargs(opts)
 os.chdir(repo.root)
 optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v])
 if repo.filtername is None:



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


D1319: py3: handle keyword arguments in hgext/journal.py

2017-11-04 Thread pulkit (Pulkit Goyal)
pulkit 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/D1319

AFFECTED FILES
  hgext/journal.py

CHANGE DETAILS

diff --git a/hgext/journal.py b/hgext/journal.py
--- a/hgext/journal.py
+++ b/hgext/journal.py
@@ -30,6 +30,7 @@
 localrepo,
 lock,
 node,
+pycompat,
 registrar,
 util,
 )
@@ -133,7 +134,7 @@
 
 Note that by default entries go from most recent to oldest.
 """
-order = kwargs.pop('order', max)
+order = kwargs.pop(r'order', max)
 iterables = [iter(it) for it in iterables]
 # this tracks still active iterables; iterables are deleted as they are
 # exhausted, which is why this is a dictionary and why each entry also
@@ -458,6 +459,7 @@
 `hg journal -T json` can be used to produce machine readable output.
 
 """
+opts = pycompat.byteskwargs(opts)
 name = '.'
 if opts.get('all'):
 if args:



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


D1324: py3: handle keyword arguments in hgext/shelve.py

2017-11-04 Thread pulkit (Pulkit Goyal)
pulkit 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/D1324

AFFECTED FILES
  hgext/shelve.py

CHANGE DETAILS

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -43,6 +43,7 @@
 node as nodemod,
 patch,
 phases,
+pycompat,
 registrar,
 repair,
 scmutil,
@@ -380,15 +381,16 @@
 editor_ = False
 if editor:
 editor_ = cmdutil.getcommiteditor(editform='shelve.shelve',
-  **opts)
+  **pycompat.strkwargs(opts))
 with repo.ui.configoverride(overrides):
 return repo.commit(message, shelveuser, opts.get('date'),
match, editor=editor_, extra=extra)
 finally:
 if hasmq:
 repo.mq.checkapplied = saved
 
 def interactivecommitfunc(ui, repo, *pats, **opts):
+opts = pycompat.byteskwargs(opts)
 match = scmutil.match(repo['.'], pats, {})
 message = opts['message']
 return commitfunc(ui, repo, message, match, opts)
@@ -465,7 +467,7 @@
 else:
 node = cmdutil.dorecord(ui, repo, commitfunc, None,
 False, cmdutil.recordfilter, *pats,
-**opts)
+**pycompat.strkwargs(opts))
 if not node:
 _nothingtoshelvemessaging(ui, repo, pats, opts)
 return 1
@@ -852,6 +854,7 @@
 return _dounshelve(ui, repo, *shelved, **opts)
 
 def _dounshelve(ui, repo, *shelved, **opts):
+opts = pycompat.byteskwargs(opts)
 abortf = opts.get('abort')
 continuef = opts.get('continue')
 if not abortf and not continuef:
@@ -1010,6 +1013,7 @@
 To delete specific shelved changes, use ``--delete``. To delete
 all shelved changes, use ``--cleanup``.
 '''
+opts = pycompat.byteskwargs(opts)
 allowables = [
 ('addremove', {'create'}), # 'create' is pseudo action
 ('unknown', {'create'}),



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


D1322: py3: handle keyword arguments in hgext/releasenotes.py

2017-11-04 Thread pulkit (Pulkit Goyal)
pulkit 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/D1322

AFFECTED FILES
  hgext/releasenotes.py

CHANGE DETAILS

diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py
--- a/hgext/releasenotes.py
+++ b/hgext/releasenotes.py
@@ -25,6 +25,7 @@
 error,
 minirst,
 node,
+pycompat,
 registrar,
 scmutil,
 util,
@@ -570,6 +571,8 @@
 admonitions along with their title. This also includes the custom
 admonitions (if any).
 """
+
+opts = pycompat.byteskwargs(opts)
 sections = releasenotessections(ui, repo)
 
 listflag = opts.get('list')



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


D1320: py3: handle keyword arguments in hgext/keyword.py

2017-11-04 Thread pulkit (Pulkit Goyal)
pulkit 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/D1320

AFFECTED FILES
  hgext/keyword.py

CHANGE DETAILS

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -104,6 +104,7 @@
 match,
 patch,
 pathutil,
+pycompat,
 registrar,
 scmutil,
 templatefilters,
@@ -380,6 +381,7 @@
 '''Bails out if [keyword] configuration is not active.
 Returns status of working directory.'''
 if kwt:
+opts = pycompat.byteskwargs(opts)
 return repo.status(match=scmutil.match(wctx, pats, opts), clean=True,
unknown=opts.get('unknown') or opts.get('all'))
 if ui.configitems('keyword'):
@@ -436,24 +438,24 @@
 ui.setconfig('keywordset', 'svn', svn, 'keyword')
 
 uikwmaps = ui.configitems('keywordmaps')
-if args or opts.get('rcfile'):
+if args or opts.get(r'rcfile'):
 ui.status(_('\n\tconfiguration using custom keyword template maps\n'))
 if uikwmaps:
 ui.status(_('\textending current template maps\n'))
-if opts.get('default') or not uikwmaps:
+if opts.get(r'default') or not uikwmaps:
 if svn:
 ui.status(_('\toverriding default svn keywordset\n'))
 else:
 ui.status(_('\toverriding default cvs keywordset\n'))
-if opts.get('rcfile'):
+if opts.get(r'rcfile'):
 ui.readconfig(opts.get('rcfile'))
 if args:
 # simulate hgrc parsing
 rcmaps = '[keywordmaps]\n%s\n' % '\n'.join(args)
 repo.vfs.write('hgrc', rcmaps)
 ui.readconfig(repo.vfs.join('hgrc'))
 kwmaps = dict(ui.configitems('keywordmaps'))
-elif opts.get('default'):
+elif opts.get(r'default'):
 if svn:
 ui.status(_('\n\tconfiguration using default svn keywordset\n'))
 else:
@@ -543,6 +545,7 @@
 else:
 cwd = ''
 files = []
+opts = pycompat.byteskwargs(opts)
 if not opts.get('unknown') or opts.get('all'):
 files = sorted(status.modified + status.added + status.clean)
 kwfiles = kwt.iskwfile(files, wctx)



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


D1321: py3: handle keyword arguments in hgext/rebase.py

2017-11-04 Thread pulkit (Pulkit Goyal)
pulkit 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/D1321

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -43,6 +43,7 @@
 obsutil,
 patch,
 phases,
+pycompat,
 registrar,
 repair,
 revset,
@@ -698,6 +699,7 @@
 unresolved conflicts.
 
 """
+opts = pycompat.byteskwargs(opts)
 rbsrt = rebaseruntime(repo, ui, opts)
 
 with repo.wlock(), repo.lock():
@@ -1552,15 +1554,15 @@
 def pullrebase(orig, ui, repo, *args, **opts):
 'Call rebase after pull if the latter has been invoked with --rebase'
 ret = None
-if opts.get('rebase'):
+if opts.get(r'rebase'):
 if ui.configbool('commands', 'rebase.requiredest'):
 msg = _('rebase destination required by configuration')
 hint = _('use hg pull followed by hg rebase -d DEST')
 raise error.Abort(msg, hint=hint)
 
 with repo.wlock(), repo.lock():
-if opts.get('update'):
-del opts['update']
+if opts.get(r'update'):
+del opts[r'update']
 ui.debug('--update and --rebase are not compatible, ignoring '
  'the update flag\n')
 
@@ -1581,15 +1583,15 @@
 if revspostpull > revsprepull:
 # --rev option from pull conflict with rebase own --rev
 # dropping it
-if 'rev' in opts:
-del opts['rev']
+if r'rev' in opts:
+del opts[r'rev']
 # positional argument from pull conflicts with rebase's own
 # --source.
-if 'source' in opts:
-del opts['source']
+if r'source' in opts:
+del opts[r'source']
 # revsprepull is the len of the repo, not revnum of tip.
 destspace = list(repo.changelog.revs(start=revsprepull))
-opts['_destspace'] = destspace
+opts[r'_destspace'] = destspace
 try:
 rebase(ui, repo, **opts)
 except error.NoMergeDestAbort:
@@ -1603,7 +1605,7 @@
 # with warning and trumpets
 commands.update(ui, repo)
 else:
-if opts.get('tool'):
+if opts.get(r'tool'):
 raise error.Abort(_('--tool can only be used with --rebase'))
 ret = orig(ui, repo, *args, **opts)
 



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


D1318: py3: handle keyword arguments in hgext/histedit.py

2017-11-04 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -203,6 +203,7 @@
 mergeutil,
 node,
 obsolete,
+pycompat,
 registrar,
 repair,
 scmutil,
@@ -541,9 +542,9 @@
 def commitfunc(**kwargs):
 overrides = {('phases', 'new-commit'): phasemin}
 with repo.ui.configoverride(overrides, 'histedit'):
-extra = kwargs.get('extra', {}).copy()
+extra = kwargs.get(r'extra', {}).copy()
 extra['histedit_source'] = src.hex()
-kwargs['extra'] = extra
+kwargs[r'extra'] = extra
 return repo.commit(**kwargs)
 return commitfunc
 
@@ -1093,6 +1094,7 @@
 _('histedit requires exactly one ancestor revision'))
 
 def _histedit(ui, repo, state, *freeargs, **opts):
+opts = pycompat.byteskwargs(opts)
 goal = _getgoal(opts)
 revs = opts.get('rev', [])
 rules = opts.get('commands', '')



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


D1316: py3: handle keyword arguments in hgext/graphlog.py

2017-11-04 Thread pulkit (Pulkit Goyal)
pulkit 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/D1316

AFFECTED FILES
  hgext/graphlog.py

CHANGE DETAILS

diff --git a/hgext/graphlog.py b/hgext/graphlog.py
--- a/hgext/graphlog.py
+++ b/hgext/graphlog.py
@@ -66,5 +66,5 @@
 
 This is an alias to :hg:`log -G`.
 """
-opts['graph'] = True
+opts[r'graph'] = True
 return commands.log(ui, repo, *pats, **opts)



To: pulkit, #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] subrepo: config option to disable subrepositories

2017-11-04 Thread Adrian Buehlmann
On 2017-11-04 07:57, Yuya Nishihara wrote:
> On Fri, 03 Nov 2017 17:28:27 -0700, Gregory Szorc wrote:
>> # HG changeset patch
>> # User Gregory Szorc 
>> # Date 1509755155 25200
>> #  Fri Nov 03 17:25:55 2017 -0700
>> # Branch stable
>> # Node ID f2390c369bfebf32f26f5a2e4aa5620224a7c8ea
>> # Parent  f445b10dc7fb3495d24d1c22b0996148864c77f7
>> subrepo: config option to disable subrepositories
> 
>> +``enablesubrepos``
>> +Whether the subrepositories feature is enabled. If disabled,
>> +subrepositories are effectively ignored by the Mercurial client.
>> +(default: True)
> 
> We might want to select subrepo types to be enabled since hg subrepo is
> more widely used and considered less broken.
> 

After looking at subrepo.gitsubrepo._checkversion in the mercurial sources:

Assuming the problem is limited to specific vulnerable versions of
external scm tools:

Perhaps, this might be narrowed to requiring specific versions of git
and svn using a config knob (which defaults to the hard-coded values).
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] pathutil: add doctests for canonpath()

2017-11-04 Thread Yuya Nishihara
On Fri, 03 Nov 2017 23:26:40 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1509762170 14400
> #  Fri Nov 03 22:22:50 2017 -0400
> # Node ID 7d9abeb82f021b4b96162a719f4a44a0175c0828
> # Parent  3649c3f2cd90c8aec395ca8af5adae33defff12c
> pathutil: add doctests for canonpath()
> 
> This is a followup to f445b10dc7fb.  Since there's no way to ensure that more
> drive letters than C: exist, this seems like the only way to test it.  This is
> enough to catch the f445b10dc7fb scenario, as well as CWD outside of the repo
> when the path isn't prefixed with path/to/repo.

Maybe we can add an hghave rule to check if d: drive exists, is different from
the TESTTMP, and can chdir into it?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH STABLE] share: handle --relative shares to a different drive letter gracefully

2017-11-04 Thread Yuya Nishihara
On Fri, 03 Nov 2017 23:32:46 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1509681309 14400
> #  Thu Nov 02 23:55:09 2017 -0400
> # Branch stable
> # Node ID 1683556589d30268414b8f17c67919278aa997c7
> # Parent  f445b10dc7fb3495d24d1c22b0996148864c77f7
> share: handle --relative shares to a different drive letter gracefully

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


D1301: py3: handle keyword arguments in hgext/extdiff.py

2017-11-04 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa8bc191fee5a: py3: handle keyword arguments in 
hgext/extdiff.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1301?vs=3238=3275

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

AFFECTED FILES
  hgext/extdiff.py

CHANGE DETAILS

diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -338,6 +338,7 @@
 that revision is compared to the working directory, and, when no
 revisions are specified, the working directory files are compared
 to its parent.'''
+opts = pycompat.byteskwargs(opts)
 program = opts.get('program')
 option = opts.get('option')
 if not program:
@@ -369,6 +370,7 @@
 self._cmdline = cmdline
 
 def __call__(self, ui, repo, *pats, **opts):
+opts = pycompat.byteskwargs(opts)
 options = ' '.join(map(util.shellquote, opts['option']))
 if options:
 options = ' ' + options



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


D1298: py3: handle keyword arguments in hgext/children.py

2017-11-04 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG11a372d80496: py3: handle keyword arguments in 
hgext/children.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1298?vs=3235=3273

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

AFFECTED FILES
  hgext/children.py

CHANGE DETAILS

diff --git a/hgext/children.py b/hgext/children.py
--- a/hgext/children.py
+++ b/hgext/children.py
@@ -19,6 +19,7 @@
 from mercurial.i18n import _
 from mercurial import (
 cmdutil,
+pycompat,
 registrar,
 )
 
@@ -55,6 +56,7 @@
 See :hg:`help log` and :hg:`help revsets.children`.
 
 """
+opts = pycompat.byteskwargs(opts)
 rev = opts.get('rev')
 if file_:
 fctx = repo.filectx(file_, changeid=rev)



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


D1299: py3: handle keyword arguments in hgext/churn.py

2017-11-04 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG26ed66ab1e72: py3: handle keyword arguments in 
hgext/churn.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1299?vs=3236=3274

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

AFFECTED FILES
  hgext/churn.py

CHANGE DETAILS

diff --git a/hgext/churn.py b/hgext/churn.py
--- a/hgext/churn.py
+++ b/hgext/churn.py
@@ -19,6 +19,7 @@
 cmdutil,
 encoding,
 patch,
+pycompat,
 registrar,
 scmutil,
 util,
@@ -45,6 +46,7 @@
 
 def countrate(ui, repo, amap, *pats, **opts):
 """Calculate stats"""
+opts = pycompat.byteskwargs(opts)
 if opts.get('dateformat'):
 def getkey(ctx):
 t, tz = ctx.date()
@@ -154,7 +156,7 @@
 return s + " " * (l - encoding.colwidth(s))
 
 amap = {}
-aliases = opts.get('aliases')
+aliases = opts.get(r'aliases')
 if not aliases and os.path.exists(repo.wjoin('.hgchurn')):
 aliases = repo.wjoin('.hgchurn')
 if aliases:
@@ -172,7 +174,7 @@
 if not rate:
 return
 
-if opts.get('sort'):
+if opts.get(r'sort'):
 rate.sort()
 else:
 rate.sort(key=lambda x: (-sum(x[1]), x))
@@ -185,7 +187,7 @@
 ui.debug("assuming %i character terminal\n" % ttywidth)
 width = ttywidth - maxname - 2 - 2 - 2
 
-if opts.get('diffstat'):
+if opts.get(r'diffstat'):
 width -= 15
 def format(name, diffstat):
 added, removed = diffstat



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


D1303: py3: handle keyword arguments in hgext/gpg.py

2017-11-04 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGde1f045781e0: py3: handle keyword arguments in hgext/gpg.py 
(authored by pulkit, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D1303?vs=3240=3278#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1303?vs=3240=3278

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

AFFECTED FILES
  hgext/gpg.py

CHANGE DETAILS

diff --git a/hgext/gpg.py b/hgext/gpg.py
--- a/hgext/gpg.py
+++ b/hgext/gpg.py
@@ -106,7 +106,7 @@
 def newgpg(ui, **opts):
 """create a new gpg instance"""
 gpgpath = ui.config("gpg", "cmd")
-gpgkey = opts.get('key')
+gpgkey = opts.get(r'key')
 if not gpgkey:
 gpgkey = ui.config("gpg", "key")
 return gpg(gpgpath, gpgkey)
@@ -253,6 +253,7 @@
 
 def _dosign(ui, repo, *revs, **opts):
 mygpg = newgpg(ui, **opts)
+opts = pycompat.byteskwargs(opts)
 sigver = "0"
 sigmessage = ""
 
@@ -312,7 +313,8 @@
  % hgnode.short(n)
  for n in nodes])
 try:
-editor = cmdutil.getcommiteditor(editform='gpg.sign', **opts)
+editor = cmdutil.getcommiteditor(editform='gpg.sign',
+ **pycompat.strkwargs(opts))
 repo.commit(message, opts['user'], opts['date'], match=msigs,
 editor=editor)
 except ValueError as inst:



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


D1296: py3: handle keyword arguments in hgext/automv.py

2017-11-04 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG38637dd39cfd: py3: handle keyword arguments in 
hgext/automv.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1296?vs=3233=3271

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

AFFECTED FILES
  hgext/automv.py

CHANGE DETAILS

diff --git a/hgext/automv.py b/hgext/automv.py
--- a/hgext/automv.py
+++ b/hgext/automv.py
@@ -32,6 +32,7 @@
 copies,
 error,
 extensions,
+pycompat,
 registrar,
 scmutil,
 similar
@@ -53,6 +54,7 @@
 
 def mvcheck(orig, ui, repo, *pats, **opts):
 """Hook to check for moves at commit time"""
+opts = pycompat.byteskwargs(opts)
 renames = None
 disabled = opts.pop('no_automv', False)
 if not disabled:
@@ -68,7 +70,7 @@
 with repo.wlock():
 if renames is not None:
 scmutil._markchanges(repo, (), (), renames)
-return orig(ui, repo, *pats, **opts)
+return orig(ui, repo, *pats, **pycompat.strkwargs(opts))
 
 def _interestingfiles(repo, matcher):
 """Find what files were added or removed in this commit.



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


D1302: py3: handle keyword arguments in hgext/fetch.py

2017-11-04 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa56bf5591918: py3: handle keyword arguments in 
hgext/fetch.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1302?vs=3239=3277

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

AFFECTED FILES
  hgext/fetch.py

CHANGE DETAILS

diff --git a/hgext/fetch.py b/hgext/fetch.py
--- a/hgext/fetch.py
+++ b/hgext/fetch.py
@@ -19,6 +19,7 @@
 exchange,
 hg,
 lock,
+pycompat,
 registrar,
 util,
 )
@@ -60,6 +61,7 @@
 Returns 0 on success.
 '''
 
+opts = pycompat.byteskwargs(opts)
 date = opts.get('date')
 if date:
 opts['date'] = util.parsedate(date)



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


D1300: py3: handle keyword arguments in hgext/commitextras.py

2017-11-04 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG901a18b03e00: py3: handle keyword arguments in 
hgext/commitextras.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1300?vs=3237=3276

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

AFFECTED FILES
  hgext/commitextras.py

CHANGE DETAILS

diff --git a/hgext/commitextras.py b/hgext/commitextras.py
--- a/hgext/commitextras.py
+++ b/hgext/commitextras.py
@@ -46,7 +46,7 @@
 origcommit = repo.commit
 try:
 def _wrappedcommit(*innerpats, **inneropts):
-extras = opts.get('extra')
+extras = opts.get(r'extra')
 if extras:
 for raw in extras:
 if '=' not in raw:
@@ -65,7 +65,7 @@
 msg = _("key '%s' is used internally, can't be set "
 "manually")
 raise error.Abort(msg % k)
-inneropts['extra'][k] = v
+inneropts[r'extra'][k] = v
 return origcommit(*innerpats, **inneropts)
 
 # This __dict__ logic is needed because the normal



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


D1297: py3: handle keyword arguments in hgext/blackbox.py

2017-11-04 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG375577785f49: py3: handle keyword arguments in 
hgext/blackbox.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1297?vs=3234=3272

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

AFFECTED FILES
  hgext/blackbox.py

CHANGE DETAILS

diff --git a/hgext/blackbox.py b/hgext/blackbox.py
--- a/hgext/blackbox.py
+++ b/hgext/blackbox.py
@@ -226,7 +226,7 @@
 if not repo.vfs.exists('blackbox.log'):
 return
 
-limit = opts.get('limit')
+limit = opts.get(r'limit')
 fp = repo.vfs('blackbox.log', 'r')
 lines = fp.read().split('\n')
 



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


D1295: py3: handle keyword arguments in hgext/amend.py

2017-11-04 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3e549546a6e9: py3: handle keyword arguments in 
hgext/amend.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1295?vs=3232=3270

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

AFFECTED FILES
  hgext/amend.py

CHANGE DETAILS

diff --git a/hgext/amend.py b/hgext/amend.py
--- a/hgext/amend.py
+++ b/hgext/amend.py
@@ -17,6 +17,7 @@
 cmdutil,
 commands,
 error,
+pycompat,
 registrar,
 )
 
@@ -46,10 +47,11 @@
 
 See :hg:`help commit` for more details.
 """
+opts = pycompat.byteskwargs(opts)
 if len(opts['note']) > 255:
 raise error.Abort(_("cannot store a note of more than 255 bytes"))
 with repo.wlock(), repo.lock():
 if not opts.get('logfile'):
 opts['message'] = opts.get('message') or repo['.'].description()
 opts['amend'] = True
-return commands._docommit(ui, repo, *pats, **opts)
+return commands._docommit(ui, repo, *pats, **pycompat.strkwargs(opts))



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


D1293: rebase: use fm.formatlist() and fm.formatdict() to support user template

2017-11-04 Thread yuja (Yuya Nishihara)
yuja requested changes to this revision.
yuja added a comment.
This revision now requires changes to proceed.


  Can you add a test that should be fixed by this patch?
  Perhaps that will show we'll probably want to set the name of dict item pair
  other than the default 'key'/'value'.

INLINE COMMENTS

> rebase.py:1550
> +fd = fm.formatdict
> +nodechanges = fd({hf(oldn): fl([hf(n) for n in newn], 'succs')
> +  for oldn, newn in replacements.iteritems()})

The name argument is for each item, not for the list. Perhaps,
it should be name='node' (or name ='succ').

REPOSITORY
  rHG Mercurial

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

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


D974: py3: handle keyword arguments correctly in hgext/patchbomb.py

2017-11-04 Thread yuja (Yuya Nishihara)
yuja requested changes to this revision.
yuja added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> yuja wrote in patchbomb.py:618
> opts is modified here, but stropts isn't.  Perhaps we shouldn't
> keep the copy for long.

I think it's better to use a single bytes dict instead of managing
two copies carefully.

REPOSITORY
  rHG Mercurial

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

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


D1303: py3: handle keyword arguments in hgext/gpg.py

2017-11-04 Thread yuja (Yuya Nishihara)
yuja added inline comments.

INLINE COMMENTS

> gpg.py:317
> +editor = cmdutil.getcommiteditor(editform='gpg.sign',
> +**pycompat.byteskwargs(opts))
>  repo.commit(message, opts['user'], opts['date'], match=msigs,

Fixed this to call strkwargs().

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH v2] run-tests: allow automatic test discovery when providing folder as argument

2017-11-04 Thread Yuya Nishihara
On Sat, 04 Nov 2017 07:51:20 +0900, matthieu.laneuvi...@octobus.net wrote:
> # HG changeset patch
> # User Matthieu Laneuville 
> # Date 1508422437 -32400
> #  Thu Oct 19 23:13:57 2017 +0900
> # Node ID 223d34cb2d2a1c1c67053f4613cb76803a485573
> # Parent  7ebf850d3166a64ff33b4b85adb481b533ddbf86
> # EXP-Topic hg122
> run-tests: allow automatic test discovery when providing folder as argument

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


Re: [PATCH] subrepo: config option to disable subrepositories

2017-11-04 Thread Yuya Nishihara
On Fri, 03 Nov 2017 17:28:27 -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc 
> # Date 1509755155 25200
> #  Fri Nov 03 17:25:55 2017 -0700
> # Branch stable
> # Node ID f2390c369bfebf32f26f5a2e4aa5620224a7c8ea
> # Parent  f445b10dc7fb3495d24d1c22b0996148864c77f7
> subrepo: config option to disable subrepositories

> +``enablesubrepos``
> +Whether the subrepositories feature is enabled. If disabled,
> +subrepositories are effectively ignored by the Mercurial client.
> +(default: True)

We might want to select subrepo types to be enabled since hg subrepo is
more widely used and considered less broken.

> +TODO buggy because localrepository.commit() managed its file contents
> +  $ hg commit -m 'manually add .hgsubstate'
> +  nothing changed
> +  [1]
> +
> +... but hg commit --amend works (this relies on a regression in 4.4)
> +
> +  $ hg commit --amend
> +  saved backup bundle to 
> $TESTTMP/testrepo0/.hg/strip-backup/addf99df3e66-ab5c9ff8-amend.hg (glob)

Yeah, it's the issue5677.

https://bz.mercurial-scm.org/show_bug.cgi?id=5677
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] [v2] outgoing: respect ":pushurl" paths (issue5365)

2017-11-04 Thread Yuya Nishihara
On Fri, 3 Nov 2017 14:07:54 -0700, Hollis Blanchard wrote:
> # HG changeset patch
> # User Hollis Blanchard 
> # Date 1509731952 25200
> #  Fri Nov 03 10:59:12 2017 -0700
> # Branch stable
> # Node ID a952cae0303fa38d1b246561704071d41bbfa1ea
> # Parent  f445b10dc7fb3495d24d1c22b0996148864c77f7
> [v2] outgoing: respect ":pushurl" paths (issue5365)
> 
> Make 'hg outgoing' respect "paths.default:pushurl" in addition to
> "paths.default-push".
> 
> 'hg outgoing' has always meant "what will happen if I run 'hg push'?" and it's
> still documented that way:
> 
> Show changesets not found in the specified destination repository or the
> default push location. These are the changesets that would be pushed if a
> push was requested.
> 
> If the user uses the now-deprecated "paths.default-push" path, it continues to
> work that way. However, as described at
> https://bz.mercurial-scm.org/show_bug.cgi?id=5365, it doesn't behave the same
> with "paths.default:pushurl".
> 
> Why does it matter? Similar to the bugzilla reporter, I have a read-only 
> mirror
> of a non-Mercurial repository:
> 
>   upstream -> imported mirror -> user clone
>  ^---/
> 
> Users push directly to upstream, and that content is then imported into the
> mirror. However, those repositories are not the same; it's possible that the
> mirroring has either broken completely, or an import process is running and 
> not
> yet complete. In those cases, 'hg outgoing' will list changesets that have
> already been pushed.
> 
> Mozilla's desired behavior described in bug 5365 can be accomplished through
> other means (e.g. 'hg outgoing default'), preserving the consistency and
> meaning of 'hg outgoing'.

I heard from Greg that the current behavior was intentional.

https://bz.mercurial-scm.org/show_bug.cgi?id=5365#c3
https://www.mercurial-scm.org/pipermail/mercurial-devel/2014-September/062091.html

Just to be clear, I'm not against this patch, but this will be a breaking
change for some users.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel