D4530: narrow: drop support for remote expansion (BC)

2018-09-12 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG10a8472f6662: narrow: drop support for remote expansion 
(BC) (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4530?vs=10903=10921

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

AFFECTED FILES
  hgext/narrow/TODO.rst
  hgext/narrow/narrowcommands.py
  hgext/narrow/narrowwirepeer.py
  mercurial/narrowspec.py

CHANGE DETAILS

diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py
--- a/mercurial/narrowspec.py
+++ b/mercurial/narrowspec.py
@@ -146,9 +146,6 @@
 return matchmod.match(root, '', [], include=include or [],
   exclude=exclude or [])
 
-def needsexpansion(includes):
-return [i for i in includes if i.startswith('include:')]
-
 def load(repo):
 try:
 spec = repo.svfs.read(FILENAME)
diff --git a/hgext/narrow/narrowwirepeer.py b/hgext/narrow/narrowwirepeer.py
--- a/hgext/narrow/narrowwirepeer.py
+++ b/hgext/narrow/narrowwirepeer.py
@@ -7,41 +7,16 @@
 
 from __future__ import absolute_import
 
-from mercurial.i18n import _
 from mercurial import (
-error,
 extensions,
 hg,
-narrowspec,
-node,
 wireprotov1server,
 )
 
 NARROWCAP = 'exp-narrow-1'
 ELLIPSESCAP = 'exp-ellipses-1'
 
 def uisetup():
-def peersetup(ui, peer):
-# We must set up the expansion before reposetup below, since it's used
-# at clone time before we have a repo.
-class expandingpeer(peer.__class__):
-def expandnarrow(self, narrow_include, narrow_exclude, nodes):
-ui.status(_("expanding narrowspec\n"))
-if not self.capable('exp-expandnarrow'):
-raise error.Abort(
-'peer does not support expanding narrowspecs')
-
-hex_nodes = (node.hex(n) for n in nodes)
-new_narrowspec = self._call(
-'expandnarrow',
-includepats=','.join(narrow_include),
-excludepats=','.join(narrow_exclude),
-nodes=','.join(hex_nodes))
-
-return narrowspec.parseserverpatterns(new_narrowspec)
-peer.__class__ = expandingpeer
-hg.wirepeersetupfuncs.append(peersetup)
-
 extensions.wrapfunction(wireprotov1server, '_capabilities', addnarrowcap)
 
 def addnarrowcap(orig, repo, proto):
diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -62,25 +62,6 @@
 
 extensions.wrapcommand(commands.table, 'archive', archivenarrowcmd)
 
-def expandpull(pullop, includepats, excludepats):
-if not narrowspec.needsexpansion(includepats):
-return includepats, excludepats
-
-heads = pullop.heads or pullop.rheads
-includepats, excludepats = pullop.remote.expandnarrow(
-includepats, excludepats, heads)
-pullop.repo.ui.debug('Expanded narrowspec to inc=%s, exc=%s\n' % (
-includepats, excludepats))
-
-includepats = set(includepats)
-excludepats = set(excludepats)
-
-# Nefarious remote could supply unsafe patterns. Validate them.
-narrowspec.validatepatterns(includepats)
-narrowspec.validatepatterns(excludepats)
-
-return includepats, excludepats
-
 def clonenarrowcmd(orig, ui, repo, *args, **opts):
 """Wraps clone command, so 'hg clone' first wraps localrepo.clone()."""
 opts = pycompat.byteskwargs(opts)
@@ -116,10 +97,6 @@
 includepats = narrowspec.parsepatterns(opts['include'])
 excludepats = narrowspec.parsepatterns(opts['exclude'])
 
-# If necessary, ask the server to expand the narrowspec.
-includepats, excludepats = expandpull(
-pullop, includepats, excludepats)
-
 if not includepats and excludepats:
 # If nothing was included, we assume the user meant to include
 # everything, except what they asked to exclude.
@@ -292,10 +269,6 @@
 def _widen(ui, repo, remote, commoninc, newincludes, newexcludes):
 newmatch = narrowspec.match(repo.root, newincludes, newexcludes)
 
-# TODO(martinvonz): Get expansion working with widening/narrowing.
-if narrowspec.needsexpansion(newincludes):
-raise error.Abort('Expansion not yet supported on pull')
-
 def pullbundle2extraprepare_widen(orig, pullop, kwargs):
 orig(pullop, kwargs)
 # The old{in,ex}cludepats have already been set by orig()
@@ -402,9 +375,6 @@
 opts['addinclude'].extend(includepats)
 opts['addexclude'].extend(excludepats)
 
-if narrowspec.needsexpansion(opts['addinclude'] + opts['addexclude']):
-raise error.Abort('Expansion not yet supported on widen/narrow')
-
 addedincludes = narrowspec.parsepatterns(opts['addinclude'])
 removedincludes = 

D4532: narrow: set opts['narrow'] instead of local variable

2018-09-12 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4afd2af36456: narrow: set opts[narrow] instead 
of local variable (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4532?vs=10909=10922

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

AFFECTED FILES
  hgext/narrow/narrowcommands.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -66,7 +66,6 @@
 """Wraps clone command, so 'hg clone' first wraps localrepo.clone()."""
 opts = pycompat.byteskwargs(opts)
 wrappedextraprepare = util.nullcontextmanager()
-opts_narrow = opts['narrow']
 narrowspecfile = opts['narrowspec']
 
 if narrowspecfile:
@@ -87,11 +86,11 @@
 narrowspec.validatepatterns(excludes)
 
 # narrowspec is passed so we should assume that user wants narrow clone
-opts_narrow = True
+opts['narrow'] = True
 opts['include'].extend(includes)
 opts['exclude'].extend(excludes)
 
-if opts_narrow:
+if opts['narrow']:
 def pullbundle2extraprepare_widen(orig, pullop, kwargs):
 # Create narrow spec patterns from clone flags
 includepats = narrowspec.parsepatterns(opts['include'])
@@ -114,7 +113,7 @@
 '_pullbundle2extraprepare', pullbundle2extraprepare_widen)
 
 def pullnarrow(orig, repo, *args, **kwargs):
-if opts_narrow:
+if opts['narrow']:
 repo.requirements.add(repository.NARROW_REQUIREMENT)
 repo._writerequirements()
 



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


D4542: fastannotate: use repo.local()

2018-09-12 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2182e67ea912: fastannotate: use repo.local() (authored by 
indygreg, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D4542?vs=10919=10920#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4542?vs=10919=10920

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

AFFECTED FILES
  hgext/fastannotate/protocol.py

CHANGE DETAILS

diff --git a/hgext/fastannotate/protocol.py b/hgext/fastannotate/protocol.py
--- a/hgext/fastannotate/protocol.py
+++ b/hgext/fastannotate/protocol.py
@@ -14,7 +14,6 @@
 error,
 extensions,
 hg,
-localrepo,
 util,
 wireprotov1peer,
 wireprotov1server,
@@ -221,7 +220,7 @@
 
 def clientreposetup(ui, repo):
 _registerwireprotocommand()
-if isinstance(repo, localrepo.localrepository):
+if repo.local():
 localreposetup(ui, repo)
 # TODO: this mutates global state, but only if at least one repo
 # has the extension enabled. This is probably bad for hgweb.



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


D4542: fastannotate: use repo.local()

2018-09-12 Thread pulkit (Pulkit Goyal)
pulkit added inline comments.

INLINE COMMENTS

> protocol.py:17
>  hg,
>  localrepo,
>  util,

Dropped this import in flight to make pyflakes happy.

REPOSITORY
  rHG Mercurial

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

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


D4531: tests: drop extra "file:" prefix from paths in narrow test

2018-09-12 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  Yep they were added by mistake. Thanks for fixing.

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH STABLE] subrepo: mask out passwords embedded in the messages displaying a URL

2018-09-12 Thread Yuya Nishihara
On Tue, 11 Sep 2018 18:18:05 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1536688337 14400
> #  Tue Sep 11 13:52:17 2018 -0400
> # Branch stable
> # Node ID 41ac8ea1bdd751303e49d5a98def025f78dbbf0c
> # Parent  6af7765bdb7c88da8393cdddbe836989852b5a5f
> subrepo: mask out passwords embedded in the messages displaying a URL

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


[Bug 5984] New: Feature request: template for the `tag` commit message.

2018-09-12 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5984

Bug ID: 5984
   Summary: Feature request: template for the `tag` commit
message.
   Product: Mercurial
   Version: unspecified
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: jeber...@free.fr
CC: mercurial-devel@mercurial-scm.org

It would be nice if there was a way to replace the default commit message used
for `hg tag` including the tag and hash in the replaced message. I'm able to
get close to what I want by putting the following in my `.hgrc`:

[committemplate]
changeset.tag.add = "chore: Add tag TAG for changeset
{p1node|short}.\n\nHG:  >8
\n{diff()}"

[defaults]
tag = -e

However:
- This only works when tagging the current revision: if I use the `-r` option
to tag a different revision, then I get the wrong hash in the message.
- This requires me to replace "TAG" with the tag manually instead of having it
be filled automatically.

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