D98: revset: support reading aliases from a .hgrevsets file

2017-08-09 Thread quark (Jun Wu)
quark added a comment.


  Security-wise, the "shelling out revset" seems hard to solve cleanly. By 
having `%include ../hgrc` in `$REPO/.hg/hgrc`, we could already read config in 
working copy for a trusted repo today.
  
  It seems to me that a lot of security work (ex. knowing the "origin" when 
executing a revset, marking config items or sections as safe or unsafe by 
extensions) are required to be able to turn on this feature by default. If we 
don't turn this on by default because of security, the `%include ../hgrc` 
approach seems good enough for trusted repo today.

REPOSITORY
  rHG Mercurial

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

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


D30: merge: Removed sorting in casefolding detection, for a slight performance win

2017-08-09 Thread quark (Jun Wu)
quark added a comment.


  @durin42 The case-folding collision might be a small feature that Rust is 
meaningful.

INLINE COMMENTS

> merge.py:765
>  foldprefix = unfoldprefix = lastfull = ''
> -for fold, f in sorted(foldmap.items()):
> +for fold, f in foldmap.items():
>  if fold.startswith(foldprefix) and not f.startswith(unfoldprefix):

I think this would be incorrect, since `foldprefix` is mutated and used in the 
loop.

REPOSITORY
  rHG Mercurial

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

To: alex_gaynor, durin42, dsp
Cc: quark, krbullock, dsp, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D246: obsolete: rename precursor into predecessor in obsolete docstrings

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 708.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D246?vs=702=708

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

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
@@ -20,12 +20,12 @@
 besides old and news changeset identifiers, such as creation date or
 author name.
 
-The old obsoleted changeset is called a "precursor" and possible
+The old obsoleted changeset is called a "predecessor" and possible
 replacements are called "successors". Markers that used changeset X as
-a precursor are called "successor markers of X" because they hold
+a predecessor are called "successor markers of X" because they hold
 information about the successors of X. Markers that use changeset Y as
-a successors are call "precursor markers of Y" because they hold
-information about the precursors of Y.
+a successors are call "predecessor markers of Y" because they hold
+information about the predecessors of Y.
 
 Examples:
 
@@ -294,11 +294,11 @@
 #
 # - uint8: number of metadata entries M
 #
-# - 20 or 32 bytes: precursor changeset identifier.
+# - 20 or 32 bytes: predecessor changeset identifier.
 #
 # - N*(20 or 32) bytes: successors changesets identifiers.
 #
-# - P*(20 or 32) bytes: parents of the precursors changesets.
+# - P*(20 or 32) bytes: parents of the predecessors changesets.
 #
 # - M*(uint8, uint8): size of all metadata entries (key and value)
 #
@@ -506,18 +506,18 @@
 """Store obsolete markers
 
 Markers can be accessed with two mappings:
-- precursors[x] -> set(markers on precursors edges of x)
+- predecessors[x] -> set(markers on predecessors edges of x)
 - successors[x] -> set(markers on successors edges of x)
-- children[x]   -> set(markers on precursors edges of children(x)
+- children[x]   -> set(markers on predecessors edges of children(x)
 """
 
 fields = ('prec', 'succs', 'flag', 'meta', 'date', 'parents')
-# prec:nodeid, precursor changesets
+# prec:nodeid, predecessors changesets
 # succs:   tuple of nodeid, successor changesets (0-N length)
 # flag:integer, flag field carrying modifier for the markers (see doc)
 # meta:binary blob, encoded metadata dictionary
 # date:(float, int) tuple, date of marker creation
-# parents: (tuple of nodeid) or None, parents of precursors
+# parents: (tuple of nodeid) or None, parents of predecessors
 #  None is used when no data has been recorded
 
 def __init__(self, svfs, defaultformat=_fm1version, readonly=False):
@@ -707,7 +707,8 @@
 
 - marker that use this changeset as successor
 - prune marker of direct children on this changeset
-- recursive application of the two rules on precursors of these markers
+- recursive application of the two rules on predecessors of these
+  markers
 
 It is a set so you cannot rely on order."""
 
@@ -947,12 +948,12 @@
 rev = ctx.rev()
 # We only evaluate mutable, non-obsolete revision
 node = ctx.node()
-# (future) A cache of precursors may worth if split is very common
+# (future) A cache of predecessors may worth if split is very common
 for pnode in obsutil.allprecursors(repo.obsstore, [node],
ignoreflags=bumpedfix):
 prev = torev(pnode) # unfiltered! but so is phasecache
 if (prev is not None) and (phase(repo, prev) <= public):
-# we have a public precursor
+# we have a public predecessor
 bumped.add(rev)
 break # Next draft!
 return bumped



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


D247: obsutil: rename allprecursors into allpredecessors

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 709.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D247?vs=703=709

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

AFFECTED FILES
  contrib/phabricator.py
  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
@@ -102,7 +102,16 @@
 else:
 stack.append(precnodeid)
 
-def allprecursors(obsstore, nodes, ignoreflags=0):
+def allprecursors(*args, **kwargs):
+""" (DEPRECATED)
+"""
+msg = ("'obsutil.allprecursors' is deprecated, "
+   "use 'obsutil.allpredecessors'")
+util.nouideprecwarn(msg, '4.4')
+
+return allpredecessors(*args, **kwargs)
+
+def allpredecessors(obsstore, nodes, ignoreflags=0):
 """Yield node for every precursors of .
 
 Some precursors may be unknown locally.
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -949,7 +949,7 @@
 # We only evaluate mutable, non-obsolete revision
 node = ctx.node()
 # (future) A cache of predecessors may worth if split is very common
