[PATCH evolve-ext] compat: don't monkeypatch mercurial.copies module on 4.8

2018-11-01 Thread Augie Fackler
# HG changeset patch
# User Augie Fackler 
# Date 1541117853 14400
#  Thu Nov 01 20:17:33 2018 -0400
# Node ID 1103851bda846b952659a50aaff4e20d34e62a40
# Parent  a4d5dcc836ab287b08aa6591ee8b25bff9028042
compat: don't monkeypatch mercurial.copies module on 4.8

The backport was frozen in time sometime before important
narrow-related improvements to this module. Rather than try to make
the monkeypatch more up to date, let's just not use it where we know
it won't be needed.

diff --git a/hgext3rd/evolve/compat.py b/hgext3rd/evolve/compat.py
--- a/hgext3rd/evolve/compat.py
+++ b/hgext3rd/evolve/compat.py
@@ -698,10 +698,13 @@ def fixoldmergecopies(repo, c1, c2, base
 break
 
 return copy, movewithdir, diverge, renamedelete, dirmove
+# sniff for stringutil on copies as a way to detect hg 4.8 and *not*
+# patch copytracing there, as our backport breaks the narrow extension.
+_ishg48 = util.safehasattr(copies, 'stringutil')
 
-if util.safehasattr(copies, '_fullcopytracing'):
+if util.safehasattr(copies, '_fullcopytracing') and not _ishg48:
 copies._fullcopytracing = fixedcopytracing
-elif util.safehasattr(copies, 'mergecopies'):
+elif util.safehasattr(copies, 'mergecopies') and not _ishg48:
 # compat fix for hg <= 4.3
 copies.mergecopies = fixoldmergecopies
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5213: narrow: fix copies._fullcopytracing() narrowspec filtering in graft case

2018-11-01 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG07a66c1387d1: narrow: fix copies._fullcopytracing() 
narrowspec filtering in graft case (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5213?vs=12371=12377

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

AFFECTED FILES
  mercurial/copies.py
  tests/test-narrow-copies.t

CHANGE DETAILS

diff --git a/tests/test-narrow-copies.t b/tests/test-narrow-copies.t
--- a/tests/test-narrow-copies.t
+++ b/tests/test-narrow-copies.t
@@ -71,5 +71,4 @@
   $ hg ci -Aqm 'add inside/f5'
   $ hg --config extensions.rebase= rebase -d 'public()' -r .
   rebasing 6:610b60178c28 "add inside/f5" (tip)
-  abort: data/outside/f3.i@54e53435331b: no match found!
-  [255]
+  saved backup bundle to 
$TESTTMP/narrow/.hg/strip-backup/610b60178c28-65716a78-rebase.hg
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -511,8 +511,9 @@
 # unmatched file from topological common ancestors (no DAG rotation)
 # need to recompute this for directory move handling when grafting
 mta = tca.manifest()
-u1u, u2u = _computenonoverlap(repo, c1, c2, m1.filesnotin(mta),
-m2.filesnotin(mta),
+u1u, u2u = _computenonoverlap(repo, c1, c2,
+  m1.filesnotin(mta, repo.narrowmatch()),
+  m2.filesnotin(mta, repo.narrowmatch()),
   baselabel='topological common ancestor')
 
 for f in u1u:



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


D5212: tests: demonstrate broken copies._fullcopytracing()

2018-11-01 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd049ee8eee00: tests: demonstrate broken 
copies._fullcopytracing() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5212?vs=12370=12376

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

AFFECTED FILES
  tests/test-narrow-copies.t

CHANGE DETAILS

diff --git a/tests/test-narrow-copies.t b/tests/test-narrow-copies.t
--- a/tests/test-narrow-copies.t
+++ b/tests/test-narrow-copies.t
@@ -63,3 +63,13 @@
   $ hg --config extensions.rebase= rebase -d tip
   rebasing 3:4f84b666728c "add inside/f4"
   saved backup bundle to 
$TESTTMP/narrow/.hg/strip-backup/4f84b666728c-4269b76e-rebase.hg
+
+  $ hg co -q 0
+  $ echo modified > inside/f1
+  $ hg ci -qm 'modify inside/f1'
+  $ echo new > inside/f5
+  $ hg ci -Aqm 'add inside/f5'
+  $ hg --config extensions.rebase= rebase -d 'public()' -r .
+  rebasing 6:610b60178c28 "add inside/f5" (tip)
+  abort: data/outside/f3.i@54e53435331b: no match found!
+  [255]



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


D5216: catapult: introduce HGTESTCATAPULTSERVERPIPE to control run-tests' tracing

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

REVISION SUMMARY
  If unset, it will inherit its value from HGCATAPULTSERVERPIPE (which hg itself
  also respects). By setting only HGTESTCATAPULTSERVERPIPE, we can get 
per-command
  breakdowns of the test runtimes for the whole test suite without overloading 
the
  trace file with the contents of the tracing from hg (such as demandimport, 
etc.)

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1084,8 +1084,11 @@
 env["HGENCODINGMODE"] = "strict"
 env["HGHOSTNAME"] = "test-hostname"
 env['HGIPV6'] = str(int(self._useipv6))
-if 'HGCATAPULTSERVERPIPE' not in env:
-env['HGCATAPULTSERVERPIPE'] = os.devnull
+if 'HGTESTCATAPULTSERVERPIPE' not in env:
+# If we don't have HGTESTCATAPULTSERVERPIPE explicitly set, pull 
the
+# non-test one in as a default, otherwise set to devnull
+env['HGTESTCATAPULTSERVERPIPE'] = \
+env.get('HGCATAPULTSERVERPIPE', os.devnull)
 
 extraextensions = []
 for opt in self._extraconfigopts:
@@ -1366,14 +1369,14 @@
 session = str(uuid.uuid4())
 if PYTHON3:
 session = session.encode('ascii')
-hgcatapult = os.getenv('HGCATAPULTSERVERPIPE')
+hgcatapult = os.getenv('HGTESTCATAPULTSERVERPIPE')
 def toggletrace(cmd=None):
 if not hgcatapult or hgcatapult == os.devnull:
 return
 
 if activetrace:
 script.append(
-b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
+b'echo END %s %s >> "$HGTESTCATAPULTSERVERPIPE"\n' % (
 session, activetrace[0]))
 if cmd is None:
 return
@@ -1384,7 +1387,7 @@
 quoted = shellquote(cmd.strip().decode('utf8')).encode('utf8')
 quoted = quoted.replace(b'\\', b'')
 script.append(
-b'echo START %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
+b'echo START %s %s >> "$HGTESTCATAPULTSERVERPIPE"\n' % (
 session, quoted))
 activetrace[0:] = [quoted]
 
@@ -1422,18 +1425,19 @@
 # loop to exit and closes the pipe. Sigh.
 script.append(
 b'rtendtracing() {\n'
-b'  echo END %(session)s %(name)s >> $HGCATAPULTSERVERPIPE\n'
+b'  echo END %(session)s %(name)s >> %(catapult)s\n'
 b'  rm -f "$TESTTMP/.still-running"\n'
 b'}\n'
 b'trap "rtendtracing" 0\n'
 b'touch "$TESTTMP/.still-running"\n'
 b'while [ -f "$TESTTMP/.still-running" ]; do sleep 1; done '
-b'> $HGCATAPULTSERVERPIPE &\n'
+b'> %(catapult)s &\n'
 b'HGCATAPULTSESSION=%(session)s ; export HGCATAPULTSESSION\n'
-b'echo START %(session)s %(name)s >> $HGCATAPULTSERVERPIPE\n'
+b'echo START %(session)s %(name)s >> %(catapult)s\n'
 % {
 'name': self.name,
 'session': session,
+'catapult': hgcatapult,
 }
 )
 



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


D5215: catapult: rename 'active' to 'activetrace'; this isn't storing a boolean state

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

REVISION SUMMARY
  (This is an attempt to make it more obvious that the indentation is correct, 
to
  prevent a repeat of 
https://phab.mercurial-scm.org/rHG97f52862b1bd3de913261e0aba7e1a35ceb9de12)

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1362,19 +1362,19 @@
 script.append(b'%s %d 0\n' % (salt, line))
 else:
 script.append(b'echo %s %d $?\n' % (salt, line))
-active = []
+activetrace = []
 session = str(uuid.uuid4())
 if PYTHON3:
 session = session.encode('ascii')
 hgcatapult = os.getenv('HGCATAPULTSERVERPIPE')
 def toggletrace(cmd=None):
 if not hgcatapult or hgcatapult == os.devnull:
 return
 
-if active:
+if activetrace:
 script.append(
 b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
-session, active[0]))
+session, activetrace[0]))
 if cmd is None:
 return
 
@@ -1386,7 +1386,7 @@
 script.append(
 b'echo START %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
 session, quoted))