-for pnode in obsutil.allprecursors(repo.obsstore, [node],
+for pnode in obsutil.allpredecessors(repo.obsstore, [node],
ignoreflags=bumpedfix):
 prev = torev(pnode) # unfiltered! but so is phasecache
 if (prev is not None) and (phase(repo, prev) <= public):
diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -41,7 +41,7 @@
 encoding,
 error,
 mdiff,
-obsolete,
+obsutil,
 patch,
 registrar,
 scmutil,
@@ -167,7 +167,7 @@
 for node in nodelist:
 ctx = unfi[node]
 # For tags like "D123", put them into "toconfirm" to verify later
-precnodes = list(obsolete.allprecursors(unfi.obsstore, [node]))
+precnodes = list(obsutil.allpredecessors(unfi.obsstore, [node]))
 for n in precnodes:
 if n in nodemap:
 for tag in unfi.nodetags(n):



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


D242: context: rename troubled into isunstable

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 704.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D242?vs=700=704

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

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

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -680,7 +680,7 @@
 ctx = unfi[node]
 if ctx.obsolete():
 raise error.Abort(mso % ctx)
-elif ctx.troubled():
+elif ctx.isunstable():
 # TODO print more than one instability in the abort
 # message
 raise error.Abort(mst[ctx.instabilities()[0]] % ctx)
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -240,6 +240,12 @@
 return self.rev() in obsmod.getrevs(self._repo, 'divergent')
 
 def troubled(self):
+msg = ("'context.troubled' is deprecated, "
+   "use 'context.isunstable'")
+self._repo.ui.deprecwarn(msg, '4.4')
+return self.isunstable()
+
+def isunstable(self):
 """True if the changeset is either unstable, bumped or divergent"""
 return self.orphan() or self.phasedivergent() or 
self.contentdivergent()
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4849,7 +4849,7 @@
 ui.write(_(' (no revision checked out)'))
 if p.obsolete():
 ui.write(_(' (obsolete)'))
-if p.troubled():
+if p.isunstable():
 instabilities = (ui.label(instability, 'trouble.%s' % instability)
  for instability in p.instabilities())
 ui.write(' ('
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1464,7 +1464,7 @@
 labels = ['log.changeset', 'changeset.%s' % ctx.phasestr()]
 if ctx.obsolete():
 labels.append('changeset.obsolete')
-if ctx.troubled():
+if ctx.isunstable():
 labels.append('changeset.troubled')
 for instability in ctx.instabilities():
 labels.append('trouble.%s' % instability)
@@ -1577,7 +1577,7 @@
 self.ui.write(_("date:%s\n") % date,
   label='log.date')
 
-if ctx.troubled():
+if ctx.isunstable():
 # i18n: column positioning for "hg log"
 instabilities = ctx.instabilities()
 self.ui.write(_("instability: %s\n") % ', '.join(instabilities),



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


D243: obsmarker: rename precnode into prednode

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 705.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D243?vs=699=705

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

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/obsutil.py

CHANGE DETAILS

diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -9,6 +9,7 @@
 
 from . import (
 phases,
+util
 )
 
 class marker(object):
@@ -29,15 +30,21 @@
 return self._data == other._data
 
 def precnode(self):
-"""Precursor changeset node identifier"""
+msg = ("'marker.precnode' is deprecated, "
+   "use 'marker.precnode'")
+util.nouideprecwarn(msg, '4.4')
+return self.prednode()
+
+def prednode(self):
+"""Predecessor changeset node identifier"""
 return self._data[0]
 
 def succnodes(self):
 """List of successor changesets node identifiers"""
 return self._data[1]
 
 def parentnodes(self):
-"""Parents of the precursors (None if not recorded)"""
+"""Parents of the predecessors (None if not recorded)"""
 return self._data[5]
 
 def metadata(self):
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1913,7 +1913,7 @@
 To be used by debug function."""
 if index is not None:
 fm.write('index', '%i ', index)
-fm.write('precnode', '%s ', hex(marker.precnode()))
+fm.write('precnode', '%s ', hex(marker.prednode()))
 succs = marker.succnodes()
 fm.condwrite(succs, 'succnodes', '%s ',
  fm.formatlist(map(hex, succs), name='node'))



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


D245: obsstore: rename precursors into predecessors

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 707.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D245?vs=701=707

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

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
@@ -81,7 +81,7 @@
 considered missing.
 """
 
-precursors = repo.obsstore.precursors
+precursors = repo.obsstore.predecessors
 stack = [nodeid]
 seen = set(stack)
 
@@ -115,7 +115,7 @@
 while remaining:
 current = remaining.pop()
 yield current
-for mark in obsstore.precursors.get(current, ()):
+for mark in obsstore.predecessors.get(current, ()):
 # ignore marker flagged with specified flag
 if mark[2] & ignoreflags:
 continue
@@ -207,7 +207,7 @@
 
 # shortcut to various useful item
 nm = unfi.changelog.nodemap
-precursorsmarkers = unfi.obsstore.precursors
+precursorsmarkers = unfi.obsstore.predecessors
 successormarkers = unfi.obsstore.successors
 childrenmarkers = unfi.obsstore.children
 
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -665,8 +665,16 @@
 _addsuccessors(successors, self._all)
 return successors
 
+@property
+def precursors(self):
+msg = ("'obsstore.precursors' is deprecated, "
+   "use 'obsstore.predecessors'")
+util.nouideprecwarn(msg, '4.4')
+
+return self.predecessors
+
 @propertycache
-def precursors(self):
+def predecessors(self):
 predecessors = {}
 _addpredecessors(predecessors, self._all)
 return predecessors
@@ -686,8 +694,8 @@
 self._all.extend(markers)
 if self._cached('successors'):
 _addsuccessors(self.successors, markers)
-if self._cached('precursors'):
-_addpredecessors(self.precursors, markers)
+if self._cached('predecessors'):
+_addpredecessors(self.predecessors, markers)
 if self._cached('children'):
 _addchildren(self.children, markers)
 _checkinvalidmarkers(markers)
@@ -706,7 +714,7 @@
 pendingnodes = set(nodes)
 seenmarkers = set()
 seennodes = set(pendingnodes)
-precursorsmarkers = self.precursors
+precursorsmarkers = self.predecessors
 succsmarkers = self.successors
 children = self.children
 while pendingnodes:
@@ -957,7 +965,7 @@
 obsstore = repo.obsstore
 newermap = {}
 for ctx in repo.set('(not public()) - obsolete()'):
-mark = obsstore.precursors.get(ctx.node(), ())
+mark = obsstore.predecessors.get(ctx.node(), ())
 toprocess = set(mark)
 seen = set()
 while toprocess:
@@ -971,7 +979,7 @@
 if len(newer) > 1:
 divergent.add(ctx.rev())
 break
-toprocess.update(obsstore.precursors.get(prec, ()))
+toprocess.update(obsstore.predecessors.get(prec, ()))
 return divergent
 
 



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


D244: obsolete: rename _addprecursors into _addpredecessors

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 706.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D244?vs=698=706

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

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
@@ -470,11 +470,18 @@
 for mark in markers:
 successors.setdefault(mark[0], set()).add(mark)
 
+def _addprecursors(*args, **kwargs):
+msg = ("'obsolete._addprecursors' is deprecated, "
+   "use 'obsolete._addpredecessors'")
+util.nouideprecwarn(msg, '4.4')
+
+return _addpredecessors(*args, **kwargs)
+
 @util.nogc
-def _addprecursors(precursors, markers):
+def _addpredecessors(predecessors, markers):
 for mark in markers:
 for suc in mark[1]:
-precursors.setdefault(suc, set()).add(mark)
+predecessors.setdefault(suc, set()).add(mark)
 
 @util.nogc
 def _addchildren(children, markers):
@@ -660,9 +667,9 @@
 
 @propertycache
 def precursors(self):
-precursors = {}
-_addprecursors(precursors, self._all)
-return precursors
+predecessors = {}
+_addpredecessors(predecessors, self._all)
+return predecessors
 
 @propertycache
 def children(self):
@@ -680,7 +687,7 @@
 if self._cached('successors'):
 _addsuccessors(self.successors, markers)
 if self._cached('precursors'):
-_addprecursors(self.precursors, markers)
+_addpredecessors(self.precursors, markers)
 if self._cached('children'):
 _addchildren(self.children, markers)
 _checkinvalidmarkers(markers)



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


Re: D242: context: rename troubled into isunstable

2017-08-09 Thread Boris Feld
On Wed, 2017-08-09 at 12:32 -0400, Brandon McCaig wrote:
> On Wed, Aug 09, 2017 at 03:37:26PM +, lothiraldan (Boris Feld)
> wrote:
> > diff --git a/mercurial/context.py b/mercurial/context.py ---
> > a/mercurial/context.py +++ b/mercurial/context.py @@ -240,6
> > +240,12 @@ return self.rev() in obsmod.getrevs(self._repo,
> > 'divergent')
> >  
> >  def troubled(self):
> > +msg = ("'context.troubled' is deprecated, "
> > +   "use 'context.isunstable'")
> > +self._repo.ui.deprecwarn(msg, '4.4')
> > +return self.unstable()
> 
> Maybe I'm missing something, but shouldn't this be:
> 
> return self.isunstable()
> 
> It sounded like context.unstable() has a different purpose and so
> troubled was renamed to isunstable and so troubled() itself
> should also be calling isunstable().

Yes, you are right. I am sending a fix right now on phabricator. Thank
you for the catch.

> 
> > +
> > +def isunstable(self):
> >  """True if the changeset is either unstable, bumped or
> > divergent"""
> >  return self.orphan() or self.phasedivergent() or
> > self.contentdivergent()
> 
> Regards,
> 
> 
> ___
> 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


Re: D242: context: rename troubled into isunstable

2017-08-09 Thread Brandon McCaig
On Wed, Aug 09, 2017 at 03:37:26PM +, lothiraldan (Boris Feld) wrote:
> diff --git a/mercurial/context.py b/mercurial/context.py ---
> a/mercurial/context.py +++ b/mercurial/context.py @@ -240,6
> +240,12 @@ return self.rev() in obsmod.getrevs(self._repo,
> 'divergent')
>  
>  def troubled(self):
> +msg = ("'context.troubled' is deprecated, "
> +   "use 'context.isunstable'")
> +self._repo.ui.deprecwarn(msg, '4.4')
> +return self.unstable()

Maybe I'm missing something, but shouldn't this be:

return self.isunstable()

It sounded like context.unstable() has a different purpose and so
troubled was renamed to isunstable and so troubled() itself
should also be calling isunstable().

> +
> +def isunstable(self):
>  """True if the changeset is either unstable, bumped or divergent"""
>  return self.orphan() or self.phasedivergent() or 
> self.contentdivergent()

Regards,


-- 
Brandon McCaig  
Castopulence Software 
Blog 
perl -E '$_=q{V zrna gur orfg jvgu jung V fnl. }.
q{Vg qbrfa'\''g nyjnlf fbhaq gung jnl.};
tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/;say'



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


D299: pycompat: introduce a wrapper for __builtins__.{raw_,}input()

2017-08-09 Thread yuja (Yuya Nishihara)
yuja added inline comments.

INLINE COMMENTS

> pycompat.py:84
> +setattr(sys, stream, noclosetextio(s))
> +return bytestr(input(*args, **kwargs))
> +finally:

Needs to specify encoding because user input may contain
non-ascii characters.

Perhaps it should be `noclosetextio(s, encoding=encoding.encoding)` and
`encoding.strtolocal(input(...))`.
Alternatively, forcing `latin-1` might work, but I'm not sure.

> ui.py:1222
>  with self.timeblockedsection('stdio'):
> -line = raw_input(' ')
> +line = pycompat.bytesinput(r' ')
>  sys.stdin = oldin

I think it's better to specify input and output explicitly.

`bytesinput(..., self.fin, self.fout)`

Setting BytesIO to `sys.stdin/stdout` is just plain wrong on Python 3.

REPOSITORY
  rHG Mercurial

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

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


D238: context: rename troubles into instabilities

2017-08-09 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGab0c55c2ad9a: context: rename troubles into instabilities 
(authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D238?vs=664=694

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

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/commands.py
  mercurial/context.py
  mercurial/exchange.py
  mercurial/templatekw.py

CHANGE DETAILS

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -783,7 +783,7 @@
 (EXPERIMENTAL)
 """
 args = pycompat.byteskwargs(args)
-return showlist('trouble', args['ctx'].troubles(), args)
+return showlist('trouble', args['ctx'].instabilities(), args)
 
 # tell hggettext to extract docstrings from these functions:
 i18nfunctions = keywords.values()
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -681,7 +681,9 @@
 if ctx.obsolete():
 raise error.Abort(mso % ctx)
 elif ctx.troubled():
-raise error.Abort(mst[ctx.troubles()[0]] % ctx)
+# TODO print more than one instability in the abort
+# message
+raise error.Abort(mst[ctx.instabilities()[0]] % ctx)
 
 discovery.checkheads(pushop)
 return True
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -226,21 +226,38 @@
 return self.unstable() or self.bumped() or self.divergent()
 
 def troubles(self):
-"""return the list of troubles affecting this changesets.
+"""Keep the old version around in order to avoid breaking extensions
+about different return values.
+"""
+msg = ("'context.troubles' is deprecated, "
+   "use 'context.instabilities'")
+self._repo.ui.deprecwarn(msg, '4.4')
 
-Troubles are returned as strings. possible values are:
+troubles = []
+if self.unstable():
+troubles.append('orphan')
+if self.bumped():
+troubles.append('bumped')
+if self.divergent():
+troubles.append('divergent')
+return troubles
+
+def instabilities(self):
+"""return the list of instabilities affecting this changeset.
+
+Instabilities are returned as strings. possible values are:
 - orphan,
 - phase-divergent,
 - content-divergent.
 """
-troubles = []
+instabilities = []
 if self.unstable():
-troubles.append('orphan')
+instabilities.append('orphan')
 if self.bumped():
-troubles.append('phase-divergent')
+instabilities.append('phase-divergent')
 if self.divergent():
-troubles.append('content-divergent')
-return troubles
+instabilities.append('content-divergent')
+return instabilities
 
 def parents(self):
 """return contexts for each parent changeset"""
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4850,9 +4850,10 @@
 if p.obsolete():
 ui.write(_(' (obsolete)'))
 if p.troubled():
+instabilities = (ui.label(instability, 'trouble.%s' % instability)
+ for instability in p.instabilities())
 ui.write(' ('
- + ', '.join(ui.label(trouble, 'trouble.%s' % trouble)
- for trouble in p.troubles())
+ + ', '.join(instabilities)
  + ')')
 ui.write('\n')
 if p.description():
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1466,8 +1466,8 @@
 labels.append('changeset.obsolete')
 if ctx.troubled():
 labels.append('changeset.troubled')
-for trouble in ctx.troubles():
-labels.append('trouble.%s' % trouble)
+for instability in ctx.instabilities():
+labels.append('trouble.%s' % instability)
 return ' '.join(labels)
 
 class changeset_printer(object):
@@ -1579,7 +1579,8 @@
 
 if ctx.troubled():
 # i18n: column positioning for "hg log"
-self.ui.write(_("instability: %s\n") % ', '.join(ctx.troubles()),
+instabilities = ctx.instabilities()
+self.ui.write(_("instability: %s\n") % ', '.join(instabilities),
   label='log.trouble')
 
 self._exthook(ctx)



To: lothiraldan, #hg-reviewers, indygreg
Cc: durin42, indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org

D242: context: rename troubled into isunstable

2017-08-09 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG52c5ff856b49: context: rename troubled into isunstable 
(authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D242?vs=665=700

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

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

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -680,7 +680,7 @@
 ctx = unfi[node]
 if ctx.obsolete():
 raise error.Abort(mso % ctx)
-elif ctx.troubled():
+elif ctx.isunstable():
 # TODO print more than one instability in the abort
 # message
 raise error.Abort(mst[ctx.instabilities()[0]] % ctx)
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -240,6 +240,12 @@
 return self.rev() in obsmod.getrevs(self._repo, 'divergent')
 
 def troubled(self):
+msg = ("'context.troubled' is deprecated, "
+   "use 'context.isunstable'")
+self._repo.ui.deprecwarn(msg, '4.4')
+return self.unstable()
+
+def isunstable(self):
 """True if the changeset is either unstable, bumped or divergent"""
 return self.orphan() or self.phasedivergent() or 
self.contentdivergent()
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4849,7 +4849,7 @@
 ui.write(_(' (no revision checked out)'))
 if p.obsolete():
 ui.write(_(' (obsolete)'))
-if p.troubled():
+if p.isunstable():
 instabilities = (ui.label(instability, 'trouble.%s' % instability)
  for instability in p.instabilities())
 ui.write(' ('
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1464,7 +1464,7 @@
 labels = ['log.changeset', 'changeset.%s' % ctx.phasestr()]
 if ctx.obsolete():
 labels.append('changeset.obsolete')
-if ctx.troubled():
+if ctx.isunstable():
 labels.append('changeset.troubled')
 for instability in ctx.instabilities():
 labels.append('trouble.%s' % instability)
@@ -1577,7 +1577,7 @@
 self.ui.write(_("date:%s\n") % date,
   label='log.date')
 
-if ctx.troubled():
+if ctx.isunstable():
 # i18n: column positioning for "hg log"
 instabilities = ctx.instabilities()
 self.ui.write(_("instability: %s\n") % ', '.join(instabilities),



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


D243: obsmarker: rename precnode into prednode

2017-08-09 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2cb442bc1a76: obsmarker: rename precnode into prednode 
(authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D243?vs=588=699

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

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/obsutil.py

CHANGE DETAILS

diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -9,6 +9,7 @@
 
 from . import (
 phases,
+util
 )
 
 class marker(object):
@@ -29,15 +30,21 @@
 return self._data == other._data
 
 def precnode(self):
-"""Precursor changeset node identifier"""
+msg = ("'marker.precnode' is deprecated, "
+   "use 'marker.precnode'")
+util.nouideprecwarn(msg, '4.4')
+return self.prednode()
+
+def prednode(self):
+"""Predecessor changeset node identifier"""
 return self._data[0]
 
 def succnodes(self):
 """List of successor changesets node identifiers"""
 return self._data[1]
 
 def parentnodes(self):
-"""Parents of the precursors (None if not recorded)"""
+"""Parents of the predecessors (None if not recorded)"""
 return self._data[5]
 
 def metadata(self):
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1913,7 +1913,7 @@
 To be used by debug function."""
 if index is not None:
 fm.write('index', '%i ', index)
-fm.write('precnode', '%s ', hex(marker.precnode()))
+fm.write('precnode', '%s ', hex(marker.prednode()))
 succs = marker.succnodes()
 fm.condwrite(succs, 'succnodes', '%s ',
  fm.formatlist(map(hex, succs), name='node'))



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


D247: obsutil: rename allprecursors into allpredecessors

2017-08-09 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe6d8ee3c9ec3: obsutil: rename allprecursors into 
allpredecessors (authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D247?vs=592=703

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

AFFECTED FILES
  contrib/phabricator.py
  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
@@ -102,7 +102,16 @@
 else:
 stack.append(precnodeid)
 
-def allprecursors(obsstore, nodes, ignoreflags=0):
+def allprecursors(*args, **kwargs):
+""" (DEPRECATED)
+"""
+msg = ("'obsutil.allprecursors' is deprecated, "
+   "use 'obsutil.allpredecessors'")
+util.nouideprecwarn(msg, '4.4')
+
+return allpredecessors(*args, **kwargs)
+
+def allpredecessors(obsstore, nodes, ignoreflags=0):
 """Yield node for every precursors of .
 
 Some precursors may be unknown locally.
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -949,7 +949,7 @@
 # We only evaluate mutable, non-obsolete revision
 node = ctx.node()
 # (future) A cache of predecessors may worth if split is very common
-for pnode in obsutil.allprecursors(repo.obsstore, [node],
+for pnode in obsutil.allpredecessors(repo.obsstore, [node],
ignoreflags=bumpedfix):
 prev = torev(pnode) # unfiltered! but so is phasecache
 if (prev is not None) and (phase(repo, prev) <= public):
diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -41,7 +41,7 @@
 encoding,
 error,
 mdiff,
-obsolete,
+obsutil,
 patch,
 registrar,
 scmutil,
@@ -167,7 +167,7 @@
 for node in nodelist:
 ctx = unfi[node]
 # For tags like "D123", put them into "toconfirm" to verify later
-precnodes = list(obsolete.allprecursors(unfi.obsstore, [node]))
+precnodes = list(obsutil.allpredecessors(unfi.obsstore, [node]))
 for n in precnodes:
 if n in nodemap:
 for tag in unfi.nodetags(n):



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


D246: obsolete: rename precursor into predecessor in obsolete docstrings

2017-08-09 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0c3112f17610: obsolete: rename precursor into predecessor 
in obsolete docstrings (authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D246?vs=591=702

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

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
@@ -20,12 +20,12 @@
 besides old and news changeset identifiers, such as creation date or
 author name.
 
-The old obsoleted changeset is called a "precursor" and possible
+The old obsoleted changeset is called a "predecessor" and possible
 replacements are called "successors". Markers that used changeset X as
-a precursor are called "successor markers of X" because they hold
+a predecessor are called "successor markers of X" because they hold
 information about the successors of X. Markers that use changeset Y as
-a successors are call "precursor markers of Y" because they hold
-information about the precursors of Y.
+a successors are call "predecessor markers of Y" because they hold
+information about the predecessors of Y.
 
 Examples:
 
@@ -294,11 +294,11 @@
 #
 # - uint8: number of metadata entries M
 #
-# - 20 or 32 bytes: precursor changeset identifier.
+# - 20 or 32 bytes: predecessor changeset identifier.
 #
 # - N*(20 or 32) bytes: successors changesets identifiers.
 #
-# - P*(20 or 32) bytes: parents of the precursors changesets.
+# - P*(20 or 32) bytes: parents of the predecessors changesets.
 #
 # - M*(uint8, uint8): size of all metadata entries (key and value)
 #
@@ -506,18 +506,18 @@
 """Store obsolete markers
 
 Markers can be accessed with two mappings:
-- precursors[x] -> set(markers on precursors edges of x)
+- predecessors[x] -> set(markers on predecessors edges of x)
 - successors[x] -> set(markers on successors edges of x)
-- children[x]   -> set(markers on precursors edges of children(x)
+- children[x]   -> set(markers on predecessors edges of children(x)
 """
 
 fields = ('prec', 'succs', 'flag', 'meta', 'date', 'parents')
-# prec:nodeid, precursor changesets
+# prec:nodeid, predecessors changesets
 # succs:   tuple of nodeid, successor changesets (0-N length)
 # flag:integer, flag field carrying modifier for the markers (see doc)
 # meta:binary blob, encoded metadata dictionary
 # date:(float, int) tuple, date of marker creation
-# parents: (tuple of nodeid) or None, parents of precursors
+# parents: (tuple of nodeid) or None, parents of predecessors
 #  None is used when no data has been recorded
 
 def __init__(self, svfs, defaultformat=_fm1version, readonly=False):
@@ -707,7 +707,8 @@
 
 - marker that use this changeset as successor
 - prune marker of direct children on this changeset
-- recursive application of the two rules on precursors of these markers
+- recursive application of the two rules on predecessors of these
+  markers
 
 It is a set so you cannot rely on order."""
 
@@ -947,12 +948,12 @@
 rev = ctx.rev()
 # We only evaluate mutable, non-obsolete revision
 node = ctx.node()
-# (future) A cache of precursors may worth if split is very common
+# (future) A cache of predecessors may worth if split is very common
 for pnode in obsutil.allprecursors(repo.obsstore, [node],
ignoreflags=bumpedfix):
 prev = torev(pnode) # unfiltered! but so is phasecache
 if (prev is not None) and (phase(repo, prev) <= public):
-# we have a public precursor
+# we have a public predecessor
 bumped.add(rev)
 break # Next draft!
 return bumped



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


D241: context: rename bumped into phasedivergent

2017-08-09 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG8413cbeae275: context: rename bumped into phasedivergent 
(authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D241?vs=622=697

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -214,6 +214,12 @@
 return self.rev() in obsmod.getrevs(self._repo, 'unstable')
 
 def bumped(self):
+msg = ("'context.bumped' is deprecated, "
+   "use 'context.phasedivergent'")
+self._repo.ui.deprecwarn(msg, '4.4')
+return self.phasedivergent()
+
+def phasedivergent(self):
 """True if the changeset try to be a successor of a public changeset
 
 Only non-public and non-obsolete changesets may be bumped.
@@ -235,7 +241,7 @@
 
 def troubled(self):
 """True if the changeset is either unstable, bumped or divergent"""
-return self.orphan() or self.bumped() or self.contentdivergent()
+return self.orphan() or self.phasedivergent() or 
self.contentdivergent()
 
 def troubles(self):
 """Keep the old version around in order to avoid breaking extensions
@@ -248,7 +254,7 @@
 troubles = []
 if self.orphan():
 troubles.append('orphan')
-if self.bumped():
+if self.phasedivergent():
 troubles.append('bumped')
 if self.contentdivergent():
 troubles.append('divergent')
@@ -265,7 +271,7 @@
 instabilities = []
 if self.orphan():
 instabilities.append('orphan')
-if self.bumped():
+if self.phasedivergent():
 instabilities.append('phase-divergent')
 if self.contentdivergent():
 instabilities.append('content-divergent')



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


D244: obsolete: rename _addprecursors into _addpredecessors

2017-08-09 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG32d4f815c4f4: obsolete: rename _addprecursors into 
_addpredecessors (authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D244?vs=589=698

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

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
@@ -470,11 +470,18 @@
 for mark in markers:
 successors.setdefault(mark[0], set()).add(mark)
 
+def _addprecursors(*args, **kwargs):
+msg = ("'obsolete._addprecursors' is deprecated, "
+   "use 'obsolete._addpredecessors'")
+util.nouideprecwarn(msg, '4.4')
+
+return _addpredecessors(*args, **kwargs)
+
 @util.nogc
-def _addprecursors(precursors, markers):
+def _addpredecessors(predecessors, markers):
 for mark in markers:
 for suc in mark[1]:
-precursors.setdefault(suc, set()).add(mark)
+predecessors.setdefault(suc, set()).add(mark)
 
 @util.nogc
 def _addchildren(children, markers):
@@ -660,9 +667,9 @@
 
 @propertycache
 def precursors(self):
-precursors = {}
-_addprecursors(precursors, self._all)
-return precursors
+predecessors = {}
+_addpredecessors(predecessors, self._all)
+return predecessors
 
 @propertycache
 def children(self):
@@ -680,7 +687,7 @@
 if self._cached('successors'):
 _addsuccessors(self.successors, markers)
 if self._cached('precursors'):
-_addprecursors(self.precursors, markers)
+_addpredecessors(self.precursors, markers)
 if self._cached('children'):
 _addchildren(self.children, markers)
 _checkinvalidmarkers(markers)



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


D239: context: rename unstable into orphan

2017-08-09 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
lothiraldan marked an inline comment as done.
Closed by commit rHGf163edb45c47: context: rename unstable into orphan 
(authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D239?vs=623=695

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -204,6 +204,12 @@
 return self.rev() in obsmod.getrevs(self._repo, 'extinct')
 
 def unstable(self):
+msg = ("'context.unstable' is deprecated, "
+   "use 'context.orphan'")
+self._repo.ui.deprecwarn(msg, '4.4')
+return self.orphan()
+
+def orphan(self):
 """True if the changeset is not obsolete but it's ancestor are"""
 return self.rev() in obsmod.getrevs(self._repo, 'unstable')
 
@@ -223,7 +229,7 @@
 
 def troubled(self):
 """True if the changeset is either unstable, bumped or divergent"""
-return self.unstable() or self.bumped() or self.divergent()
+return self.orphan() or self.bumped() or self.divergent()
 
 def troubles(self):
 """Keep the old version around in order to avoid breaking extensions
@@ -234,7 +240,7 @@
 self._repo.ui.deprecwarn(msg, '4.4')
 
 troubles = []
-if self.unstable():
+if self.orphan():
 troubles.append('orphan')
 if self.bumped():
 troubles.append('bumped')
@@ -251,7 +257,7 @@
 - content-divergent.
 """
 instabilities = []
-if self.unstable():
+if self.orphan():
 instabilities.append('orphan')
 if self.bumped():
 instabilities.append('phase-divergent')



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


D291: repair: refactor broken linkrev collection

2017-08-09 Thread durham (Durham Goode)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6626d12e7a85: repair: refactor broken linkrev collection 
(authored by durham).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D291?vs=661=692

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

AFFECTED FILES
  mercurial/repair.py

CHANGE DETAILS

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -67,16 +67,20 @@
 
 return sorted(files)
 
+def _collectrevlog(revlog, striprev):
+_, brokenset = revlog.getstrippoint(striprev)
+return [revlog.linkrev(r) for r in brokenset]
+
+def _collectmanifest(repo, striprev):
+return _collectrevlog(repo.manifestlog._revlog, striprev)
+
 def _collectbrokencsets(repo, files, striprev):
 """return the changesets which will be broken by the truncation"""
 s = set()
-def collectone(revlog):
-_, brokenset = revlog.getstrippoint(striprev)
-s.update([revlog.linkrev(r) for r in brokenset])
 
-collectone(repo.manifestlog._revlog)
+s.update(_collectmanifest(repo, striprev))
 for fname in files:
-collectone(repo.file(fname))
+s.update(_collectrevlog(repo.file(fname), striprev))
 
 return s
 



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


D240: context: rename divergent into contentdivergent

2017-08-09 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG8b2d7684407b: context: rename divergent into 
contentdivergent (authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D240?vs=621=696

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -221,15 +221,21 @@
 return self.rev() in obsmod.getrevs(self._repo, 'bumped')
 
 def divergent(self):
+msg = ("'context.divergent' is deprecated, "
+   "use 'context.contentdivergent'")
+self._repo.ui.deprecwarn(msg, '4.4')
+return self.contentdivergent()
+
+def contentdivergent(self):
 """Is a successors of a changeset with multiple possible successors set
 
 Only non-public and non-obsolete changesets may be divergent.
 """
 return self.rev() in obsmod.getrevs(self._repo, 'divergent')
 
 def troubled(self):
 """True if the changeset is either unstable, bumped or divergent"""
-return self.orphan() or self.bumped() or self.divergent()
+return self.orphan() or self.bumped() or self.contentdivergent()
 
 def troubles(self):
 """Keep the old version around in order to avoid breaking extensions
@@ -244,7 +250,7 @@
 troubles.append('orphan')
 if self.bumped():
 troubles.append('bumped')
-if self.divergent():
+if self.contentdivergent():
 troubles.append('divergent')
 return troubles
 
@@ -261,7 +267,7 @@
 instabilities.append('orphan')
 if self.bumped():
 instabilities.append('phase-divergent')
-if self.divergent():
+if self.contentdivergent():
 instabilities.append('content-divergent')
 return instabilities
 



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


D292: repair: move manifest strip to a separate function

2017-08-09 Thread durham (Durham Goode)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG86ea201eaeb9: repair: move manifest strip to a separate 
function (authored by durham).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D292?vs=662=693

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

AFFECTED FILES
  mercurial/repair.py

CHANGE DETAILS

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -178,16 +178,13 @@
 tmpbundlefile = _bundle(repo, savebases, saveheads, node, 'temp',
 compress=False, obsolescence=False)
 
-mfst = repo.manifestlog._revlog
-
 try:
 with repo.transaction("strip") as tr:
 offset = len(tr.entries)
 
 tr.startgroup()
 cl.strip(striprev, tr)
-mfst.strip(striprev, tr)
-striptrees(repo, tr, striprev, files)
+stripmanifest(repo, striprev, tr, files)
 
 for fn in files:
 repo.file(fn).strip(striprev, tr)
@@ -314,6 +311,11 @@
 callback.topic = topic
 callback.addnodes(nodelist)
 
+def stripmanifest(repo, striprev, tr, files):
+revlog = repo.manifestlog._revlog
+revlog.strip(striprev, tr)
+striptrees(repo, tr, striprev, files)
+
 def striptrees(repo, tr, striprev, files):
 if 'treemanifest' in repo.requirements: # safe but unnecessary
 # otherwise



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


D294: tests: clean up many print statements to be print functions instead

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG24849d53697d: tests: clean up many print statements to be 
print functions instead (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D294?vs=677=689

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

AFFECTED FILES
  tests/test-commit-interactive-curses.t
  tests/test-commit-multiple.t
  tests/test-contrib-check-code.t
  tests/test-convert-cvs.t
  tests/test-eol.t
  tests/test-extension.t
  tests/test-filebranch.t
  tests/test-glog.t
  tests/test-hardlinks.t
  tests/test-help.t
  tests/test-hook.t
  tests/test-inherit-mode.t
  tests/test-issue4074.t
  tests/test-largefiles-cache.t
  tests/test-log.t
  tests/test-merge-symlinks.t
  tests/test-merge1.t
  tests/test-merge6.t
  tests/test-mq-eol.t
  tests/test-notify-changegroup.t

CHANGE DETAILS

diff --git a/tests/test-notify-changegroup.t b/tests/test-notify-changegroup.t
--- a/tests/test-notify-changegroup.t
+++ b/tests/test-notify-changegroup.t
@@ -39,7 +39,7 @@
 push
 
   $ hg --traceback --cwd b push ../a 2>&1 |
-  > $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", 
sys.stdin.read()),'
+  > $PYTHON -c 'from __future__ import print_function ; import sys,re; 
print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
   pushing to ../a
   searching for changes
   adding changesets
@@ -92,7 +92,7 @@
 unbundle with correct source
 
   $ hg --config notify.sources=unbundle --cwd a unbundle ../test.hg 2>&1 |
-  > $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", 
sys.stdin.read()),'
+  > $PYTHON -c 'from __future__ import print_function ; import sys,re; 
print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
   adding changesets
   adding manifests
   adding file changes
@@ -167,7 +167,7 @@
 push
 
   $ hg --traceback --cwd b --config notify.fromauthor=True push ../a 2>&1 |
-  > $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", 
sys.stdin.read()),'
+  > $PYTHON -c 'from __future__ import print_function ; import sys,re; 
print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
   pushing to ../a
   searching for changes
   adding changesets
diff --git a/tests/test-mq-eol.t b/tests/test-mq-eol.t
--- a/tests/test-mq-eol.t
+++ b/tests/test-mq-eol.t
@@ -33,7 +33,7 @@
   > for line in file(sys.argv[1], 'rb'):
   > line = line.replace('\r', '')
   > line = line.replace('\n', '')
-  > print line
+  > print(line)
   > EOF
 
   $ hg init repo
diff --git a/tests/test-merge6.t b/tests/test-merge6.t
--- a/tests/test-merge6.t
+++ b/tests/test-merge6.t
@@ -1,6 +1,6 @@
   $ cat < merge
   > import sys, os
-  > print "merging for", os.path.basename(sys.argv[1])
+  > print("merging for", os.path.basename(sys.argv[1]))
   > EOF
   $ HGMERGE="$PYTHON ../merge"; export HGMERGE
 
diff --git a/tests/test-merge1.t b/tests/test-merge1.t
--- a/tests/test-merge1.t
+++ b/tests/test-merge1.t
@@ -1,4 +1,5 @@
   $ cat < merge
+  > from __future__ import print_function
   > import sys, os
   > 
   > try:
@@ -8,7 +9,7 @@
   > except ImportError:
   > pass
   > 
-  > print "merging for", os.path.basename(sys.argv[1])
+  > print("merging for", os.path.basename(sys.argv[1]))
   > EOF
   $ HGMERGE="$PYTHON ../merge"; export HGMERGE
 
diff --git a/tests/test-merge-symlinks.t b/tests/test-merge-symlinks.t
--- a/tests/test-merge-symlinks.t
+++ b/tests/test-merge-symlinks.t
@@ -1,5 +1,6 @@
   $ cat > echo.py < #!$PYTHON
+  > from __future__ import print_function
   > import os, sys
   > try:
   > import msvcrt
@@ -9,7 +10,7 @@
   > pass
   > 
   > for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
-  > print k, os.environ[k]
+  > print(k, os.environ[k])
   > EOF
 
 Create 2 heads containing the same file, once as
diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -1793,7 +1793,7 @@
   $ cd problematicencoding
 
   $ $PYTHON > setup.sh < print u'''
+  > print(u'''
   > echo a > text
   > hg add text
   > hg --encoding utf-8 commit -u '\u30A2' -m none
@@ -1803,21 +1803,21 @@
   > hg --encoding utf-8 commit -u none -m '\u30A2'
   > echo d > text
   > hg --encoding utf-8 commit -u none -m '\u30C2'
-  > '''.encode('utf-8')
+  > '''.encode('utf-8'))
   > EOF
   $ sh < setup.sh
 
 test in problematic encoding
   $ $PYTHON > test.sh < print u'''
+  > print(u'''
   > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
   > echo 
   > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
   > echo 
   > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
   > echo 
   > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
-  > '''.encode('cp932')
+  > '''.encode('cp932'))
   > EOF
   $ sh < test.sh
   0
diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t
--- a/tests/test-largefiles-cache.t
+++ b/tests/test-largefiles-cache.t
@@ -96,7 +96,7 @@
   > #!$PYTHON
   > 

D297: tests: update duplicateoptions test to use bytestrings everywhere

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5b2f331d0a33: tests: update duplicateoptions test to use 
bytestrings everywhere (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D297?vs=680=691

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

AFFECTED FILES
  tests/test-duplicateoptions.py

CHANGE DETAILS

diff --git a/tests/test-duplicateoptions.py b/tests/test-duplicateoptions.py
--- a/tests/test-duplicateoptions.py
+++ b/tests/test-duplicateoptions.py
@@ -6,18 +6,18 @@
 ui as uimod,
 )
 
-ignore = {'highlight', 'win32text', 'factotum'}
+ignore = {b'highlight', b'win32text', b'factotum'}
 
 if os.name != 'nt':
-ignore.add('win32mbcs')
+ignore.add(b'win32mbcs')
 
 disabled = [ext for ext in extensions.disabled().keys() if ext not in ignore]
 
-hgrc = open(os.environ["HGRCPATH"], 'w')
-hgrc.write('[extensions]\n')
+hgrc = open(os.environ["HGRCPATH"], 'wb')
+hgrc.write(b'[extensions]\n')
 
 for ext in disabled:
-hgrc.write(ext + '=\n')
+hgrc.write(ext + b'=\n')
 
 hgrc.close()
 
@@ -30,7 +30,7 @@
 option[0] and globalshort.add(option[0])
 option[1] and globallong.add(option[1])
 
-for cmd, entry in commands.table.iteritems():
+for cmd, entry in commands.table.items():
 seenshort = globalshort.copy()
 seenlong = globallong.copy()
 for option in entry[1]:



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


D295: extensions: attempt to use non-deprecated inspect method

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG62fbe95075d3: extensions: attempt to use non-deprecated 
inspect method (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D295?vs=678=690

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

AFFECTED FILES
  mercurial/extensions.py

CHANGE DETAILS

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -186,7 +186,11 @@
 try:
 extsetup(ui)
 except TypeError:
-if inspect.getargspec(extsetup).args:
+# Try to use getfullargspec (Python 3) first, and fall
+# back to getargspec only if it doesn't exist so as to
+# avoid warnings.
+if getattr(inspect, 'getfullargspec',
+   getattr(inspect, 'getargspec'))(extsetup).args:
 raise
 extsetup() # old extsetup with no ui argument
 except Exception as inst:



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


D293: tests: fix simple heredoc print statements to work on Py3

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG27fb986e54d0: tests: fix simple heredoc print statements to 
work on Py3 (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D293?vs=676=688

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

AFFECTED FILES
  tests/test-hgweb-no-path-info.t
  tests/test-hgweb-no-request-uri.t
  tests/test-hgweb-non-interactive.t
  tests/test-repair-strip.t

CHANGE DETAILS

diff --git a/tests/test-repair-strip.t b/tests/test-repair-strip.t
--- a/tests/test-repair-strip.t
+++ b/tests/test-repair-strip.t
@@ -4,7 +4,7 @@
   > import sys
   > for entry in sys.stdin.read().split('\n'):
   > if entry:
-  > print entry.split('\x00')[0]
+  > print(entry.split('\x00')[0])
   > EOF
 
   $ echo "[extensions]" >> $HGRCPATH
diff --git a/tests/test-hgweb-non-interactive.t 
b/tests/test-hgweb-non-interactive.t
--- a/tests/test-hgweb-non-interactive.t
+++ b/tests/test-hgweb-non-interactive.t
@@ -41,11 +41,11 @@
   > output = stringio()
   > 
   > def startrsp(status, headers):
-  > print ' STATUS'
-  > print status
-  > print ' HEADERS'
-  > print [i for i in headers if i[0] != 'ETag']
-  > print ' DATA'
+  > print(' STATUS')
+  > print(status)
+  > print(' HEADERS')
+  > print([i for i in headers if i[0] != 'ETag'])
+  > print(' DATA')
   > return output.write
   > 
   > env = {
@@ -68,13 +68,13 @@
   > i = hgweb('.')
   > for c in i(env, startrsp):
   > pass
-  > print ' ERRORS'
-  > print errors.getvalue()
-  > print ' OS.ENVIRON wsgi variables'
-  > print sorted([x for x in os.environ if x.startswith('wsgi')])
-  > print ' request.ENVIRON wsgi variables'
+  > print(' ERRORS')
+  > print(errors.getvalue())
+  > print(' OS.ENVIRON wsgi variables')
+  > print(sorted([x for x in os.environ if x.startswith('wsgi')]))
+  > print(' request.ENVIRON wsgi variables')
   > with i._obtainrepo() as repo:
-  > print sorted([x for x in repo.ui.environ if x.startswith('wsgi')])
+  > print(sorted([x for x in repo.ui.environ if x.startswith('wsgi')]))
   > EOF
   $ $PYTHON request.py
    STATUS
diff --git a/tests/test-hgweb-no-request-uri.t 
b/tests/test-hgweb-no-request-uri.t
--- a/tests/test-hgweb-no-request-uri.t
+++ b/tests/test-hgweb-no-request-uri.t
@@ -31,11 +31,11 @@
   > input = stringio()
   > 
   > def startrsp(status, headers):
-  > print ' STATUS'
-  > print status
-  > print ' HEADERS'
-  > print [i for i in headers if i[0] != 'ETag']
-  > print ' DATA'
+  > print(' STATUS')
+  > print(status)
+  > print(' HEADERS')
+  > print([i for i in headers if i[0] != 'ETag'])
+  > print(' DATA')
   > return output.write
   > 
   > env = {
@@ -58,8 +58,8 @@
   > sys.stdout.write(output.getvalue())
   > sys.stdout.write(''.join(content))
   > getattr(content, 'close', lambda : None)()
-  > print ' ERRORS'
-  > print errors.getvalue()
+  > print(' ERRORS')
+  > print(errors.getvalue())
   > 
   > output = stringio()
   > env['PATH_INFO'] = '/'
diff --git a/tests/test-hgweb-no-path-info.t b/tests/test-hgweb-no-path-info.t
--- a/tests/test-hgweb-no-path-info.t
+++ b/tests/test-hgweb-no-path-info.t
@@ -31,11 +31,11 @@
   > input = stringio()
   > 
   > def startrsp(status, headers):
-  > print ' STATUS'
-  > print status
-  > print ' HEADERS'
-  > print [i for i in headers if i[0] != 'ETag']
-  > print ' DATA'
+  > print(' STATUS')
+  > print(status)
+  > print(' HEADERS')
+  > print([i for i in headers if i[0] != 'ETag'])
+  > print(' DATA')
   > return output.write
   > 
   > env = {
@@ -59,8 +59,8 @@
   > sys.stdout.write(output.getvalue())
   > sys.stdout.write(''.join(content))
   > getattr(content, 'close', lambda : None)()
-  > print ' ERRORS'
-  > print errors.getvalue()
+  > print(' ERRORS')
+  > print(errors.getvalue())
   > 
   > output = stringio()
   > env['QUERY_STRING'] = 'style=atom'



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


D296: extensions: if on py3 and propname is a bytestr, decode as ascii

2017-08-09 Thread yuja (Yuya Nishihara)
yuja added inline comments.

INLINE COMMENTS

> extensions.py:388
> +if pycompat.ispy3 and isinstance(propname, bytes):
> +propname = propname.decode('ascii')
>  assert callable(wrapper)

`pycompat.sysstr()` ?

> extensions.py:401
>  raise AttributeError(
>  _("type '%s' has no property '%s'") % (cls, propname))
>  

Perhaps this shouldn't be bytes. Needs `r''` and drop `_()`.

REPOSITORY
  rHG Mercurial

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

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


D303: bundle2: fix transaction availability detection

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Changeset 
https://phab.mercurial-scm.org/rHG5fc4ddfbe62601613ad68bcfa194c209ccf2fd30 
introduce more complex logic around
  'bundleoperation.gettransaction'. In that process it turns the old "attribute"
  into a proper method which breaks the code that detects the "transaction
  availability".
  
  The change was visible in 'test-acl.t', fixing this reverts the test changes.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/bundle2.py
  tests/test-acl.t

CHANGE DETAILS

diff --git a/tests/test-acl.t b/tests/test-acl.t
--- a/tests/test-acl.t
+++ b/tests/test-acl.t
@@ -120,7 +120,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: with-transaction
+  bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -184,7 +184,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: with-transaction
+  bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -259,7 +259,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: with-transaction
+  bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -742,7 +742,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: with-transaction
+  bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -1056,7 +1056,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: with-transaction
+  bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -1141,7 +1141,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: with-transaction
+  bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -1298,7 +1298,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: with-transaction
+  bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -1502,7 +1502,7 @@
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: with-transaction
+  bundle2-input-bundle: no-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
@@ -1798,7 +1798,7 @@
   bundle2-output-part: "reply:changegroup" 

D271: obsolete: use bytes() instead of str() so the node is bytes on py3

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
durin42 marked an inline comment as done.
Closed by commit rHG388901a15bfa: obsolete: use bytes() instead of str() so the 
node is bytes on py3 (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D271?vs=675=686

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

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
@@ -583,7 +583,7 @@
 
 metadata = tuple(sorted(metadata.iteritems()))
 
-marker = (str(prec), tuple(succs), int(flag), metadata, date, parents)
+marker = (bytes(prec), tuple(succs), int(flag), metadata, date, 
parents)
 return bool(self.add(transaction, [marker]))
 
 def add(self, transaction, markers):



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


D302: python3: whitelist another *13* tests that now pass

2017-08-09 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/D302

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -17,6 +17,7 @@
 test-doctest.py
 test-duplicateoptions.py
 test-empty-dir.t
+test-empty.t
 test-excessive-merge.t
 test-hghave.t
 test-issue1089.t
@@ -29,9 +30,21 @@
 test-merge-default.t
 test-merge2.t
 test-merge5.t
+test-push-checkheads-pruned-B1.t
+test-push-checkheads-pruned-B6.t
+test-push-checkheads-pruned-B7.t
+test-push-checkheads-superceed-A1.t
+test-push-checkheads-superceed-A4.t
+test-push-checkheads-superceed-A5.t
+test-push-checkheads-superceed-A8.t
+test-push-checkheads-unpushed-D1.t
+test-push-checkheads-unpushed-D6.t
+test-push-checkheads-unpushed-D7.t
+test-rename.t
 test-revlog-packentry.t
 test-run-tests.py
 test-terse-status.t
 test-unified-test.t
+test-update-dest.t
 test-update-reverse.t
 test-xdg.t



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


D294: tests: clean up many print statements to be print functions instead

2017-08-09 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/D294

AFFECTED FILES
  tests/test-commit-interactive-curses.t
  tests/test-commit-multiple.t
  tests/test-contrib-check-code.t
  tests/test-convert-cvs.t
  tests/test-eol.t
  tests/test-extension.t
  tests/test-filebranch.t
  tests/test-glog.t
  tests/test-hardlinks.t
  tests/test-help.t
  tests/test-hook.t
  tests/test-inherit-mode.t
  tests/test-issue4074.t
  tests/test-largefiles-cache.t
  tests/test-log.t
  tests/test-merge-symlinks.t
  tests/test-merge1.t
  tests/test-merge6.t
  tests/test-mq-eol.t
  tests/test-notify-changegroup.t

CHANGE DETAILS

diff --git a/tests/test-notify-changegroup.t b/tests/test-notify-changegroup.t
--- a/tests/test-notify-changegroup.t
+++ b/tests/test-notify-changegroup.t
@@ -39,7 +39,7 @@
 push
 
   $ hg --traceback --cwd b push ../a 2>&1 |
-  > $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", 
sys.stdin.read()),'
+  > $PYTHON -c 'from __future__ import print_function ; import sys,re; 
print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
   pushing to ../a
   searching for changes
   adding changesets
@@ -92,7 +92,7 @@
 unbundle with correct source
 
   $ hg --config notify.sources=unbundle --cwd a unbundle ../test.hg 2>&1 |
-  > $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", 
sys.stdin.read()),'
+  > $PYTHON -c 'from __future__ import print_function ; import sys,re; 
print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
   adding changesets
   adding manifests
   adding file changes
@@ -167,7 +167,7 @@
 push
 
   $ hg --traceback --cwd b --config notify.fromauthor=True push ../a 2>&1 |
-  > $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", 
sys.stdin.read()),'
+  > $PYTHON -c 'from __future__ import print_function ; import sys,re; 
print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
   pushing to ../a
   searching for changes
   adding changesets
diff --git a/tests/test-mq-eol.t b/tests/test-mq-eol.t
--- a/tests/test-mq-eol.t
+++ b/tests/test-mq-eol.t
@@ -33,7 +33,7 @@
   > for line in file(sys.argv[1], 'rb'):
   > line = line.replace('\r', '')
   > line = line.replace('\n', '')
-  > print line
+  > print(line)
   > EOF
 
   $ hg init repo
diff --git a/tests/test-merge6.t b/tests/test-merge6.t
--- a/tests/test-merge6.t
+++ b/tests/test-merge6.t
@@ -1,6 +1,6 @@
   $ cat < merge
   > import sys, os
-  > print "merging for", os.path.basename(sys.argv[1])
+  > print("merging for", os.path.basename(sys.argv[1]))
   > EOF
   $ HGMERGE="$PYTHON ../merge"; export HGMERGE
 
diff --git a/tests/test-merge1.t b/tests/test-merge1.t
--- a/tests/test-merge1.t
+++ b/tests/test-merge1.t
@@ -1,4 +1,5 @@
   $ cat < merge
+  > from __future__ import print_function
   > import sys, os
   > 
   > try:
@@ -8,7 +9,7 @@
   > except ImportError:
   > pass
   > 
-  > print "merging for", os.path.basename(sys.argv[1])
+  > print("merging for", os.path.basename(sys.argv[1]))
   > EOF
   $ HGMERGE="$PYTHON ../merge"; export HGMERGE
 
diff --git a/tests/test-merge-symlinks.t b/tests/test-merge-symlinks.t
--- a/tests/test-merge-symlinks.t
+++ b/tests/test-merge-symlinks.t
@@ -1,5 +1,6 @@
   $ cat > echo.py < #!$PYTHON
+  > from __future__ import print_function
   > import os, sys
   > try:
   > import msvcrt
@@ -9,7 +10,7 @@
   > pass
   > 
   > for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
-  > print k, os.environ[k]
+  > print(k, os.environ[k])
   > EOF
 
 Create 2 heads containing the same file, once as
diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -1793,7 +1793,7 @@
   $ cd problematicencoding
 
   $ $PYTHON > setup.sh < print u'''
+  > print(u'''
   > echo a > text
   > hg add text
   > hg --encoding utf-8 commit -u '\u30A2' -m none
@@ -1803,21 +1803,21 @@
   > hg --encoding utf-8 commit -u none -m '\u30A2'
   > echo d > text
   > hg --encoding utf-8 commit -u none -m '\u30C2'
-  > '''.encode('utf-8')
+  > '''.encode('utf-8'))
   > EOF
   $ sh < setup.sh
 
 test in problematic encoding
   $ $PYTHON > test.sh < print u'''
+  > print(u'''
   > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
   > echo 
   > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
   > echo 
   > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
   > echo 
   > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
-  > '''.encode('cp932')
+  > '''.encode('cp932'))
   > EOF
   $ sh < test.sh
   0
diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t
--- a/tests/test-largefiles-cache.t
+++ b/tests/test-largefiles-cache.t
@@ -96,7 +96,7 @@
   > #!$PYTHON
   > import sys, os
   > path = sys.argv[1]
-  > print '%03o' % (os.lstat(path).st_mode & 0777)
+  > print('%03o' % (os.lstat(path).st_mode & 0777))
   > EOF
   $ chmod +x 

D271: obsolete: use bytes() instead of str() so the node is bytes on py3

2017-08-09 Thread durin42 (Augie Fackler)
durin42 marked an inline comment as done.
durin42 added inline comments.

INLINE COMMENTS

> yuja wrote in obsolete.py:587
> Why can't this be just `bytes(prec)` ?
> 
> I don't think `str(prec).encode('ascii')` is valid for binary node id.

I swear that didn't work before. But it does work, so yay!

REPOSITORY
  rHG Mercurial

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

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


D300: python3: whitelist two more passing tests

2017-08-09 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/D300

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -25,11 +25,13 @@
 test-locate.t
 test-lrucachedict.py
 test-manifest.py
+test-match.py
 test-merge-default.t
 test-merge2.t
 test-merge5.t
 test-revlog-packentry.t
 test-run-tests.py
+test-terse-status.t
 test-unified-test.t
 test-update-reverse.t
 test-xdg.t



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


D301: scmutil: use util.shellquote instead of %r

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

REVISION SUMMARY
  Changes some output, but also resolves differences with Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/scmutil.py
  tests/test-add.t
  tests/test-copy.t
  tests/test-rename.t

CHANGE DETAILS

diff --git a/tests/test-rename.t b/tests/test-rename.t
--- a/tests/test-rename.t
+++ b/tests/test-rename.t
@@ -12,7 +12,7 @@
 
   $ hg rename d1/d11/a1 d2/c
   $ hg --config ui.portablefilenames=abort rename d1/a d1/con.xml
-  abort: filename contains 'con', which is reserved on Windows: 'd1/con.xml'
+  abort: filename contains 'con', which is reserved on Windows: d1/con.xml
   [255]
   $ hg sum
   parent: 0:9b4b6e7b2c26 tip
diff --git a/tests/test-copy.t b/tests/test-copy.t
--- a/tests/test-copy.t
+++ b/tests/test-copy.t
@@ -15,7 +15,7 @@
   $ hg status
   $ hg copy a b
   $ hg --config ui.portablefilenames=abort copy a con.xml
-  abort: filename contains 'con', which is reserved on Windows: 'con.xml'
+  abort: filename contains 'con', which is reserved on Windows: con.xml
   [255]
   $ hg status
   A b
diff --git a/tests/test-add.t b/tests/test-add.t
--- a/tests/test-add.t
+++ b/tests/test-add.t
@@ -44,14 +44,14 @@
   abort: ui.portablefilenames value is invalid ('jump')
   [255]
   $ hg --config ui.portablefilenames=abort add con.xml
-  abort: filename contains 'con', which is reserved on Windows: 'con.xml'
+  abort: filename contains 'con', which is reserved on Windows: con.xml
   [255]
   $ hg st
   A a
   A b
   ? con.xml
   $ hg add con.xml
-  warning: filename contains 'con', which is reserved on Windows: 'con.xml'
+  warning: filename contains 'con', which is reserved on Windows: con.xml
   $ hg st
   A a
   A b
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -273,7 +273,7 @@
 if abort or warn:
 msg = util.checkwinfilename(f)
 if msg:
-msg = "%s: %r" % (msg, f)
+msg = "%s: %s" % (msg, util.shellquote(f))
 if abort:
 raise error.Abort(msg)
 ui.warn(_("warning: %s\n") % msg)



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


D299: pycompat: introduce a wrapper for __builtins__.{raw_,}input()

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

REVISION SUMMARY
  In order to make this work, we have to wrap the io streams in a
  TextIOWrapper so that __builtins__.input() can do unicode IO on Python
  
  3. We can't just restore the original (unicode) sys.std* because we
  
  might be running a cmdserver, and if we blindly restore sys.* to the
  original values then we end up breaking the cmdserver. Sadly,
  TextIOWrapper tries to close the underlying stream during its __del__,
  so we have to make a sublcass to prevent that.
  
  If you see errors like:
  
  TypeError: a bytes-like object is required, not 'str'
  
  On an input() or print() call on Python 3, the substitution of
  sys.std* is probably the root cause.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/hgk.py
  mercurial/pycompat.py
  mercurial/ui.py

CHANGE DETAILS

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1219,7 +1219,7 @@
 # prompt ' ' must exist; otherwise readline may delete entire line
 # - http://bugs.python.org/issue12833
 with self.timeblockedsection('stdio'):
-line = raw_input(' ')
+line = pycompat.bytesinput(r' ')
 sys.stdin = oldin
 sys.stdout = oldout
 
diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -69,6 +69,23 @@
 stdout = sys.stdout.buffer
 stderr = sys.stderr.buffer
 
+class noclosetextio(io.TextIOWrapper):
+def __del__(self):
+"""Override __del__ so it doesn't close the underlying stream."""
+
+def bytesinput(*args, **kwargs):
+origs = {}
+try:
+for stream in 'stdin stdout stderr'.split():
+s = getattr(sys, stream)
+origs[stream] = s
+if not isinstance(s, io.TextIOBase):
+setattr(sys, stream, noclosetextio(s))
+return bytestr(input(*args, **kwargs))
+finally:
+for stream, restore in origs.items():
+setattr(sys, stream, restore)
+
 # Since Python 3 converts argv to wchar_t type by Py_DecodeLocale() on 
Unix,
 # we can use os.fsencode() to get back bytes argv.
 #
@@ -303,6 +320,7 @@
 stdin = sys.stdin
 stdout = sys.stdout
 stderr = sys.stderr
+bytesinput = raw_input
 if getattr(sys, 'argv', None) is not None:
 sysargv = sys.argv
 sysplatform = sys.platform
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,
 )
@@ -96,7 +97,7 @@
 while True:
 if opts['stdin']:
 try:
-line = raw_input().split(' ')
+line = pycompat.bytesinput().split(' ')
 node1 = line[0]
 if len(line) > 1:
 node2 = line[1]
@@ -177,7 +178,7 @@
 prefix = ""
 if opts['stdin']:
 try:
-(type, r) = raw_input().split(' ')
+(type, r) = pycompat.bytesinput().split(' ')
 prefix = ""
 except EOFError:
 return
@@ -195,7 +196,7 @@
 catcommit(ui, repo, n, prefix)
 if opts['stdin']:
 try:
-(type, r) = raw_input().split(' ')
+(type, r) = pycompat.bytesinput().split(' ')
 except EOFError:
 break
 else:



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


D298: python3: whitelist two more passing tests

2017-08-09 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/D298

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -15,8 +15,10 @@
 test-diff-subdir.t
 test-dirstate-nonnormalset.t
 test-doctest.py
+test-duplicateoptions.py
 test-empty-dir.t
 test-excessive-merge.t
+test-hghave.t
 test-issue1089.t
 test-issue1993.t
 test-issue842.t



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


D295: extensions: attempt to use non-deprecated inspect method

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

REVISION SUMMARY
  Avoids some deprecation warnings when extension loading breaks.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/extensions.py

CHANGE DETAILS

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -186,7 +186,11 @@
 try:
 extsetup(ui)
 except TypeError:
-if inspect.getargspec(extsetup).args:
+# Try to use getfullargspec (Python 3) first, and fall
+# back to getargspec only if it doesn't exist so as to
+# avoid warnings.
+if getattr(inspect, 'getfullargspec',
+   getattr(inspect, 'getargspec'))(extsetup).args:
 raise
 extsetup() # old extsetup with no ui argument
 except Exception as inst:



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


D296: extensions: if on py3 and propname is a bytestr, decode as ascii

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

REVISION SUMMARY
  Property names are unicodes on Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/extensions.py

CHANGE DETAILS

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -384,6 +384,8 @@
 
 These can't be wrapped using the normal wrapfunction.
 """
+if pycompat.ispy3 and isinstance(propname, bytes):
+propname = propname.decode('ascii')
 assert callable(wrapper)
 for currcls in cls.__mro__:
 if propname in currcls.__dict__:



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


D297: tests: update duplicateoptions test to use bytestrings everywhere

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

REVISION SUMMARY
  Test now passes on Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-duplicateoptions.py

CHANGE DETAILS

diff --git a/tests/test-duplicateoptions.py b/tests/test-duplicateoptions.py
--- a/tests/test-duplicateoptions.py
+++ b/tests/test-duplicateoptions.py
@@ -6,18 +6,18 @@
 ui as uimod,
 )
 
-ignore = {'highlight', 'win32text', 'factotum'}
+ignore = {b'highlight', b'win32text', b'factotum'}
 
 if os.name != 'nt':
-ignore.add('win32mbcs')
+ignore.add(b'win32mbcs')
 
 disabled = [ext for ext in extensions.disabled().keys() if ext not in ignore]
 
-hgrc = open(os.environ["HGRCPATH"], 'w')
-hgrc.write('[extensions]\n')
+hgrc = open(os.environ["HGRCPATH"], 'wb')
+hgrc.write(b'[extensions]\n')
 
 for ext in disabled:
-hgrc.write(ext + '=\n')
+hgrc.write(ext + b'=\n')
 
 hgrc.close()
 
@@ -30,7 +30,7 @@
 option[0] and globalshort.add(option[0])
 option[1] and globallong.add(option[1])
 
-for cmd, entry in commands.table.iteritems():
+for cmd, entry in commands.table.items():
 seenshort = globalshort.copy()
 seenlong = globallong.copy()
 for option in entry[1]:



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


D293: tests: fix simple heredoc print statements to work on Py3

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

REVISION SUMMARY
  There are a handful left that require some more care.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-hgweb-no-path-info.t
  tests/test-hgweb-no-request-uri.t
  tests/test-hgweb-non-interactive.t
  tests/test-repair-strip.t

CHANGE DETAILS

diff --git a/tests/test-repair-strip.t b/tests/test-repair-strip.t
--- a/tests/test-repair-strip.t
+++ b/tests/test-repair-strip.t
@@ -4,7 +4,7 @@
   > import sys
   > for entry in sys.stdin.read().split('\n'):
   > if entry:
-  > print entry.split('\x00')[0]
+  > print(entry.split('\x00')[0])
   > EOF
 
   $ echo "[extensions]" >> $HGRCPATH
diff --git a/tests/test-hgweb-non-interactive.t 
b/tests/test-hgweb-non-interactive.t
--- a/tests/test-hgweb-non-interactive.t
+++ b/tests/test-hgweb-non-interactive.t
@@ -41,11 +41,11 @@
   > output = stringio()
   > 
   > def startrsp(status, headers):
-  > print ' STATUS'
-  > print status
-  > print ' HEADERS'
-  > print [i for i in headers if i[0] != 'ETag']
-  > print ' DATA'
+  > print(' STATUS')
+  > print(status)
+  > print(' HEADERS')
+  > print([i for i in headers if i[0] != 'ETag'])
+  > print(' DATA')
   > return output.write
   > 
   > env = {
@@ -68,13 +68,13 @@
   > i = hgweb('.')
   > for c in i(env, startrsp):
   > pass
-  > print ' ERRORS'
-  > print errors.getvalue()
-  > print ' OS.ENVIRON wsgi variables'
-  > print sorted([x for x in os.environ if x.startswith('wsgi')])
-  > print ' request.ENVIRON wsgi variables'
+  > print(' ERRORS')
+  > print(errors.getvalue())
+  > print(' OS.ENVIRON wsgi variables')
+  > print(sorted([x for x in os.environ if x.startswith('wsgi')]))
+  > print(' request.ENVIRON wsgi variables')
   > with i._obtainrepo() as repo:
-  > print sorted([x for x in repo.ui.environ if x.startswith('wsgi')])
+  > print(sorted([x for x in repo.ui.environ if x.startswith('wsgi')]))
   > EOF
   $ $PYTHON request.py
    STATUS
diff --git a/tests/test-hgweb-no-request-uri.t 
b/tests/test-hgweb-no-request-uri.t
--- a/tests/test-hgweb-no-request-uri.t
+++ b/tests/test-hgweb-no-request-uri.t
@@ -31,11 +31,11 @@
   > input = stringio()
   > 
   > def startrsp(status, headers):
-  > print ' STATUS'
-  > print status
-  > print ' HEADERS'
-  > print [i for i in headers if i[0] != 'ETag']
-  > print ' DATA'
+  > print(' STATUS')
+  > print(status)
+  > print(' HEADERS')
+  > print([i for i in headers if i[0] != 'ETag'])
+  > print(' DATA')
   > return output.write
   > 
   > env = {
@@ -58,8 +58,8 @@
   > sys.stdout.write(output.getvalue())
   > sys.stdout.write(''.join(content))
   > getattr(content, 'close', lambda : None)()
-  > print ' ERRORS'
-  > print errors.getvalue()
+  > print(' ERRORS')
+  > print(errors.getvalue())
   > 
   > output = stringio()
   > env['PATH_INFO'] = '/'
diff --git a/tests/test-hgweb-no-path-info.t b/tests/test-hgweb-no-path-info.t
--- a/tests/test-hgweb-no-path-info.t
+++ b/tests/test-hgweb-no-path-info.t
@@ -31,11 +31,11 @@
   > input = stringio()
   > 
   > def startrsp(status, headers):
-  > print ' STATUS'
-  > print status
-  > print ' HEADERS'
-  > print [i for i in headers if i[0] != 'ETag']
-  > print ' DATA'
+  > print(' STATUS')
+  > print(status)
+  > print(' HEADERS')
+  > print([i for i in headers if i[0] != 'ETag'])
+  > print(' DATA')
   > return output.write
   > 
   > env = {
@@ -59,8 +59,8 @@
   > sys.stdout.write(output.getvalue())
   > sys.stdout.write(''.join(content))
   > getattr(content, 'close', lambda : None)()
-  > print ' ERRORS'
-  > print errors.getvalue()
+  > print(' ERRORS')
+  > print(errors.getvalue())
   > 
   > output = stringio()
   > env['QUERY_STRING'] = 'style=atom'



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


D271: obsolete: use bytes() instead of str() so the node is bytes on py3

2017-08-09 Thread durin42 (Augie Fackler)
durin42 updated this revision to Diff 675.
durin42 retitled this revision from "obsolete: use bytestr() instead of str() 
so the node is bytes on py3" to "obsolete: use bytes() instead of str() so the 
node is bytes on py3".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D271?vs=636=675

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

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
@@ -583,7 +583,7 @@
 
 metadata = tuple(sorted(metadata.iteritems()))
 
-marker = (str(prec), tuple(succs), int(flag), metadata, date, parents)
+marker = (bytes(prec), tuple(succs), int(flag), metadata, date, 
parents)
 return bool(self.add(transaction, [marker]))
 
 def add(self, transaction, markers):



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


D275: ui: refactor extractchoices so it doesn't break on Python 3

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd880a6bcef2f: ui: refactor extractchoices so it doesn't 
break on Python 3 (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D275?vs=640=670

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

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
@@ -1269,9 +1269,10 @@
 m = re.match(br'(?s)(.+?)\$\$([^\$]*&[^ \$].*)', prompt)
 msg = m.group(1)
 choices = [p.strip(' ') for p in m.group(2).split('$$')]
-return (msg,
-[(s[s.index('&') + 1].lower(), s.replace('&', '', 1))
- for s in choices])
+def choicetuple(s):
+ampidx = s.index('&')
+return s[ampidx + 1:ampidx + 2].lower(), s.replace('&', '', 1)
+return (msg, [choicetuple(s) for s in choices])
 
 def promptchoice(self, prompt, default=0):
 """Prompt user with a message, read response, and ensure it matches



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


D272: bundle2: convert ints to strings using pycompat.bytestring()

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG373ca5103ba8: bundle2: convert ints to strings using 
pycompat.bytestring() (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D272?vs=637=667

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

AFFECTED FILES
  mercurial/bundle2.py

CHANGE DETAILS

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -1000,7 +1000,7 @@
 parttype = self.type.upper()
 else:
 parttype = self.type.lower()
-outdebug(ui, 'part %s: "%s"' % (self.id, parttype))
+outdebug(ui, 'part %s: "%s"' % (pycompat.bytestr(self.id), parttype))
 ## parttype
 header = [_pack(_fparttypesize, len(parttype)),
   parttype, _pack(_fpartid, self.id),
@@ -1239,7 +1239,7 @@
 self.type = self._fromheader(typesize)
 indebug(self.ui, 'part type: "%s"' % self.type)
 self.id = self._unpackheader(_fpartid)[0]
-indebug(self.ui, 'part id: "%s"' % self.id)
+indebug(self.ui, 'part id: "%s"' % pycompat.bytestr(self.id))
 # extract mandatory bit from type
 self.mandatory = (self.type != self.type.lower())
 self.type = self.type.lower()



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


D274: obsutil: defend against succsmarkers() returning None

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG888f24810ea2: obsutil: defend against succsmarkers() 
returning None (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D274?vs=639=669

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

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,7 @@
 seenrevs.add(rev)
 if phase(repo, rev) == public:
 continue
-if set(succsmarkers(node)).issubset(addedmarkers):
+if set(succsmarkers(node) or []).issubset(addedmarkers):
 obsoleted.add(rev)
 return obsoleted
 



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


D279: tests: fix test-notify.t to use $PYTHON

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfa9f7b5d4397: tests: fix test-notify.t to use $PYTHON 
(authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D279?vs=644=674

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

AFFECTED FILES
  tests/test-notify.t

CHANGE DETAILS

diff --git a/tests/test-notify.t b/tests/test-notify.t
--- a/tests/test-notify.t
+++ b/tests/test-notify.t
@@ -1,3 +1,8 @@
+  $ cat > $TESTTMP/filter.py < from __future__ import print_function
+  > import sys, re
+  > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="")
+  > EOF
 
   $ cat <> $HGRCPATH
   > [extensions]
@@ -175,8 +180,7 @@
 of the very long subject line
 pull (minimal config)
 
-  $ hg --traceback --cwd b pull ../a | \
-  >   $PYTHON -c 'import sys,re; print re.sub("\n[\t ]", " ", 
sys.stdin.read()),'
+  $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
   pulling from ../a
   searching for changes
   adding changesets
@@ -205,6 +209,7 @@
   @@ -1,1 +1,2 @@ a
   +a
   (run 'hg update' to get a working copy)
+
   $ cat <> $HGRCPATH
   > [notify]
   > config = `pwd`/.notify.conf
@@ -228,8 +233,7 @@
 
   $ hg --cwd b rollback
   repository tip rolled back to revision 0 (undo pull)
-  $ hg --traceback --cwd b pull ../a  | \
-  >   $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
+  $ hg --traceback --cwd b pull ../a  | $PYTHON $TESTTMP/filter.py
   pulling from ../a
   searching for changes
   adding changesets
@@ -254,8 +258,7 @@
   diff -r cb9a9f314b8b -r 0647d048b600 a
   --- a/a  Thu Jan 01 00:00:00 1970 +
   +++ b/a  Thu Jan 01 00:00:01 1970 +
-  @@ -1,1 +1,2 @@
-   a
+  @@ -1,1 +1,2 @@ a
   +a
   (run 'hg update' to get a working copy)
 
@@ -272,8 +275,7 @@
 
   $ hg --cwd b rollback
   repository tip rolled back to revision 0 (undo pull)
-  $ hg --traceback --cwd b pull ../a | \
-  >   $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
+  $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
   pulling from ../a
   searching for changes
   adding changesets
@@ -294,17 +296,14 @@
   changeset 0647d048b600 in b
   description: b
   diffstat:
-  
-   a |  1 +
-   1 files changed, 1 insertions(+), 0 deletions(-)
+   a |  1 + 1 files changed, 1 insertions(+), 0 deletions(-)
   
   diffs (6 lines):
   
   diff -r cb9a9f314b8b -r 0647d048b600 a
   --- a/a  Thu Jan 01 00:00:00 1970 +
   +++ b/a  Thu Jan 01 00:00:01 1970 +
-  @@ -1,1 +1,2 @@
-   a
+  @@ -1,1 +1,2 @@ a
   +a
   (run 'hg update' to get a working copy)
 
@@ -321,8 +320,7 @@
   (branch merge, don't forget to commit)
   $ hg ci -m merge -d '3 0'
   $ cd ..
-  $ hg --traceback --cwd b pull ../a | \
-  >   $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
+  $ hg --traceback --cwd b pull ../a | $PYTHON $TESTTMP/filter.py
   pulling from ../a
   searching for changes
   adding changesets
@@ -343,17 +341,14 @@
   changeset 0a184ce6067f in b
   description: adda2
   diffstat:
-  
-   a |  1 +
-   1 files changed, 1 insertions(+), 0 deletions(-)
+   a |  1 + 1 files changed, 1 insertions(+), 0 deletions(-)
   
   diffs (6 lines):
   
   diff -r cb9a9f314b8b -r 0a184ce6067f a
   --- a/a  Thu Jan 01 00:00:00 1970 +
   +++ b/a  Thu Jan 01 00:00:02 1970 +
-  @@ -1,1 +1,2 @@
-   a
+  @@ -1,1 +1,2 @@ a
   +a
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
@@ -380,7 +375,7 @@
   $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \
   >   -m `$PYTHON -c 'print "\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4"'`
   $ hg --traceback --cwd b --encoding utf-8 pull ../a | \
-  >   $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
+  >   $PYTHON $TESTTMP/filter.py
   pulling from ../a
   searching for changes
   adding changesets
@@ -401,18 +396,14 @@
   changeset 7ea05ad269dc in b
   description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc)
   diffstat:
-  
-   a |  1 +
-   1 files changed, 1 insertions(+), 0 deletions(-)
+   a |  1 + 1 files changed, 1 insertions(+), 0 deletions(-)
   
   diffs (7 lines):
   
   diff -r 6a0cf76b2701 -r 7ea05ad269dc a
   --- a/a  Thu Jan 01 00:00:03 1970 +
   +++ b/a  Thu Jan 01 00:00:00 1970 +
-  @@ -1,2 +1,3 @@
-   a
-   a
+  @@ -1,2 +1,3 @@ a a
   +a
   (run 'hg update' to get a working copy)
 
@@ -435,7 +426,7 @@
   added 1 changesets with 1 changes to 1 files
   notify: sending 2 subscribers 1 changes
   (run 'hg update' to get a working copy)
-  $ $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", 
file("b/mbox").read()),'
+  $ $PYTHON $TESTTMP/filter.py < b/mbox
   From t...@test.com ... ... .. ..:..:..  (re)
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
@@ -451,19 +442,14 @@
   changeset e0be44cf638b in b
   description: long line
   diffstat:
-  
-   a |  1 +
-   1 files changed, 1 insertions(+), 0 

D278: tests: make test-highlight code portable to python3

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG65de152ba375: tests: make test-highlight code portable to 
python3 (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D278?vs=643=673

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

AFFECTED FILES
  tests/test-highlight.t

CHANGE DETAILS

diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -49,7 +49,7 @@
   > except (ValueError, IndexError):
   > n = 10
   > p = primes()
-  > print "The first %d primes: %s" % (n, list(islice(p, n)))
+  > print("The first %d primes: %s" % (n, list(islice(p, n
   > EOF
   $ echo >> primes.py  # to test html markup with an empty line just before EOF
   $ hg ci -Ama
@@ -74,7 +74,7 @@
   
   
   
-  test: 1af356141006 primes.py
+  test: f4fca47b67e6 primes.py
   
   
   
@@ -112,7 +112,7 @@
   
   Mercurial 
   
-   view primes.py @ 0:1af356141006
+   view primes.py @ 0:f4fca47b67e6
tip 
   
   
@@ -182,7 +182,7 @@
   except (ValueError, 
IndexError):
   n = 
10
   p = primes()
-  print The 
first %d primes: %s % 
(n, list(islice(p, n)))
+  print(The first %d primes: %s % 
(n, list(islice(p, n
   
   
   
@@ -251,7 +251,7 @@
   
   Mercurial 
   
-   annotate primes.py @ 0:1af356141006
+   annotate primes.py @ 0:f4fca47b67e6
tip 
   
   
@@ -299,19 +299,19 @@
 
   
   
-  
+  
   0
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
1 Fun with generators. Corresponding Haskell 
implementation:
@@ -321,14 +321,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
2 
@@ -338,14 +338,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
3 primes = 2 : sieve [3, 5..]
@@ -355,14 +355,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
4 where sieve (p:ns) = p : sieve [n | n - ns, mod n p /= 
0]
@@ -372,14 +372,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
5 
@@ -389,14 +389,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
6 
@@ -406,14 +406,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
7 from itertools import dropwhile, ifilter, islice, count, chain
@@ -423,14 +423,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
8 
@@ -440,14 +440,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
9 def primes():
@@ -457,14 +457,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
   10 
Generate all 
primes.
@@ -474,14 +474,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
   11 
def sieve(ns):
@@ -491,14 +491,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
   12 
p = ns.next()
@@ -508,14 +508,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
   13 
# It is important to yield *here* in order to stop 
the
@@ -525,14 +525,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
   14 
# infinite recursion.
@@ -542,14 +542,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
   15 
yield p
@@ -559,14 +559,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
   16 
ns = ifilter(lambda 
n: n % p != 0, ns)
@@ -576,14 +576,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
   17 
for n in 
sieve(ns):
@@ -593,14 +593,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   parents: 
-  diff
-  changeset
+  diff
+  changeset
   
   
   18  
   yield n
@@ -610,14 +610,14 @@
   
   
   
-  
-  1af356141006
+  
+  f4fca47b67e6
   a
   
   
   

D273: changegroup: more **kwargs

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG672ad4f3bb84: changegroup: more **kwargs (authored by 
durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D273?vs=638=668

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

AFFECTED FILES
  mercurial/changegroup.py

CHANGE DETAILS

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -390,13 +390,13 @@
 if clstart >= len(repo):
 return
 
-repo.hook("changegroup", **hookargs)
+repo.hook("changegroup", **pycompat.strkwargs(hookargs))
 
 for n in added:
 args = hookargs.copy()
 args['node'] = hex(n)
 del args['node_last']
-repo.hook("incoming", **args)
+repo.hook("incoming", **pycompat.strkwargs(args))
 
 newheads = [h for h in repo.heads()
 if h not in oldheads]



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


D276: i18n: fix check-translation.py to be less broken on Python 3

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG29238dbf718e: i18n: fix check-translation.py to be less 
broken on Python 3 (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D276?vs=641=671

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

AFFECTED FILES
  i18n/check-translation.py

CHANGE DETAILS

diff --git a/i18n/check-translation.py b/i18n/check-translation.py
--- a/i18n/check-translation.py
+++ b/i18n/check-translation.py
@@ -51,7 +51,7 @@
 ... msgstr='prompt  missing $$missing  amp$$followed by none&')
 >>> match(promptchoice, pe)
 True
->>> for e in promptchoice(pe): print e
+>>> for e in promptchoice(pe): print(e)
 number of choices differs between msgid and msgstr
 msgstr has invalid choice missing '&'
 msgstr has invalid '&' followed by none
@@ -88,19 +88,19 @@
 ... msgstr= 'something (DEPRECATED)')
 >>> match(deprecated, pe)
 True
->>> for e in deprecated(pe): print e
+>>> for e in deprecated(pe): print(e)
 >>> pe = polib.POEntry(
 ... msgid = 'Something (DEPRECATED)',
 ... msgstr= 'something (DETACERPED)')
 >>> match(deprecated, pe)
 True
->>> for e in deprecated(pe): print e
+>>> for e in deprecated(pe): print(e)
 >>> pe = polib.POEntry(
 ... msgid = 'Something (DEPRECATED)',
 ... msgstr= 'something')
 >>> match(deprecated, pe)
 True
->>> for e in deprecated(pe): print e
+>>> for e in deprecated(pe): print(e)
 msgstr inconsistently translated (DEPRECATED)
 >>> pe = polib.POEntry(
 ... msgid = 'Something (DEPRECATED, foo bar)',
@@ -124,16 +124,16 @@
 >>> pe = polib.POEntry(
 ... msgid ='ends with ::',
 ... msgstr='ends with ::')
->>> for e in taildoublecolons(pe): print e
+>>> for e in taildoublecolons(pe): print(e)
 >>> pe = polib.POEntry(
 ... msgid ='ends with ::',
 ... msgstr='ends without double-colons')
->>> for e in taildoublecolons(pe): print e
+>>> for e in taildoublecolons(pe): print(e)
 tail '::'-ness differs between msgid and msgstr
 >>> pe = polib.POEntry(
 ... msgid ='ends without double-colons',
 ... msgstr='ends with ::')
->>> for e in taildoublecolons(pe): print e
+>>> for e in taildoublecolons(pe): print(e)
 tail '::'-ness differs between msgid and msgstr
 """
 if pe.msgid.endswith('::') != pe.msgstr.endswith('::'):
@@ -149,7 +149,7 @@
 >>> pe = polib.POEntry(
 ... msgid ='indented text',
 ... msgstr='  narrowed indentation')
->>> for e in indentation(pe): print e
+>>> for e in indentation(pe): print(e)
 initial indentation width differs betweeen msgid and msgstr
 """
 idindent = len(pe.msgid) - len(pe.msgid.lstrip())



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


D277: dagparser: make print statement in doctest Py3 portable

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc91013452b33: dagparser: make print statement in doctest 
Py3 portable (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D277?vs=642=672

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

AFFECTED FILES
  mercurial/dagparser.py

CHANGE DETAILS

diff --git a/mercurial/dagparser.py b/mercurial/dagparser.py
--- a/mercurial/dagparser.py
+++ b/mercurial/dagparser.py
@@ -156,7 +156,7 @@
 Error:
 
 >>> try: list(parsedag('+1 bad'))
-... except Exception, e: print e
+... except Exception, e: print(e)
 invalid character in dag description: bad...
 
 '''



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


D270: tests: fix up test-run-tests failures on Python 3.6

2017-08-09 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2e43c5cd57a7: tests: fix up test-run-tests failures on 
Python 3.6 (authored by durin42).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D270?vs=635=666

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

AFFECTED FILES
  tests/run-tests.py
  tests/test-run-tests.py

CHANGE DETAILS

diff --git a/tests/test-run-tests.py b/tests/test-run-tests.py
--- a/tests/test-run-tests.py
+++ b/tests/test-run-tests.py
@@ -39,7 +39,7 @@
 and output.endswith(b'\n')), 'missing newline'
 assert not re.search(br'[^ \w\\/\r\n()*?]', expected + output), \
b'single backslash or unknown char'
-test = run_tests.TTest('test-run-test.t', '.', '.')
+test = run_tests.TTest(b'test-run-test.t', b'.', b'.')
 match = test.linematch(expected, output)
 if isinstance(match, str):
 return 'special: ' + match
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -105,9 +105,13 @@
 PYTHON3 = True
 xrange = range # we use xrange in one place, and we'd rather not use range
 def _bytespath(p):
+if p is None:
+return p
 return p.encode('utf-8')
 
 def _strpath(p):
+if p is None:
+return p
 return p.decode('utf-8')
 
 elif sys.version_info >= (3, 0, 0):
@@ -1383,7 +1387,8 @@
 else:
 m = optline.match(el)
 if m:
-conditions = [c for c in m.group(2).split(' ')]
+conditions = [
+c for c in m.group(2).split(b' ')]
 
 if not self._hghave(conditions)[0]:
 optional.append(i)
@@ -1497,7 +1502,7 @@
 else:
 m = optline.match(el)
 if m:
-conditions = [c for c in m.group(2).split(' ')]
+conditions = [c for c in m.group(2).split(b' ')]
 
 el = m.group(1) + b"\n"
 if not self._hghave(conditions)[0]:



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


D271: obsolete: use bytestr() instead of str() so the node is bytes on py3

2017-08-09 Thread yuja (Yuya Nishihara)
yuja added inline comments.

INLINE COMMENTS

> obsolete.py:587
>  
> -marker = (str(prec), tuple(succs), int(flag), metadata, date, 
> parents)
> +prec = bytes(pycompat.bytestr(prec))
> +marker = (prec, tuple(succs), int(flag), metadata, date, parents)

Why can't this be just `bytes(prec)` ?

I don't think `str(prec).encode('ascii')` is valid for binary node id.

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH 4 of 8] template: add minimal obsfate template function

2017-08-09 Thread Yuya Nishihara
On Tue, 08 Aug 2017 18:48:08 +0200, Boris Feld wrote:
> On Wed, 2017-08-09 at 00:19 +0900, Yuya Nishihara wrote:
> > On Mon, 07 Aug 2017 16:56:23 +0200, Boris Feld wrote:
> > > +@templatekeyword("succsandmarkers")
> > > +def showsuccsandmarkers(repo, ctx, **args):
> > > +"""Returns a list of dict for each final successor of ctx.
> > > +
> > > +The dict contains successors node id in "successors" keys and
> > > the list of
> > > +obs-markers from ctx to the set of successors in "markers"
> > > +"""
> > > +
> > > +values = obsutil.successorsandmarkers(repo, ctx)
> > > +
> > > +if values is None:
> > > +values = []
> > > +
> > > +return showlist('succsandmarkers', values, args)
> > 
> > I think returning a list of successor nodes is more natural.
> > 
> > Can we theoretically gather the relevant markers from successor
> > nodes?
> > If the "markers" field serves just as a cache, it could be stored in
> > revcache[] and passed to obsfate() under the hood.
> 
> The current algorithm for computing the successors sets of a changeset
> is this one:
> 
> Walk the obs-marker graph starting at a given revision. Follow
> successors of each revisions walked until revisions has no more
> successors, they are stable and they are the tip-most successor of the
> initial revision.
> 
> Having the sets of successors doesn't helps because a successor could
> be successor for more than one obsolete revision (fold for example).

Thanks for clarifying that. So markers are tied to each successorset?

  successorssets(rev) -> [(succs0, markers0), (succs1, markers1), ...]

In which case, {successorsset} could populate markers by makemap(),

  successorssets % "{successorset} {obsmarkers}"
   
   no idea how this should be rendered, but
   let's revisit it later.

and perhaps obsfate could take the pair explicitly or implicitly.

  successorsets % "{obsfate(successorset, obsmarkers)}"  # a function
  successorsets % "{obsfate}"  # a keyword available only in successorsets

obsfate could be even split to verb/users/mindate/maxdate.

  successorsets % "{obsverb} {obsusers} ..."
   
 these keyword functions may be populated by makemap(), too.

> The list of markers between a revisions and its successors could be
> cached, I'm not sure how to use revcache for that. Did you meant
> returning a hybrid object like this one, with a non-null revcache
> parameter: https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/tem
> platekw.py#l641?

Something like showlatesttag() or showfile*() was in mind, but "revcache"
seems not the right tool as the markers aren't bound to the current rev.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D219: morestatus: move fb extension to core by plugging to `hg status --verbose`

2017-08-09 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  In https://phab.mercurial-scm.org/D219#4343, @durin42 wrote:
  
  > I'm still a tiny bit worried about potential confusion between --terse and 
--verbose (in that they're not opposites), but I'm also fine with this. I'll 
take it in a couple of days if I don't hear any objections.
  
  
  Currently if we pass do `hg log --terse u --verbose`, it will still terse the 
output. I think the best way is to document that --verbose and --terse are not 
opposites.

REPOSITORY
  rHG Mercurial

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

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


D288: bundlerepo: move temp bundle creation to a separate function

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan added a comment.


  LGTM

REPOSITORY
  rHG Mercurial

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

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


D292: repair: move manifest strip to a separate function

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan added a comment.


  LGTM

REPOSITORY
  rHG Mercurial

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

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


D291: repair: refactor broken linkrev collection

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan added a comment.


  LGTM

REPOSITORY
  rHG Mercurial

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

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


D242: context: rename troubled into isunstable

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 665.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D242?vs=626=665

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

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

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -680,7 +680,7 @@
 ctx = unfi[node]
 if ctx.obsolete():
 raise error.Abort(mso % ctx)
-elif ctx.troubled():
+elif ctx.isunstable():
 # TODO print more than one instability in the abort
 # message
 raise error.Abort(mst[ctx.instabilities()[0]] % ctx)
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -240,6 +240,12 @@
 return self.rev() in obsmod.getrevs(self._repo, 'divergent')
 
 def troubled(self):
+msg = ("'context.troubled' is deprecated, "
+   "use 'context.isunstable'")
+self._repo.ui.deprecwarn(msg, '4.4')
+return self.unstable()
+
+def isunstable(self):
 """True if the changeset is either unstable, bumped or divergent"""
 return self.orphan() or self.phasedivergent() or 
self.contentdivergent()
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4849,7 +4849,7 @@
 ui.write(_(' (no revision checked out)'))
 if p.obsolete():
 ui.write(_(' (obsolete)'))
-if p.troubled():
+if p.isunstable():
 instabilities = (ui.label(instability, 'trouble.%s' % instability)
  for instability in p.instabilities())
 ui.write(' ('
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1464,7 +1464,7 @@
 labels = ['log.changeset', 'changeset.%s' % ctx.phasestr()]
 if ctx.obsolete():
 labels.append('changeset.obsolete')
-if ctx.troubled():
+if ctx.isunstable():
 labels.append('changeset.troubled')
 for instability in ctx.instabilities():
 labels.append('trouble.%s' % instability)
@@ -1577,7 +1577,7 @@
 self.ui.write(_("date:%s\n") % date,
   label='log.date')
 
-if ctx.troubled():
+if ctx.isunstable():
 # i18n: column positioning for "hg log"
 instabilities = ctx.instabilities()
 self.ui.write(_("instability: %s\n") % ', '.join(instabilities),



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


D237: template: rename troubles templatekw into instabilities

2017-08-09 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 663.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D237?vs=653=663

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

AFFECTED FILES
  mercurial/templatekw.py
  mercurial/templates/map-cmdline.default
  tests/test-obsolete-divergent.t
  tests/test-obsolete.t
  tests/test-template-engine.t

CHANGE DETAILS

diff --git a/tests/test-template-engine.t b/tests/test-template-engine.t
--- a/tests/test-template-engine.t
+++ b/tests/test-template-engine.t
@@ -10,7 +10,7 @@
   > def process(self, t, map):
   > tmpl = self.loader(t)
   > for k, v in map.iteritems():
-  > if k in ('templ', 'ctx', 'repo', 'revcache', 'cache'):
+  > if k in ('templ', 'ctx', 'repo', 'revcache', 'cache', 
'troubles'):
   > continue
   > if hasattr(v, '__call__'):
   > v = v(**map)
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -3,7 +3,7 @@
   > # public changeset are not obsolete
   > publish=false
   > [ui]
-  > logtemplate="{rev}:{node|short} ({phase}{if(obsolete, ' 
*{obsolete}*')}{if(troubles, ' {troubles}')}) [{tags} {bookmarks}] 
{desc|firstline}\n"
+  > logtemplate="{rev}:{node|short} ({phase}{if(obsolete, ' 
*{obsolete}*')}{if(instabilities, ' {instabilities}')}) [{tags} {bookmarks}] 
{desc|firstline}\n"
   > EOF
   $ mkcommit() {
   >echo "$1" > "$1"
@@ -934,7 +934,7 @@
   changeset:   7:50c51b361e60
   user:test
   date:Thu Jan 01 00:00:00 1970 +
-  trouble: orphan, phase-divergent
+  instability: orphan, phase-divergent
   summary: add babar
   
   $ hg log -T default -r 'obsolete()'
diff --git a/tests/test-obsolete-divergent.t b/tests/test-obsolete-divergent.t
--- a/tests/test-obsolete-divergent.t
+++ b/tests/test-obsolete-divergent.t
@@ -670,7 +670,7 @@
 
   $ rm .hg/localtags
   $ hg cleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
-  $ hg log -G -T '{rev}:{node|short} {desc} {troubles}' -r 'sort(all(), topo)'
+  $ hg log -G -T '{rev}:{node|short} {desc} {instabilities}' -r 'sort(all(), 
topo)'
   @  5:1a2a9b5b0030 B2 content-divergent
   |
   | o  4:70d5a63ca112 B4 content-divergent
diff --git a/mercurial/templates/map-cmdline.default 
b/mercurial/templates/map-cmdline.default
--- a/mercurial/templates/map-cmdline.default
+++ b/mercurial/templates/map-cmdline.default
@@ -29,7 +29,7 @@
 
 # General templates
 _trouble_label = 'trouble.{trouble}'
-_troubles_labels = '{if(troubles, "changeset.troubled 
{troubles%_trouble_label}")}'
+_troubles_labels = '{if(instabilities, "changeset.troubled 
{instabilities%_trouble_label}")}'
 _obsolete_label = '{if(obsolete, "changeset.obsolete")}'
 _cset_labels = '{separate(" ", "log.changeset", "changeset.{phase}", 
"{_obsolete_label}", "{_troubles_labels}")}'
 cset = '{label("{_cset_labels}",
@@ -68,8 +68,8 @@
 ldate = '{label("log.date",
 "date:{date|date}")}\n'
 
-ltroubles = '{if(troubles, "{label('log.trouble',
-   'trouble: {join(troubles, ", 
")}')}\n")}'
+ltroubles = '{if(instabilities, "{label('log.trouble',
+   'instability: {join(instabilities, ", 
")}')}\n")}'
 
 extra = '{label("ui.debug log.extra",
 "extra:   {key}={value|stringescape}")}\n'
diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -765,9 +765,21 @@
 return repo.ui.termwidth()
 
 @templatekeyword('troubles')
-def showtroubles(**args):
+def showtroubles(repo, **args):
 """List of strings. Evolution troubles affecting the changeset.
 
+(DEPRECATED)
+"""
+msg = ("'troubles' is deprecated, "
+   "use 'instabilities'")
+repo.ui.deprecwarn(msg, '4.4')
+
+return showinstabilities(repo=repo, **args)
+
+@templatekeyword('instabilities')
+def showinstabilities(**args):
+"""List of strings. Evolution instabilities affecting the changeset.
+
 (EXPERIMENTAL)
 """
 args = pycompat.byteskwargs(args)



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