-active[0:] = [quoted]
+activetrace[0:] = [quoted]
 
 script = []
 
@@ -1527,7 +1527,7 @@
 after.setdefault(pos, []).append('  !!! missing #endif\n')
 addsalt(n + 1, False)
 # Need to end any current per-command trace
-if active:
+if activetrace:
 toggletrace()
 return salt, script, after, expected
 



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


D5214: catapult: fix broken run-tests catapult tracing

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

REVISION SUMMARY
  Commit 
https://phab.mercurial-scm.org/rHG97f52862b1bd3de913261e0aba7e1a35ceb9de12 
thought this block was misindented, but it was not; the
  indentation after that commit means we never log a catapult trace for 
individual
  commands. Also, we've never emitted the "end" trace line when the test was
  finished, so the trace viewer claims that these "did not finish", fixing that 
as
  well.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1366,20 +1366,27 @@
 session = str(uuid.uuid4())
 if PYTHON3:
 session = session.encode('ascii')
-def toggletrace(cmd):
+hgcatapult = os.getenv('HGCATAPULTSERVERPIPE')
+def toggletrace(cmd=None):
+if not hgcatapult or hgcatapult == os.devnull:
+return
+
+if active:
+script.append(
+b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
+session, active[0]))
+if cmd is None:
+return
+
 if isinstance(cmd, str):
 quoted = shellquote(cmd.strip())
 else:
 quoted = shellquote(cmd.strip().decode('utf8')).encode('utf8')
 quoted = quoted.replace(b'\\', b'')
-if active:
-script.append(
-b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
-session, active[0]))
-script.append(
-b'echo START %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
-session, quoted))
-active[0:] = [quoted]
+script.append(
+b'echo START %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
+session, quoted))
+active[0:] = [quoted]
 
 script = []
 
@@ -1408,7 +1415,6 @@
 if os.getenv('MSYSTEM'):
 script.append(b'alias pwd="pwd -W"\n')
 
-hgcatapult = os.getenv('HGCATAPULTSERVERPIPE')
 if hgcatapult and hgcatapult != os.devnull:
 # Kludge: use a while loop to keep the pipe from getting
 # closed by our echo commands. The still-running file gets
@@ -1520,6 +1526,9 @@
 if skipping is not None:
 after.setdefault(pos, []).append('  !!! missing #endif\n')
 addsalt(n + 1, False)
+# Need to end any current per-command trace
+if active:
+toggletrace()
 return salt, script, after, expected
 
 def _processoutput(self, exitcode, output, salt, after, expected):



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


D5213: narrow: fix copies._fullcopytracing() narrowspec filtering in graft case

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

REVISION SUMMARY
  I broke this too in 
https://phab.mercurial-scm.org/rHG707c3804e6077e6922fe3a3b7c503d28b596566c 
(narrow: move copies overrides to
  core, 2018-09-28). Hopefully I'm done fixing things broken by that
  commit now.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/copies.py
  tests/test-narrow-copies.t

CHANGE DETAILS

diff --git a/tests/test-narrow-copies.t b/tests/test-narrow-copies.t
--- a/tests/test-narrow-copies.t
+++ b/tests/test-narrow-copies.t
@@ -71,5 +71,4 @@
   $ hg ci -Aqm 'add inside/f5'
   $ hg --config extensions.rebase= rebase -d 'public()' -r .
   rebasing 6:610b60178c28 "add inside/f5" (tip)
-  abort: data/outside/f3.i@54e53435331b: no match found!
-  [255]
+  saved backup bundle to 
$TESTTMP/narrow/.hg/strip-backup/610b60178c28-65716a78-rebase.hg
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -511,8 +511,9 @@
 # unmatched file from topological common ancestors (no DAG rotation)
 # need to recompute this for directory move handling when grafting
 mta = tca.manifest()
-u1u, u2u = _computenonoverlap(repo, c1, c2, m1.filesnotin(mta),
-m2.filesnotin(mta),
+u1u, u2u = _computenonoverlap(repo, c1, c2,
+  m1.filesnotin(mta, repo.narrowmatch()),
+  m2.filesnotin(mta, repo.narrowmatch()),
   baselabel='topological common ancestor')
 
 for f in u1u:



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


D5212: tests: demonstrate broken copies._fullcopytracing()

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

REVISION SUMMARY
  Turns out copies._fullcopytracing() was also broken.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-narrow-copies.t

CHANGE DETAILS

diff --git a/tests/test-narrow-copies.t b/tests/test-narrow-copies.t
--- a/tests/test-narrow-copies.t
+++ b/tests/test-narrow-copies.t
@@ -63,3 +63,13 @@
   $ hg --config extensions.rebase= rebase -d tip
   rebasing 3:4f84b666728c "add inside/f4"
   saved backup bundle to 
$TESTTMP/narrow/.hg/strip-backup/4f84b666728c-4269b76e-rebase.hg
+
+  $ hg co -q 0
+  $ echo modified > inside/f1
+  $ hg ci -qm 'modify inside/f1'
+  $ echo new > inside/f5
+  $ hg ci -Aqm 'add inside/f5'
+  $ hg --config extensions.rebase= rebase -d 'public()' -r .
+  rebasing 6:610b60178c28 "add inside/f5" (tip)
+  abort: data/outside/f3.i@54e53435331b: no match found!
+  [255]



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


D5094: merge-tools: when calling external merge tool, describe the resolve inputs

2018-11-01 Thread spectral (Kyle Lippincott)
spectral added a comment.


  In https://phab.mercurial-scm.org/D5094#77146, @yuja wrote:
  
  > >   > We might want to structure these variables as `base.node|short` 
instead of
  > >   >  `base_node` for example, but that would require more work.
  >
  > [...]
  >
  > >   Unfortunately, this doesn't work super well, when using the following 
flags:
  >
  > There isn't a building block for a mapping dict holding mapping dicts, and
  >  the formatter API doesn't support such structure either.
  >
  > Fortunately, we don't need a formatter here since we just want to apply
  >  a template to a single item. So if we had a wrapper for a single mapping
  >  dict, the templater can be rendered as follows:
  >
  >   props = {
  >   'base': templateutil.mappingdict({'ctx': fca.changectx(), 'fctx': fca,
  > 'label': baselabel})
  >   ...
  >   }
  >   cmdutil.rendertemplate(fcd.changectx(), tmpl, props)
  >
  >
  > And `base.path`, `base.node`, etc. should just work.
  
  
  Done.
  
  > I'll post the dict wrapper if you like the idea.
  > 
  >   class mappingdict(mappable, _mappingsequence):
  >   """Wrapper for a single template mapping
  >   
  >   This isn't a sequence in a way that the underlying dict won't be 
iterated
  >   as a dict, but shares most of the _mappingsequence functions.
  >   """
  >   
  >   def __init__(self, mapping, name=None, tmpl=None):
  >   super(mappingdict, self).__init__(name, tmpl)
  >   self._mapping = mapping
  >   
  >   def tomap(self, context):
  >   return self._mapping
  >   
  >   def tobool(self, context, mapping):
  >   # no idea when a template mapping should be considered an empty, 
but
  >   # a mapping dict should have at least one item in practice, so 
always
  >   # mark this as non-empty.
  >   return True
  >   
  >   def tovalue(self, context, mapping):
  >   return super(mappingdict, self).tovalue(context, mapping)[0]
  
  I copy/pasted this to https://phab.mercurial-scm.org/D5211. :)

REPOSITORY
  rHG Mercurial

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

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


D5094: merge-tools: when calling external merge tool, describe the resolve inputs

2018-11-01 Thread spectral (Kyle Lippincott)
spectral updated this revision to Diff 12369.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5094?vs=12106=12369

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

AFFECTED FILES
  mercurial/configitems.py
  mercurial/filemerge.py
  mercurial/help/config.txt
  tests/test-merge-tools.t

CHANGE DETAILS

diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t
--- a/tests/test-merge-tools.t
+++ b/tests/test-merge-tools.t
@@ -1942,6 +1942,25 @@
   : 00 01 02 03 ||
   $ hg merge --abort -q
 
+Check that the extra information is printed correctly
+
+  $ hg merge 9 \
+  >   --config merge-tools.testecho.executable='echo' \
+  >   --config merge-tools.testecho.args='merge runs here ...' \
+  >   --config merge-tools.testecho.binary=True \
+  >   --config ui.merge=testecho \
+  >   --config 
ui.pre-merge-tool-output-template='\n{label("extmerge.running_merge_tool", 
"Running merge tool for {path} ({toolpath}):")}\n{separate("\n", 
extmerge_section(local), extmerge_section(base), extmerge_section(other))}\n' \
+  >   --config 'templatealias.extmerge_section(sect)="- {pad("{sect.name} 
({sect.label})", 20, left=True)}: {revset(sect.node)%"{rev}:{shortest(node,8)} 
{desc|firstline} {separate(" ", tags, bookmarks, branch)}"}"'
+  merging b
+  
+  Running merge tool for b (/bin/echo):
+  - local (working copy): 10:2d1f533d add binary file (#2) tip default
+  -  base (base): -1:  default
+  -other (merge rev): 9:1e7ad7d7 add binary file (#1) default
+  merge runs here ...
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
 Check that debugpicktool examines which merge tool is chosen for
 specified file as expected
 
diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
--- a/mercurial/help/config.txt
+++ b/mercurial/help/config.txt
@@ -2296,6 +2296,16 @@
 
   On Windows, this configuration option is ignored and the command aborted.
 
+``pre-merge-tool-output-template``
+A template that is printed before executing an external merge tool. This 
can
+be used to print out additional context that might be useful to have during
+the conflict resolution, such as the description of the various commits
+involved or bookmarks/tags.
+
+Additional information is available in the ``local`, ``base``, and 
``other``
+dicts. For example: ``{local.label}``, ``{base.name}``, or
+``{other.islink}``.
+
 ``quiet``
 Reduce the amount of output printed.
 (default: False)
diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -13,7 +13,11 @@
 import shutil
 
 from .i18n import _
-from .node import nullid, short
+from .node import (
+hex,
+nullid,
+short,
+)
 
 from . import (
 encoding,
@@ -27,6 +31,7 @@
 tagmerge,
 templatekw,
 templater,
+templateutil,
 util,
 )
 
@@ -536,6 +541,45 @@
 raise error.InMemoryMergeConflictsError('in-memory merge does not support '
 'external merge tools')
 
+def _describemerge(ui, repo, mynode, fcl, fcb, fco, env, toolpath, args):
+tmpl = ui.config('ui', 'pre-merge-tool-output-template')
+if not tmpl:
+return
+
+mappingdict = templateutil.mappingdict
+props = {'ctx': fcl.changectx(),
+ 'node': hex(mynode),
+ 'path': fcl.path(),
+ 'local': mappingdict({'ctx': fcl.changectx(),
+   'fctx': fcl,
+   'node': hex(mynode),
+   'name': _('local'),
+   'islink': 'l' in fcl.flags(),
+   'label': env['HG_MY_LABEL']}),
+ 'base': mappingdict({'ctx': fcb.changectx(),
+  'fctx': fcb,
+  'name': _('base'),
+  'islink': 'l' in fcb.flags(),
+  'label': env['HG_BASE_LABEL']}),
+ 'other': mappingdict({'ctx': fco.changectx(),
+   'fctx': fco,
+   'name': _('other'),
+   'islink': 'l' in fco.flags(),
+   'label': env['HG_OTHER_LABEL']}),
+ 'toolpath': toolpath,
+ 'toolargs': args}
+
+
+# TODO: make all of this something that can be specified on a per-tool 
basis
+tmpl = templater.unquotestring(tmpl)
+
+# Not using cmdutil.rendertemplate here since it causes errors importing
+# things for us to import cmdutil.
+tres = formatter.templateresources(ui, repo)
+t = formatter.maketemplater(ui, tmpl, defaults=templatekw.keywords,
+resources=tres)
+ui.status(t.renderdefault(props))
+
 def 

D5211: templateutil: add mappingdict to handle dicts in template/formatter props

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

REVISION SUMMARY
  (Code is copy/pasted from yuya's comment on
  https://phab.mercurial-scm.org/D5094)

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/templateutil.py

CHANGE DETAILS

diff --git a/mercurial/templateutil.py b/mercurial/templateutil.py
--- a/mercurial/templateutil.py
+++ b/mercurial/templateutil.py
@@ -472,6 +472,29 @@
 def tobool(self, context, mapping):
 return bool(self._mappings)
 
+class mappingdict(mappable, _mappingsequence):
+"""Wrapper for a single template mapping
+
+This isn't a sequence in a way that the underlying dict won't be iterated
+as a dict, but shares most of the _mappingsequence functions.
+"""
+
+def __init__(self, mapping, name=None, tmpl=None):
+super(mappingdict, self).__init__(name, tmpl)
+self._mapping = mapping
+
+def tomap(self, context):
+return self._mapping
+
+def tobool(self, context, mapping):
+# no idea when a template mapping should be considered an empty, but
+# a mapping dict should have at least one item in practice, so always
+# mark this as non-empty.
+return True
+
+def tovalue(self, context, mapping):
+return super(mappingdict, self).tovalue(context, mapping)[0]
+
 class mappedgenerator(wrapped):
 """Wrapper for generator of strings which acts as a list
 



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


D5203: narrow: make copies.pathcopies() filter with narrowspec again

2018-11-01 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG873f3682c8af: narrow: make copies.pathcopies() filter with 
narrowspec again (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5203?vs=12358=12367

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

AFFECTED FILES
  mercurial/copies.py
  tests/test-narrow-copies.t

CHANGE DETAILS

diff --git a/tests/test-narrow-copies.t b/tests/test-narrow-copies.t
--- a/tests/test-narrow-copies.t
+++ b/tests/test-narrow-copies.t
@@ -62,5 +62,4 @@
   $ hg pull -q
   $ hg --config extensions.rebase= rebase -d tip
   rebasing 3:4f84b666728c "add inside/f4"
-  abort: data/outside/f3.i@54e53435331b: no match found!
-  [255]
+  saved backup bundle to 
$TESTTMP/narrow/.hg/strip-backup/4f84b666728c-4269b76e-rebase.hg
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -219,6 +219,7 @@
 def _forwardcopies(a, b, match=None):
 """find {dst@b: src@a} copy mapping where a is an ancestor of b"""
 
+match = a.repo().narrowmatch(match)
 # check for working copy
 if b.rev() is None:
 if a == b.p1():



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


D5202: tests: demonstrate broken copies.pathcopies()

2018-11-01 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf1c1b4d0e695: tests: demonstrate broken copies.pathcopies() 
(authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5202?vs=12357=12366

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

AFFECTED FILES
  tests/test-narrow-copies.t

CHANGE DETAILS

diff --git a/tests/test-narrow-copies.t b/tests/test-narrow-copies.t
--- a/tests/test-narrow-copies.t
+++ b/tests/test-narrow-copies.t
@@ -18,10 +18,12 @@
   $ echo modified > inside/f2
   $ hg ci -qm 'modify inside/f2'
 
+  $ mkdir outside
+  $ echo new > outside/f3
+  $ hg ci -Aqm 'add outside/f3'
   $ cd ..
 
-  $ hg clone --narrow ssh://user@dummy/master narrow --include inside
-  requesting all changes
+  $ hg clone --narrow ssh://user@dummy/master narrow --include inside -r 2
   adding changesets
   adding manifests
   adding file changes
@@ -55,3 +57,10 @@
   date:Thu Jan 01 00:00:00 1970 +
   summary: move f2 from outside
   
+  $ echo new > inside/f4
+  $ hg ci -Aqm 'add inside/f4'
+  $ hg pull -q
+  $ hg --config extensions.rebase= rebase -d tip
+  rebasing 3:4f84b666728c "add inside/f4"
+  abort: data/outside/f3.i@54e53435331b: no match found!
+  [255]



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


D5210: statprof: clean up unicode/bytes a little

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

REVISION SUMMARY
  I'm not really sure how this worked before, but something perturbed it
  and what I've got in this change I believe is a little tidier. This
  fixes test-profile.t on Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/statprof.py

CHANGE DETAILS

diff --git a/mercurial/statprof.py b/mercurial/statprof.py
--- a/mercurial/statprof.py
+++ b/mercurial/statprof.py
@@ -238,7 +238,7 @@
 lineno = self.lineno - 1
 fp = None
 try:
-fp = open(self.path)
+fp = open(self.path, 'rb')
 for i, line in enumerate(fp):
 if i == lineno:
 self.source = line.strip()
@@ -274,8 +274,10 @@
 stack = []
 
 while frame:
-stack.append(CodeSite.get(frame.f_code.co_filename, frame.f_lineno,
-  frame.f_code.co_name))
+stack.append(CodeSite.get(
+pycompat.sysbytes(frame.f_code.co_filename),
+frame.f_lineno,
+pycompat.sysbytes(frame.f_code.co_name)))
 frame = frame.f_back
 
 return Sample(stack, time)
@@ -372,7 +374,7 @@
 file.write("%d\0%s\n" % (time, '\0'.join(sites)))
 
 def load_data(path):
-lines = open(path, 'r').read().splitlines()
+lines = open(path, 'rb').read().splitlines()
 
 state.accumulated_time = [float(value) for value in lines[0].split()]
 state.samples = []
@@ -512,9 +514,9 @@
 
 for stat in stats:
 site = stat.site
-sitelabel = '%s:%d:%s' % (pycompat.fsencode(site.filename()),
+sitelabel = '%s:%d:%s' % (site.filename(),
   site.lineno,
-  pycompat.sysbytes(site.function))
+  site.function)
 fp.write(b'%6.2f %9.2f %9.2f  %s\n' % (
 stat.selfpercent(), stat.totalseconds(),
 stat.selfseconds(), sitelabel))
@@ -532,7 +534,7 @@
 
 grouped = defaultdict(list)
 for stat in stats:
-grouped[stat.site.filename() + r":" + stat.site.function].append(stat)
+grouped[stat.site.filename() + b":" + stat.site.function].append(stat)
 
 # compute sums for each function
 functiondata = []
@@ -561,7 +563,7 @@
 function[3], # total percent
 function[1], # total cum sec
 function[2], # total self sec
-pycompat.sysbytes(function[0]))) # file:function
+function[0])) # file:function
 
 function[4].sort(reverse=True, key=lambda i: i.selfseconds())
 for stat in function[4]:
@@ -696,7 +698,7 @@
   ' %4.1f%%  %s %s'
 liststring = listpattern % (node.count / root.count * 100,
 filename, function)
-codepattern = '%' + str(55 - len(liststring)) + 's %s:  %s'
+codepattern = '%' + ('%d' % (55 - len(liststring))) + 's %d:  %s'
 codestring = codepattern % ('line', site.lineno, 
site.getsource(30))
 
 finalstring = liststring + codestring
@@ -777,7 +779,10 @@
 stack = []
 
 for frame in sample.stack:
-stack.append((frame.path, frame.lineno, frame.function))
+stack.append(
+(pycompat.sysstr(frame.path),
+ frame.lineno,
+ pycompat.sysstr(frame.function)))
 
 samples.append((sample.time, stack))
 



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


D5209: statprof: add a couple of asserts to avoid storing unicodes

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

REVISION SUMMARY
  I don't feel strongly about this change, so it'd be fine to drop it
  during review, but it was _extremely_ helpful in drafting the next
  change.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/statprof.py

CHANGE DETAILS

diff --git a/mercurial/statprof.py b/mercurial/statprof.py
--- a/mercurial/statprof.py
+++ b/mercurial/statprof.py
@@ -206,8 +206,10 @@
 __slots__ = (u'path', u'lineno', u'function', u'source')
 
 def __init__(self, path, lineno, function):
+assert isinstance(path, bytes)
 self.path = path
 self.lineno = lineno
+assert isinstance(function, bytes)
 self.function = function
 self.source = None
 



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


D5204: tests: add a critical flush() to run-tests.py to make output stable on py3

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

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -482,6 +482,7 @@
 parser.error('--with-hg must specify an executable hg script')
 if os.path.basename(options.with_hg) not in [b'hg', b'hg.exe']:
 sys.stderr.write('warning: --with-hg should specify an hg 
script\n')
+sys.stderr.flush()
 if options.local:
 testdir = os.path.dirname(_bytespath(canonpath(sys.argv[0])))
 reporootdir = os.path.dirname(testdir)



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


D5207: tests: skip wireproto clientreactor tests on Python 3.6.0-3.6.3 inclusive

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

REVISION SUMMARY
  See comment next to the if statement for sad details.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-wireproto-clientreactor.py

CHANGE DETAILS

diff --git a/tests/test-wireproto-clientreactor.py 
b/tests/test-wireproto-clientreactor.py
--- a/tests/test-wireproto-clientreactor.py
+++ b/tests/test-wireproto-clientreactor.py
@@ -1,5 +1,6 @@
 from __future__ import absolute_import
 
+import sys
 import unittest
 import zlib
 
@@ -600,5 +601,10 @@
 self.assertEqual(meta[b'data'], response2)
 
 if __name__ == '__main__':
+if (3, 6, 0) <= sys.version_info <= (3, 6, 3):
+# Python 3.6.0 through 3.6.3 inclusive shipped with
+# https://bugs.python.org/issue31825 and we can't run these
+# tests on those specific versions of Python. Sigh.
+sys.exit(0)
 import silenttestrunner
 silenttestrunner.main(__name__)



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


D5206: contrib: tweak import-checker to always use bytes for module names

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

REVISION SUMMARY
  We could go the other route and make embedded() return this as a
  bytes, but then it would be harder to portably doctest, so I prefer
  this option.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/import-checker.py

CHANGE DETAILS

diff --git a/contrib/import-checker.py b/contrib/import-checker.py
--- a/contrib/import-checker.py
+++ b/contrib/import-checker.py
@@ -696,7 +696,7 @@
 if py or f.endswith('.t'):
 with open(f, 'rb') as src:
 for script, modname, t, line in embedded(f, modname, src):
-yield script, modname, t, line
+yield script, modname.encode('utf8'), t, line
 
 def main(argv):
 if len(argv) < 2 or (argv[1] == '-' and len(argv) > 2):



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


D5205: contrib: fix import-checker to not b'' module names on Python 3

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

REVISION SUMMARY
  Caught by the doctests.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/import-checker.py

CHANGE DETAILS

diff --git a/contrib/import-checker.py b/contrib/import-checker.py
--- a/contrib/import-checker.py
+++ b/contrib/import-checker.py
@@ -674,6 +674,8 @@
 # "starts" is "line number" (1-origin), but embedded() is
 # expected to return "line offset" (0-origin). Therefore, this
 # yields "starts - 1".
+if not isinstance(modname, str):
+modname = modname.decode('utf8')
 yield code, "%s[%d]" % (modname, starts), name, starts - 1
 
 def sources(f, modname):



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


D5203: narrow: make copies.pathcopies() filter with narrowspec again

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

REVISION SUMMARY
  I broke this in 
https://phab.mercurial-scm.org/rHG707c3804e6077e6922fe3a3b7c503d28b596566c 
(narrow: move copies overrides to core,
  2018-09-28).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/copies.py
  tests/test-narrow-copies.t

CHANGE DETAILS

diff --git a/tests/test-narrow-copies.t b/tests/test-narrow-copies.t
--- a/tests/test-narrow-copies.t
+++ b/tests/test-narrow-copies.t
@@ -62,5 +62,4 @@
   $ hg pull -q
   $ hg --config extensions.rebase= rebase -d tip
   rebasing 3:4f84b666728c "add inside/f4"
-  abort: data/outside/f3.i@54e53435331b: no match found!
-  [255]
+  saved backup bundle to 
$TESTTMP/narrow/.hg/strip-backup/4f84b666728c-4269b76e-rebase.hg
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -219,6 +219,7 @@
 def _forwardcopies(a, b, match=None):
 """find {dst@b: src@a} copy mapping where a is an ancestor of b"""
 
+match = a.repo().narrowmatch(match)
 # check for working copy
 if b.rev() is None:
 if a == b.p1():



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


D5202: tests: demonstrate broken copies.pathcopies()

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

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-narrow-copies.t

CHANGE DETAILS

diff --git a/tests/test-narrow-copies.t b/tests/test-narrow-copies.t
--- a/tests/test-narrow-copies.t
+++ b/tests/test-narrow-copies.t
@@ -18,10 +18,12 @@
   $ echo modified > inside/f2
   $ hg ci -qm 'modify inside/f2'
 
+  $ mkdir outside
+  $ echo new > outside/f3
+  $ hg ci -Aqm 'add outside/f3'
   $ cd ..
 
-  $ hg clone --narrow ssh://user@dummy/master narrow --include inside
-  requesting all changes
+  $ hg clone --narrow ssh://user@dummy/master narrow --include inside -r 2
   adding changesets
   adding manifests
   adding file changes
@@ -55,3 +57,10 @@
   date:Thu Jan 01 00:00:00 1970 +
   summary: move f2 from outside
   
+  $ echo new > inside/f4
+  $ hg ci -Aqm 'add inside/f4'
+  $ hg pull -q
+  $ hg --config extensions.rebase= rebase -d tip
+  rebasing 3:4f84b666728c "add inside/f4"
+  abort: data/outside/f3.i@54e53435331b: no match found!
+  [255]



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


[Bug 6017] New: evolve 8.2.1 has a dependency on missing module

2018-11-01 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6017

Bug ID: 6017
   Summary: evolve 8.2.1 has a dependency on missing module
   Product: Mercurial
   Version: 4.7.2
  Hardware: PC
OS: Windows
Status: UNCONFIRMED
  Severity: bug
  Priority: normal
 Component: evolution
  Assignee: bugzi...@mercurial-scm.org
  Reporter: matt_harbi...@yahoo.com
CC: mercurial-devel@mercurial-scm.org,
pierre-yves.da...@ens-lyon.org

I think I've run into this before recently and sent a note to the evolve list,
but I hit it again pushing to an instance of `hg serve`:

10.30.1.91 - - [01/Nov/2018 16:04:34] "GET /?cmd=listkeys HTTP/1.1" 200 -
x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2
partial-pull
10.30.1.91 - - [01/Nov/2018 16:04:34] "GET /?cmd=branchmap HTTP/1.1" 200 -
x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2 partial-pull
10.30.1.91 - - [01/Nov/2018 16:04:34] "GET /?cmd=listkeys HTTP/1.1" 200 -
x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2
partial-pull
10.30.1.91 - - [01/Nov/2018 16:04:34] "POST /?cmd=unbundle HTTP/1.1" 500 -
x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=zstd,zlib,none,bzip2
partial-pull
10.30.1.91 - - [01/Nov/2018 16:04:34] Exception happened during processing
request '/?cmd=unbundle':
Traceback (most recent call last):
  File "mercurial\hgweb\server.pyo", line 102, in do_POST
  File "mercurial\hgweb\server.pyo", line 95, in do_write
  File "mercurial\hgweb\server.pyo", line 187, in do_hgweb
  File "mercurial\hgweb\hgwebdir_mod.pyo", line 351, in run_wsgi
  File "mercurial\hgweb\hgweb_mod.pyo", line 308, in run_wsgi
  File "mercurial\hgweb\hgweb_mod.pyo", line 334, in _runwsgi
  File "mercurial\extensions.pyo", line 359, in closure
  File "hgext\lfs\wireprotolfsserver.pyo", line 38, in handlewsgirequest
  File "mercurial\wireprotoserver.pyo", line 223, in handlewsgirequest
  File "mercurial\wireprotoserver.pyo", line 438, in _callhttp
  File "mercurial\wireprotov1server.pyo", line 74, in dispatch
  File "mercurial\wireprotov1server.pyo", line 594, in unbundle
  File "mercurial\exchange.pyo", line 2149, in unbundle
  File "mercurial\transaction.pyo", line 44, in _active
  File "mercurial\transaction.pyo", line 522, in close
  File "mercurial\localrepo.pyo", line 1585, in updater
  File "mercurial\localrepo.pyo", line 147, in wrapper
  File "hgext3rd\evolve\obscache.pyo", line 487, in updatecaches
  File "mercurial\localrepo.pyo", line 147, in wrapper
  File "hgext3rd\evolve\firstmergecache.pyo", line 53, in updatecaches
  File "mercurial\localrepo.pyo", line 147, in wrapper
  File "hgext3rd\evolve\depthcache.pyo", line 91, in updatecaches
  File "mercurial\localrepo.pyo", line 147, in wrapper
  File "hgext3rd\evolve\stablesort.pyo", line 680, in updatecaches
  File "mercurial\localrepo.pyo", line 147, in wrapper
  File "hgext3rd\evolve\stablerangecache.pyo", line 440, in updatecaches
  File "mercurial\localrepo.pyo", line 130, in __get__
  File "mercurial\util.pyo", line 1412, in __get__
  File "hgext3rd\evolve\stablerangecache.pyo", line 427, in stablerange
  File "hgext3rd\evolve\genericcaches.pyo", line 109, in update
  File "hgext3rd\evolve\stablerangecache.pyo", line 380, in load
  File "mercurial\util.pyo", line 1412, in __get__
  File "hgext3rd\evolve\stablerangecache.pyo", line 242, in _con
  File "hgext3rd\evolve\stablerangecache.pyo", line 236, in _db
  File "hgdemandimport\demandimportpy2.pyo", line 145, in __getattr__
  File "hgdemandimport\demandimportpy2.pyo", line 90, in _load
  File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport
  File "sqlite3\__init__.pyo", line 24, in 
  File "hgdemandimport\demandimportpy2.pyo", line 167, in _demandimport
  File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport
  File "sqlite3\dbapi2.pyo", line 28, in 
  File "hgdemandimport\demandimportpy2.pyo", line 167, in _demandimport
  File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport
  File "_sqlite3.pyo", line 12, in 
  File "_sqlite3.pyo", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.

Maybe there are missing dependencies with `pip install hg-evolve`?

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


[Bug 6016] New: Revision selection prompt tries to translate changeset description

2018-11-01 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6016

Bug ID: 6016
   Summary: Revision selection prompt tries to translate changeset
description
   Product: Mercurial
   Version: unspecified
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: evolution
  Assignee: bugzi...@mercurial-scm.org
  Reporter: m...@manueljacob.de
CC: mercurial-devel@mercurial-scm.org,
pierre-yves.da...@ens-lyon.org

How to reproduce:
- create one changeset with two children (one of them containing a non-ASCII
character in the description)
- update to the parent
- run "hg next"

Traceback (most recent call last):
  File "/bin/hg", line 41, in 
dispatch.run()
  File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 90, in
run
status = dispatch(req)
  File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 213, in
dispatch
ret = _runcatch(req) or 0
  File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 354, in
_runcatch
return _callcatch(ui, _runcatchfunc)
  File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 362, in
_callcatch
return scmutil.callcatch(ui, func)
  File "/usr/lib/python2.7/site-packages/mercurial/scmutil.py", line 161, in
callcatch
return func()
  File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 344, in
_runcatchfunc
return _dispatch(req)
  File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 984, in
_dispatch
cmdpats, cmdoptions)
  File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 730, in
runcommand
ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 992, in
_runcommand
return cmdfunc()
  File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 981, in

d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/usr/lib/python2.7/site-packages/mercurial/util.py", line 1528, in
check
return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mercurial/util.py", line 1528, in
check
return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/hgext/mq.py", line 3600, in mqcommand
return orig(ui, repo, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mercurial/util.py", line 1528, in
check
return func(*args, **kwargs)
  File
"/home/manu/.local/lib/python2.7/site-packages/hgext3rd/evolve/__init__.py",
line 1165, in cmdnext
choosedrev = utility.revselectionprompt(ui, repo, crevs, cheader)
  File
"/home/manu/.local/lib/python2.7/site-packages/hgext3rd/evolve/utility.py",
line 165, in revselectionprompt
curctx.description().split("\n")[0]))
  File "/usr/lib/python2.7/site-packages/mercurial/i18n.py", line 78, in
gettext
paragraphs = [p.decode("ascii") for p in message.split('\n\n')]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 60:
ordinal not in range(128)

The problem is that, beginning with changeset 846f7d4fe47e, the function
"revselectionprompt" tries to translate the changeset description.  I think
that this is incorrect in all cases, but only if one of the children contain a
non-ASCII character, there will be an exception.

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


D5201: delta: skip "empty delta" optimisation for non-general case (issue6006)

2018-11-01 Thread lothiraldan (Boris Feld)
lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Non-general delta repository cannot delta against anything than prev. So even 
if
  the delta to prev is empty we should use it.
  
  This is similar to the change made in 
https://phab.mercurial-scm.org/rHGbafa1c4bb7a8d397f62e0cd75b8064ef1375b753.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/revlogutils/deltas.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/deltas.py b/mercurial/revlogutils/deltas.py
--- a/mercurial/revlogutils/deltas.py
+++ b/mercurial/revlogutils/deltas.py
@@ -593,7 +593,10 @@
 group = []
 for rev in temptative:
 # skip over empty delta (no need to include them in a chain)
-while not (rev == nullrev or rev in tested or deltalength(rev)):
+while (revlog._generaldelta
+and not (rev == nullrev
+ or rev in tested
+ or deltalength(rev))):
 tested.add(rev)
 rev = deltaparent(rev)
 # filter out revision we tested already



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


D5196: changegroup: restore default node ordering (issue6001)

2018-11-01 Thread lothiraldan (Boris Feld)
lothiraldan added a comment.


  With the fix, we are back to pre-regression performance on the test suite.
  
  Can we update the last paragraph of the changeset description to replace it 
with the previous phrase?
  
  There is two tests that are actually slower between 
https://phab.mercurial-scm.org/rHGd9b3cc3d5d07fb864d2ebba2a17f784a583dbc65 (the 
parent of the regression) and the fix, which are:
  
+ 206±2ms 310±40ms 1.51  
basic_commands.PushPullTimeSuite.time_push('mozilla-central-2018-08-01', 
'local', 'same', 'default')
+ 175±1ms 226±30ms 1.30  
basic_commands.PushPullTimeSuite.time_push('mozilla-central-2018-08-01', 
'local', 'same', None)
  
  There are push operations between the same repository, no-op push. As they 
are no-op push, I think there is no bundle generation so the fix shouldn't 
impact the performance. We may have another slowdown.

REPOSITORY
  rHG Mercurial

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

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


D4750: filelog: stop proxying rawsize() (API)

2018-11-01 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   > Apparently thg uses this to avoid loading the data into memory just to 
figure out the length like fctx.rawsize().  Any suggestions?
  >   >
  >   > https://groups.google.com/d/msg/thg-dev/6ekYID7ho_o/fbdd6rVDAwAJ
  >   
  >   
  >   Just found this comment when going through mail backlog.
  >   
  >   Do we want to do anything about this before the 4.8 release?
  
  No. I've updated the caller to directly access to _revlog.
  
  > I'd really like to know why thg wants to access the size of a revision
  >  without accessing the revision text...
  
  In order to decide whether diff should be generated. There's a "max size
  to show diff" config knob, and we don't want to load large blob into memory.
  
  What we need is a light-weight method to get approximate data size.

REPOSITORY
  rHG Mercurial

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

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