Re: [PATCH] spelling: fixes of non-dictionary words

2016-10-17 Thread Augie Fackler
On Mon, Oct 17, 2016 at 11:38:02PM +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich 
> # Date 1476739015 -7200
> #  Mon Oct 17 23:16:55 2016 +0200
> # Node ID efd5397e9da5b1d7e2c3353b0b06fc904651b150
> # Parent  8a864844d5a0c34bdb24d2e098a0cd339e32e020
> spelling: fixes of non-dictionary words

Queued, with some hunks discarded. I've tried to note the interesting ones.

>
> diff --git a/contrib/all-revsets.txt b/contrib/all-revsets.txt
> --- a/contrib/all-revsets.txt
> +++ b/contrib/all-revsets.txt
> @@ -8,7 +8,7 @@
>  #
>  # Please update this file with any revsets you use for benchmarking a change 
> so
>  # that future contributors can easily find and retest it when doing further
> -# modification. Feel free to highlight interresting variants if needed.
> +# modification. Feel free to highlight interesting variants if needed.
>
>
>  ## Revset from this section are all extracted from changelog when this file 
> was
> diff --git a/contrib/check-code.py b/contrib/check-code.py
> --- a/contrib/check-code.py
> +++ b/contrib/check-code.py
> @@ -463,7 +463,7 @@ def _preparepats():
>  failandwarn = c[-1]
>  for pats in failandwarn:
>  for i, pseq in enumerate(pats):
> -# fix-up regexes for multi-line searches
> +# fix-up regexps for multi-line searches

I've always used singular "regex" plural "regexes" - I don't see
"regexp" much in my day-to-day life. Dropped all instances of this
correction for now.

> @@ -192,7 +192,7 @@ def readbundle(ui, fh, fname, vfs=None):
>  def getbundlespec(ui, fh):
>  """Infer the bundlespec from a bundle file handle.
>
> -The input file handle is seeked and the original seek position is not
> +The input file handle is sought and the original seek position is not

I would correct this to seek()ed rather than sought - I'm a native
speaker and I wouldn't immediately follow the intent of the corrected
version here. Dropped all matching hunks for now.

Many thanks for this work - it's very valuable!
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


RE: [PATCH 2 of 5 v4] mergecopies: add logic to process incomplete data

2016-10-17 Thread Gábor STEFANIK
>


--
This message, including its attachments, is confidential. For more information 
please read NNG's email policy here:
http://www.nng.com/emailpolicy/
By responding to this email you accept the email policy.


-Original Message-
> From: Pierre-Yves David [mailto:pierre-yves.da...@ens-lyon.org]
> Sent: Monday, October 17, 2016 11:40 PM
> To: Gábor STEFANIK ; mercurial-
> de...@mercurial-scm.org
> Subject: Re: [PATCH 2 of 5 v4] mergecopies: add logic to process incomplete
> data
>
>
>
> On 10/17/2016 08:42 PM, Gábor Stefanik wrote:
> > # HG changeset patch
> > # User Gábor Stefanik  # Date 1475578314 -7200
> > #  Tue Oct 04 12:51:54 2016 +0200
> > # Node ID f5f046a680e6730485df1760f82a0e0084305873
> > # Parent  d8379d11021b681a06cda08a07da237eaca520b2
> > mergecopies: add logic to process incomplete data
> >
> > We first combine incomplete copies on the two sides of the topological
> > CA into complete copies.
> > Any leftover incomplete copies are then combined with the incomplete
> > divergences to reconstruct divergences spanning over the topological CA.
> > Finally we promote any divergences falsely flagged as incomplete to
> > full divergences.
> >
> > Right now, there is nothing generating incomplete copy/divergence
> > data, so this code does nothing. Changes to _checkcopies to populate
> > these dicts are coming later in this series.
> >
> > diff -r d8379d11021b -r f5f046a680e6 mercurial/copies.py
> > --- a/mercurial/copies.pyWed Oct 12 11:54:03 2016 +0200
> > +++ b/mercurial/copies.pyTue Oct 04 12:51:54 2016 +0200
> > @@ -289,6 +289,22 @@
> >  return fctx
> >  return util.lrucachefunc(makectx)
> >
> > +def _combinecopies(copyfrom, copyto, finalcopy, diverge,
> incompletediverge):
> > +"""combine partial copy paths"""
> > +remainder = {}
> > +for f in copyfrom:
> > +if f in copyto:
> > +finalcopy[copyto[f]] = copyfrom[f]
> > +del copyto[f]
> > +for f in incompletediverge:
> > +assert f not in diverge
> > +ic = incompletediverge[f]
> > +if ic[0] in copyto:
> > +diverge[f] = [copyto[ic[0]], ic[1]]
> > +else:
> > +remainder[f] = ic
> > +return remainder
> > +
> >  def mergecopies(repo, c1, c2, base):
> >  """
> >  Find moves and copies between context c1 and c2 that are relevant
> > @@ -360,14 +376,21 @@
> >  # - diverge = record all diverges in this dict
> >  # - copy = record all non-divergent copies in this dict
> >  # - fullcopy = record all copies in this dict
> > +# - incomplete = record non-divergent partial copies here
> > +# - incompletediverge = record divergent partial copies here
> >  diverge = {} # divergence data is shared
> > +incompletediverge  = {}
> >  data1 = {'copy': {},
> >   'fullcopy': {},
> > + 'incomplete': {},
> >   'diverge': diverge,
> > + 'incompletediverge': incompletediverge,
> >  }
> >  data2 = {'copy': {},
> >   'fullcopy': {},
> > + 'incomplete': {},
> >   'diverge': diverge,
> > + 'incompletediverge': incompletediverge,
> >  }
> >
> >  # find interesting file sets from manifests @@ -398,6 +421,13 @@
> >  copy = dict(data1['copy'].items() + data2['copy'].items())
> >  fullcopy = dict(data1['fullcopy'].items() +
> > data2['fullcopy'].items())
> >
> > +if dirtyc1:
> > +_combinecopies(data2['incomplete'], data1['incomplete'], copy,
> diverge,
> > +   incompletediverge)
> > +else:
> > +_combinecopies(data1['incomplete'], data2['incomplete'], copy,
> diverge,
> > +   incompletediverge)
> > +
> >  renamedelete = {}
> >  renamedeleteset = set()
> >  divergeset = set()
> > @@ -416,13 +446,36 @@
> >  repo.ui.debug("  unmatched files new in both:\n   %s\n"
> >% "\n   ".join(bothnew))
> >  bothdiverge = {}
> > -bothdata = {'copy': {},
> > -'fullcopy': {},
> > -'diverge': bothdiverge,
> > -   }
> > +bothincompletediverge = {}
> > +both1 = {'copy': {},
> > + 'fullcopy': {},
> > + 'incomplete': {},
> > + 'diverge': bothdiverge,
> > + 'incompletediverge': bothincompletediverge
> > +}
> > +both2 = {'copy': {},
> > + 'fullcopy': {},
> > + 'incomplete': {},
> > + 'diverge': bothdiverge,
> > + 'incompletediverge': bothincompletediverge
> > +}
> >  for f in bothnew:
> > -_checkcopies(c1, f, m1, m2, base, tca, limit, bothdata)
> > -_checkcopies(c2, f, m2, m1, base, tca, limit, bothdata)
> > +_checkcopies(c1, f, m1, m2, base, tca, limit, both1)
> > +   

[PATCH] copies: improve assertions during copy recombination

2016-10-17 Thread Gábor Stefanik
# HG changeset patch
# User Gábor Stefanik 
# Date 1476749348 -7200
#  Tue Oct 18 02:09:08 2016 +0200
# Node ID 87a7c0d403ff29dcae2a41e0516c75bbd9f6a5a8
# Parent  abe7230025099bbeb9eaa0d3ca29c8f700ddb1e2
copies: improve assertions during copy recombination

- Make sure there is nothing to recombine in non-graftlike scenarios
- More pythonic assert syntax

diff -r abe723002509 -r 87a7c0d403ff mercurial/copies.py
--- a/mercurial/copies.py   Mon Oct 17 16:12:12 2016 -0700
+++ b/mercurial/copies.py   Tue Oct 18 02:09:08 2016 +0200
@@ -447,6 +447,7 @@
   % "\n   ".join(bothnew))
 bothdiverge = {}
 bothincompletediverge = {}
+remainder = {}
 both1 = {'copy': {},
  'fullcopy': {},
  'incomplete': {},
@@ -463,13 +464,19 @@
 _checkcopies(c1, f, m1, m2, base, tca, dirtyc1, limit, both1)
 _checkcopies(c2, f, m2, m1, base, tca, dirtyc2, limit, both2)
 if dirtyc1:
-assert both2['incomplete'] == {}
+# incomplete copies may only be found on the "dirty" side for bothnew
+assert not both2['incomplete']
 remainder = _combinecopies({}, both1['incomplete'], copy, bothdiverge,
bothincompletediverge)
-else:
-assert both1['incomplete'] == {}
+elif dirtyc2:
+assert not both1['incomplete']
 remainder = _combinecopies({}, both2['incomplete'], copy, bothdiverge,
bothincompletediverge)
+else:
+# incomplete copies and divergences can't happen outside grafts
+assert not both1['incomplete']
+assert not both2['incomplete']
+assert not bothincompletediverge
 for f in remainder:
 assert f not in bothdiverge
 ic = remainder[f]
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 4 of 4] changegroup: increase write buffer size to 128k

2016-10-17 Thread Augie Fackler
On Sun, Oct 16, 2016 at 01:35:37PM -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc 
> # Date 1476650123 25200
> #  Sun Oct 16 13:35:23 2016 -0700
> # Node ID 4582f12754622ae049afefee05176ef107d99a7e
> # Parent  9e2f957b05ac5c76595280a6084ba01d7b369a05
> changegroup: increase write buffer size to 128k

This patch seems very reasonable. The others make me a tad nervous for
this late in the cycle - I don't /think/ we'll find weird concurrency
problems (past series from you on revlog handling likely have sniffed
out any potential bad actors around concurrency), but in the name of
paranoia let's land those right after we release 4.0. They look fine
to me as-is, for what it's worth, so please remail them on November 2
with me on the CC line.

>
> By default, Python defers to the operating system for choosing the
> default buffer size on opened files. On my Linux machine, the default
> is 4k, which is really small for 2016.
>
> This patch bumps the write buffer size when writing
> changegroups/bundles to 128k. This matches the 128k read buffer
> we already use on revlogs.
>
> It's worth noting that this only impacts when writing to an explicit
> file (such as during `hg bundle`). Buffers when writing to bundle
> files via the repo vfs or to a temporary file are not impacted.
>
> When producing a none-v2 bundle file of the mozilla-unified repository,
> this change caused the number of write() system calls to drop from
> 952,449 to 29,788. After this change, the most frequent system
> calls are fstat(), read(), lseek(), and open(). There were
> 2,523,672 system calls after this patch (so a net decrease of
> ~950k is statistically significant).
>
> This change shows no performance change on my system. But I have a
> high-end system with a fast SSD. It is quite possible this change
> will have a significant impact on network file systems, where
> extra network round trips due to excessive I/O system calls could
> introduce significant latency.
>
> diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
> --- a/mercurial/changegroup.py
> +++ b/mercurial/changegroup.py
> @@ -88,17 +88,19 @@ def writechunks(ui, chunks, filename, vf
>  """
>  fh = None
>  cleanup = None
>  try:
>  if filename:
>  if vfs:
>  fh = vfs.open(filename, "wb")
>  else:
> -fh = open(filename, "wb")
> +# Increase default buffer size because default is usually
> +# small (4k is common on Linux).
> +fh = open(filename, "wb", 131072)
>  else:
>  fd, filename = tempfile.mkstemp(prefix="hg-bundle-", 
> suffix=".hg")
>  fh = os.fdopen(fd, "wb")
>  cleanup = filename
>  for c in chunks:
>  fh.write(c)
>  cleanup = None
>  return filename
> ___
> 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: [PATCH] treemanifest: fix bad argument order to treemanifestctx

2016-10-17 Thread Augie Fackler
On Mon, Oct 17, 2016 at 11:39:51PM +, Martin von Zweigbergk via 
Mercurial-devel wrote:
> On Mon, Oct 17, 2016 at 4:34 PM Durham Goode  wrote:
>
> > On 10/17/16, 4:13 PM, "Martin von Zweigbergk" 
> > wrote:
> >
> > ># HG changeset patch
> > ># User Martin von Zweigbergk 
> > ># Date 1476745932 25200
> > >#  Mon Oct 17 16:12:12 2016 -0700
> > ># Node ID b36a81cd4015b9742d1fbb0d5f94207e7a400cdb
> > ># Parent  8a864844d5a0c34bdb24d2e098a0cd339e32e020
> > >treemanifest: fix bad argument order to treemanifestctx
> > >
> > >Found by running tests with _treeinmem (both of them) modified to be
> > >True.
> > >
> > >diff -r 8a864844d5a0 -r b36a81cd4015 mercurial/manifest.py
> > >--- a/mercurial/manifest.pyWed Oct 12 21:33:45 2016 +0200
> > >+++ b/mercurial/manifest.pyMon Oct 17 16:12:12 2016 -0700
> > >@@ -1386,7 +1386,7 @@
> > > # Need to perform a slow delta
> > > revlog = self._revlog
> > > r0 = revlog.deltaparent(revlog.rev(self._node))
> > >-m0 = treemanifestctx(revlog, revlog.node(r0),
> > dir=self._dir).read()
> > >+m0 = treemanifestctx(revlog, self._dir, revlog.node(r0)).read()
> > > m1 = self.read()
> > > md = treemanifest(dir=self._dir)
> > > for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems():
> >
> > Looks good to me.  What would be required to get some _treeinmem code
> > coverage in the tests?

LGTM as well - I can't get the patch to apply - maybe some damage in
flight. Please feel encouraged to just push it to committed and let us
know here that you've done that.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] treemanifest: fix bad argument order to treemanifestctx

2016-10-17 Thread Martin von Zweigbergk via Mercurial-devel
On Mon, Oct 17, 2016 at 4:42 PM Durham Goode  wrote:





*From: *Martin von Zweigbergk 
*Date: *Monday, October 17, 2016 at 4:39 PM
*To: *Durham Goode , "mercurial-devel@mercurial-scm.org" <
mercurial-devel@mercurial-scm.org>
*Subject: *Re: [PATCH] treemanifest: fix bad argument order to
treemanifestctx





On Mon, Oct 17, 2016 at 4:34 PM Durham Goode  wrote:

On 10/17/16, 4:13 PM, "Martin von Zweigbergk"  wrote:

># HG changeset patch
># User Martin von Zweigbergk 
># Date 1476745932 25200
>#  Mon Oct 17 16:12:12 2016 -0700
># Node ID b36a81cd4015b9742d1fbb0d5f94207e7a400cdb
># Parent  8a864844d5a0c34bdb24d2e098a0cd339e32e020
>treemanifest: fix bad argument order to treemanifestctx
>
>Found by running tests with _treeinmem (both of them) modified to be
>True.
>
>diff -r 8a864844d5a0 -r b36a81cd4015 mercurial/manifest.py
>--- a/mercurial/manifest.pyWed Oct 12 21:33:45 2016 +0200
>+++ b/mercurial/manifest.pyMon Oct 17 16:12:12 2016 -0700
>@@ -1386,7 +1386,7 @@
> # Need to perform a slow delta
> revlog = self._revlog
> r0 = revlog.deltaparent(revlog.rev(self._node))
>-m0 = treemanifestctx(revlog, revlog.node(r0),
dir=self._dir).read()
>+m0 = treemanifestctx(revlog, self._dir, revlog.node(r0)).read()
> m1 = self.read()
> md = treemanifest(dir=self._dir)
> for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems():

Looks good to me.  What would be required to get some _treeinmem code
coverage in the tests?



Twice the runtime? :-) But seriously, I suspect that's reason enough that
we don't want it enabled by default. And I don't know what subset would be
useful to run it on either.



But it was much less broken than I expected, actually. This was all that
was needed. I expected it to be broken before your series even started, but
it wasn't. There is one failing test case (test-rebase-newancestor.t) that
I have not understood why it's failing. It scares me a bit that I still
don't know why it's failing.



Just doing one run of test-manifest.t with it on would probably be enough
to catch most issues.  What’s the exact command you used to run the tests?
So I can run it myself before sending more patches.


 sed -i -e 's/_treeinmem =.*/_treeinmem = True/g' mercurial/manifest.py
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH stable] tests: work around instability that caused test from 4999c12c526b to fail

2016-10-17 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1476746894 -7200
#  Tue Oct 18 01:28:14 2016 +0200
# Branch stable
# Node ID 548f82b480d086c7a551b025fb980cd70187c880
# Parent  328545c7d8a1044330b8a5bfbdd9c2ff08625d6a
tests: work around instability that caused test from 4999c12c526b to fail

diff --git a/tests/test-largefiles-update.t b/tests/test-largefiles-update.t
--- a/tests/test-largefiles-update.t
+++ b/tests/test-largefiles-update.t
@@ -732,12 +732,16 @@ bit correctly on the platform being unaw
 
 #endif
 
+FIXME: At this point large2 seems to be fishy and cause up -c to fail
+"randomly" even though summary shows no changes. For now, just work around it:
+  $ rm large2 .hglf/large2
+
 Test a fatal error interrupting an update. Verify that status report dirty
 files correctly after an interrupted update. Also verify that checking all
 hashes reveals it isn't clean.
 
 Start with clean dirstates:
-  $ hg up -qcr "8^"
+  $ hg up -qCr "8^"
   $ sleep 1
   $ hg st
 Update standins without updating largefiles - large1 is modified and largeX is
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH] treemanifest: fix bad argument order to treemanifestctx

2016-10-17 Thread Martin von Zweigbergk via Mercurial-devel
# HG changeset patch
# User Martin von Zweigbergk 
# Date 1476745932 25200
#  Mon Oct 17 16:12:12 2016 -0700
# Node ID b36a81cd4015b9742d1fbb0d5f94207e7a400cdb
# Parent  8a864844d5a0c34bdb24d2e098a0cd339e32e020
treemanifest: fix bad argument order to treemanifestctx

Found by running tests with _treeinmem (both of them) modified to be
True.

diff -r 8a864844d5a0 -r b36a81cd4015 mercurial/manifest.py
--- a/mercurial/manifest.py Wed Oct 12 21:33:45 2016 +0200
+++ b/mercurial/manifest.py Mon Oct 17 16:12:12 2016 -0700
@@ -1386,7 +1386,7 @@
 # Need to perform a slow delta
 revlog = self._revlog
 r0 = revlog.deltaparent(revlog.rev(self._node))
-m0 = treemanifestctx(revlog, revlog.node(r0), dir=self._dir).read()
+m0 = treemanifestctx(revlog, self._dir, revlog.node(r0)).read()
 m1 = self.read()
 md = treemanifest(dir=self._dir)
 for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems():
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2 V2] wireproto: compress data from a generator

2016-10-17 Thread Pierre-Yves David



On 10/16/2016 08:14 PM, Gregory Szorc wrote:

# HG changeset patch
# User Gregory Szorc 
# Date 1476641421 25200
#  Sun Oct 16 11:10:21 2016 -0700
# Node ID 23457f8910d43bd637b945ced2f963ab71255844
# Parent  3f18f7464e651128a5f8d9c9312805adbc22f547
wireproto: compress data from a generator


Pushed, thanks.

It would be great to have some performance number on this,


[…]

To avoid duplicate code, the HTTP groupchunks() has been reimplemented
in terms of compresschunks().


I would have been happier to take a first patch introducing the new 
function and reimplementing groupchunkgs with it, followed by a second 
patch dropping chunkbuffer. That was minor to ignore but consider doing 
so in the future.


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


Re: [PATCH 1 of 4] revlog: add a context manager to allow file handle reuse

2016-10-17 Thread Pierre-Yves David



On 10/16/2016 10:35 PM, Gregory Szorc wrote:

# HG changeset patch
# User Gregory Szorc 
# Date 1476649322 25200
#  Sun Oct 16 13:22:02 2016 -0700
# Node ID 735adf139447190fe52c65ec6e9b4e5e0c81d6aa
# Parent  757d25d2bbe63fc560e92b6bb25fbfbf09b09342
revlog: add a context manager to allow file handle reuse



For your information, given the proximity of the freeze (tomorrow,
November 18th), this is unlikely to get attention in time. If we do not 
get to this, please resend when 4.0 is out on November first,


For details see:
https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-October/089252.html


Currently, read-only operations traversing revlogs must open a new
file handle whenever they need uncached data from the underlying
revlog. This can add overhead to operations such as changegroup
generation.

The revlog APIs have a mechanism for reusing a file descriptor
for I/O. This was added by me a while ago as a means to speed up
revlog.addgroup(). At that time, I didn't do any work around
reusing file handles for read operations.

This patch introduces a context manager to cache an open file handle
on a revlog. When the context manager is active, revlog reads will
be routed to the opened file handle instead of opening a single
use file handle.

There is definitely room to improve the API. We could probably
even refactor the write file descriptor caching to use a context
manager - possibly the same one! However, this is a bit of work
since the write file handle can be swapped out if a revlog
transitions from inline to non-inline in the course of adding
revisions.

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -9,16 +9,17 @@

 This provides efficient delta storage with O(1) retrieve and append
 and O(changes) merge between branches.
 """

 from __future__ import absolute_import

 import collections
+import contextlib
 import errno
 import hashlib
 import os
 import struct
 import zlib

 # import stuff from node for others to import from revlog
 from .node import (
@@ -309,16 +310,18 @@ class revlog(object):
 self.index, nodemap, self._chunkcache = d
 if nodemap is not None:
 self.nodemap = self._nodecache = nodemap
 if not self._chunkcache:
 self._chunkclear()
 # revnum -> (chain-length, sum-delta-length)
 self._chaininfocache = {}

+self._readfh = None
+
 def tip(self):
 return self.node(len(self.index) - 2)
 def __contains__(self, rev):
 return 0 <= rev < len(self)
 def __len__(self):
 return len(self.index) - 1
 def __iter__(self):
 return iter(xrange(len(self)))
@@ -1013,27 +1016,57 @@ class revlog(object):
 """
 o, d = self._chunkcache
 # try to add to existing cache
 if o + len(d) == offset and len(d) + len(data) < _chunksize:
 self._chunkcache = o, d + data
 else:
 self._chunkcache = offset, data

+@contextlib.contextmanager
+def cachefilehandle(self):
+"""Maintain a persistent file handle during operations.
+
+When this context manager is active, a file descriptor will be reused
+for all read operations, ensuring the underlying revlog file isn't
+reopened multiple times.
+"""
+if self._readfh:
+raise error.Abort('cachefilehandle already active')
+
+# Inline revlogs have data chunks cached at open time. If we opened
+# a file handle it wouldn't be read.
+if self._inline:
+yield
+return
+
+try:
+self._readfh = self.opener(self.datafile)
+yield
+finally:
+self._readfh.close()
+self._readfh = None
+
 def _loadchunk(self, offset, length, df=None):
 """Load a segment of raw data from the revlog.

 Accepts an absolute offset, length to read, and an optional existing
 file handle to read from.

 If an existing file handle is passed, it will be seeked and the
 original seek position will NOT be restored.

 Returns a str or buffer of raw byte data.
 """
+# Use cached file handle from context manager automatically.
+# self._readfh is always opened in read-only mode. df may be opened
+# in append mode. The context manager should only be active during
+# read operations. So this mismatch is OK.
+df = df or self._readfh
+
 if df is not None:
 closehandle = False
 else:
 if self._inline:
 df = self.opener(self.indexfile)
 else:
 df = self.opener(self.datafile)
 closehandle = True
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel



--

Re: [PATCH] revset: optimize for destination() being "inefficient"

2016-10-17 Thread Pierre-Yves David



On 10/17/2016 07:48 PM, Mads Kiilerich wrote:

# HG changeset patch
# User Mads Kiilerich 
# Date 1476726516 -7200
#  Mon Oct 17 19:48:36 2016 +0200
# Node ID 50a7bbe82bd3b63a934640b1480ee643cf14ec5f
# Parent  5cb830801855dbb63e98b948e355bc995d295bf3
revset: optimize for destination() being "inefficient"


Sure, pushed, thanks

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


mercurial@30191: 3 new changesets (3 on stable)

2016-10-17 Thread Mercurial Commits
3 new changesets (3 on stable) in mercurial:

http://selenic.com/repo/hg//rev/4999c12c526b
changeset:   30189:4999c12c526b
branch:  stable
parent:  30030:8d74027bd4e7
user:Mads Kiilerich 
date:Sun Oct 16 02:26:38 2016 +0200
summary: largefiles: test coverage of fatal interruption of update

http://selenic.com/repo/hg//rev/56b930238036
changeset:   30190:56b930238036
branch:  stable
user:Mads Kiilerich 
date:Sun Oct 16 02:29:45 2016 +0200
summary: largefiles: more safe handling of interruptions while updating 
modifications

http://selenic.com/repo/hg//rev/328545c7d8a1
changeset:   30191:328545c7d8a1
branch:  stable
tag: tip
user:Mads Kiilerich 
date:Mon Oct 17 17:12:24 2016 +0200
summary: largefiles: fix 'deleted' files sometimes persistently appearing 
with R status

-- 
Repository URL: http://selenic.com/repo/hg/
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 4 of 5 v4] copies: make _checkcopies handle copy sequences spanning the TCA (issue4028)

2016-10-17 Thread Pierre-Yves David



On 10/17/2016 08:42 PM, Gábor Stefanik wrote:

# HG changeset patch
# User Gábor Stefanik 
# Date 1476153587 -7200
#  Tue Oct 11 04:39:47 2016 +0200
# Node ID 3fc51a50bec71bb34c11beaaa6686d521ac706b1
# Parent  d1a0366565988c2a58a21f1788557064c9590c46
copies: make _checkcopies handle copy sequences spanning the TCA (issue4028)


Have also pushed these four. I've some small style feedback on Patch2 
that I would be happy to see addressed in a follow up but nothing worth 
delaying this before the freeze.


Thanks for taking the time to do the rework and clarification to get 
this important changes in. I hope the time we spend reworking it will 
make the life of this series's second reviewers simpler.


Cheers,

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


[PATCH] spelling: fixes of non-dictionary words

2016-10-17 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1476739015 -7200
#  Mon Oct 17 23:16:55 2016 +0200
# Node ID efd5397e9da5b1d7e2c3353b0b06fc904651b150
# Parent  8a864844d5a0c34bdb24d2e098a0cd339e32e020
spelling: fixes of non-dictionary words

diff --git a/contrib/all-revsets.txt b/contrib/all-revsets.txt
--- a/contrib/all-revsets.txt
+++ b/contrib/all-revsets.txt
@@ -8,7 +8,7 @@
 #
 # Please update this file with any revsets you use for benchmarking a change so
 # that future contributors can easily find and retest it when doing further
-# modification. Feel free to highlight interresting variants if needed.
+# modification. Feel free to highlight interesting variants if needed.
 
 
 ## Revset from this section are all extracted from changelog when this file was
diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -463,7 +463,7 @@ def _preparepats():
 failandwarn = c[-1]
 for pats in failandwarn:
 for i, pseq in enumerate(pats):
-# fix-up regexes for multi-line searches
+# fix-up regexps for multi-line searches
 p = pseq[0]
 # \s doesn't match \n
 p = re.sub(r'(?_GenericReview(argslist) 
 let s:origtabpagenr = tabpagenr()
 silent! exe 'tabedit ' . StrippedRelativeFilePath
 if exists('patchcmd')
-  " modelines in loaded files mess with diff comparision
+  " modelines in loaded files mess with diff comparison
   let s:keep_modeline=
   let =0
   silent! exe 'vert diffsplit ' . tmpname . '.file'
diff --git a/hgext/chgserver.py b/hgext/chgserver.py
--- a/hgext/chgserver.py
+++ b/hgext/chgserver.py
@@ -629,7 +629,7 @@ class chgunixservicehandler(object):
 
 def chgunixservice(ui, repo, opts):
 if repo:
-# one chgserver can serve multiple repos. drop repo infomation
+# one chgserver can serve multiple repos. drop repo information
 ui.setconfig('bundle', 'mainreporoot', '', 'repo')
 h = chgunixservicehandler(ui)
 return commandserver.unixforkingservice(ui, repo=None, opts=opts, 
handler=h)
diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -563,7 +563,7 @@ def wrapsymlink(orig, source, link_name)
 pass
 
 class state_update(object):
-''' This context mananger is responsible for dispatching the state-enter
+''' This context manager is responsible for dispatching the state-enter
 and state-leave signals to the watchman service '''
 
 def __init__(self, repo, node, distance, partial):
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1406,12 +1406,12 @@ def verifyactions(actions, state, ctxs):
% node.short(missing[0]))
 
 def adjustreplacementsfrommarkers(repo, oldreplacements):
-"""Adjust replacements from obsolescense markers
+"""Adjust replacements from obsolescence markers
 
 Replacements structure is originally generated based on
 histedit's state and does not account for changes that are
 not recorded there. This function fixes that by adding
-data read from obsolescense markers"""
+data read from obsolescence markers"""
 if not obsolete.isenabled(repo, obsolete.createmarkersopt):
 return oldreplacements
 
diff --git a/hgext/logtoprocess.py b/hgext/logtoprocess.py
--- a/hgext/logtoprocess.py
+++ b/hgext/logtoprocess.py
@@ -27,7 +27,7 @@ For example::
 
 would log the warning message and traceback of any failed command dispatch.
 
-Scripts are run asychronously as detached daemon processes; mercurial will
+Scripts are run asynchronously as detached daemon processes; mercurial will
 not ensure that they exit cleanly.
 
 """
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1382,7 +1382,7 @@ def _computeobsoletenotrebased(repo, reb
 """return a mapping obsolete => successor for all obsolete nodes to be
 rebased that have a successors in the destination
 
-obsolete => None entries in the mapping indicate nodes with no succesor"""
+obsolete => None entries in the mapping indicate nodes with no successor"""
 obsoletenotrebased = {}
 
 # Build a mapping successor => obsolete nodes for the obsolete
diff --git a/i18n/ja.po b/i18n/ja.po
--- a/i18n/ja.po
+++ b/i18n/ja.po
@@ -6713,7 +6713,7 @@ msgid ""
 msgstr ""
 
 msgid ""
-"Scripts are run asychronously as detached daemon processes; mercurial will\n"
+"Scripts are run asynchronously as detached daemon processes; mercurial will\n"
 "not ensure that they exit cleanly."
 msgstr ""
 
@@ -10334,7 +10334,7 @@ msgid "corrupted shelved state file"
 msgstr "shelve 状態管理ファイルが破損しています"
 
 msgid "please run hg unshelve --abort to abort unshelve operation"
-msgstr "'hg unshelve --abort' を実施して unshleve 操作を中断してください"

mercurial@30188: 25 new changesets

2016-10-17 Thread Mercurial Commits
25 new changesets in mercurial:

http://selenic.com/repo/hg//rev/1c518d69d994
changeset:   30164:1c518d69d994
user:Pierre-Yves David 
date:Thu Oct 13 13:47:47 2016 +0200
summary: eol: make sure we always release the wlock when writing cache

http://selenic.com/repo/hg//rev/423377290a3a
changeset:   30165:423377290a3a
user:Martijn Pieters 
date:Fri Oct 14 17:55:02 2016 +0100
summary: py3: refactor token parsing to handle call args properly

http://selenic.com/repo/hg//rev/102e6ef5bb3a
changeset:   30166:102e6ef5bb3a
user:Martijn Pieters 
date:Thu Oct 13 09:27:37 2016 +0100
summary: py3: use namedtuple._replace to produce new tokens

http://selenic.com/repo/hg//rev/1e5ff5ae1d2b
changeset:   30167:1e5ff5ae1d2b
user:Gregory Szorc 
date:Thu Oct 13 13:14:14 2016 +0200
summary: dirs: use PyVarObject_HEAD_INIT

http://selenic.com/repo/hg//rev/1a327889c13c
changeset:   30168:1a327889c13c
user:Gregory Szorc 
date:Thu Oct 13 13:17:23 2016 +0200
summary: manifest: use PyVarObject_HEAD_INIT

http://selenic.com/repo/hg//rev/5f7151e6de85
changeset:   30169:5f7151e6de85
user:Gregory Szorc 
date:Thu Oct 13 13:22:40 2016 +0200
summary: parsers: alias more PyInt* symbols on Python 3

http://selenic.com/repo/hg//rev/15635d8b17e0
changeset:   30170:15635d8b17e0
user:Gregory Szorc 
date:Thu Oct 13 13:27:14 2016 +0200
summary: bdiff: include util.h

http://selenic.com/repo/hg//rev/7a3b59f0329a
changeset:   30171:7a3b59f0329a
user:Gregory Szorc 
date:Thu Oct 13 13:34:53 2016 +0200
summary: parsers: avoid PySliceObject cast on Python 3

http://selenic.com/repo/hg//rev/90a6c18a7c1d
changeset:   30172:90a6c18a7c1d
user:Stanislau Hlebik 
date:Tue Oct 04 04:06:48 2016 -0700
summary: update: warn if cwd was deleted

http://selenic.com/repo/hg//rev/f34a8cff51d9
changeset:   30173:f34a8cff51d9
user:Danek Duvall 
date:Thu Oct 13 11:48:17 2016 -0700
summary: color: allow for user-configurable terminfo codes for effects

http://selenic.com/repo/hg//rev/5d777fe4615d
changeset:   30174:5d777fe4615d
user:Danek Duvall 
date:Thu Oct 13 12:01:41 2016 -0700
summary: color: ignore effects missing from terminfo

http://selenic.com/repo/hg//rev/8915c68f3eba
changeset:   30175:8915c68f3eba
user:Danek Duvall 
date:Thu Oct 13 13:10:01 2016 -0700
summary: color: debugcolor should emit the user-defined colors

http://selenic.com/repo/hg//rev/9f41b66cffc0
changeset:   30176:9f41b66cffc0
user:Danek Duvall 
date:Sat Oct 15 15:01:14 2016 -0700
summary: color: add some documentation for custom terminfo codes

http://selenic.com/repo/hg//rev/9626022feaa4
changeset:   30177:9626022feaa4
user:Gregory Szorc 
date:Sat Oct 15 17:10:53 2016 -0700
summary: bundle2: only emit compressed chunks if they have data

http://selenic.com/repo/hg//rev/d61c42c1a35c
changeset:   30178:d61c42c1a35c
user:Yuya Nishihara 
date:Mon Oct 10 22:30:09 2016 +0200
summary: revset: make follow() reject more than one start revisions

http://selenic.com/repo/hg//rev/cdef35b38026
changeset:   30179:cdef35b38026
user:Yuya Nishihara 
date:Fri Oct 14 23:33:00 2016 +0900
summary: revset: for x^2, do not take null as a valid p2 revision

http://selenic.com/repo/hg//rev/736f92c44656
changeset:   30180:736f92c44656
user:Mads Kiilerich 
date:Wed Oct 12 12:22:18 2016 +0200
summary: largefiles: always use filechunkiter when iterating files

http://selenic.com/repo/hg//rev/7356e6b1f5b8
changeset:   30181:7356e6b1f5b8
user:Mads Kiilerich 
date:Fri Oct 14 01:53:15 2016 +0200
summary: util: increase filechunkiter size to 128k

http://selenic.com/repo/hg//rev/144d8fe266d9
changeset:   30182:144d8fe266d9
user:Mads Kiilerich 
date:Fri Oct 14 01:53:15 2016 +0200
summary: cmdutil: satisfy expections in dirstateguard.__del__, even if 
__init__ fails

http://selenic.com/repo/hg//rev/0106f93ca1d5
changeset:   30183:0106f93ca1d5
user:Pierre-Yves David 
date:Tue Oct 11 02:15:23 2016 +0200
summary: checkcopies: move 'movewithdir' initialisation right before its 
usage

http://selenic.com/repo/hg//rev/7321c6b0c9fd
changeset:   30184:7321c6b0c9fd
user:Pierre-Yves David 
date:Tue Oct 11 02:21:42 2016 +0200
summary: checkcopies: 

Re: [PATCH v3] update: enable copy tracing for backwards and non-linear updates

2016-10-17 Thread Kevin Bullock
> On Oct 17, 2016, at 15:54, Pierre-Yves David  
> wrote:
> 
> On 10/17/2016 10:52 PM, Kevin Bullock wrote:
>>> On Oct 17, 2016, at 15:51, Kevin Bullock  
>>> wrote:
>>> 
>>> As I understand it now, you've queued #5 out of v4 and the rest of v4 is 
>>> still under review. Is that right?
>> 
>> ...and sometime soon we'll have improved tooling that can understand queuing 
>> non-contiguous parts of a series.
> 
> Yep, I've queued patch #5 of the v4 (because I picked it up when it was Patch 
> 1 of another series (flagged V3)).
> 
> Does this confusing statement lift your confusion?

Close enough.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

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


Re: [PATCH v3] update: enable copy tracing for backwards and non-linear updates

2016-10-17 Thread Pierre-Yves David



On 10/17/2016 10:52 PM, Kevin Bullock wrote:

On Oct 17, 2016, at 15:51, Kevin Bullock  
wrote:


On Oct 17, 2016, at 15:45, Pierre-Yves David  
wrote:

On 10/17/2016 10:41 PM, Pierre-Yves David wrote:


On 10/17/2016 08:55 PM, Kevin Bullock wrote:

Fair enough, I wasn't aware of that. In that case I would've said to
resend just 8-11, but it's fine that you resent them as one chunk.


For the record, I would have preferred that part of the series to not be
sent again as a V4. The V2 was still in review and no change had been
requested to it. Having it resent is increasing list traffic, patch
tracking work and confusion on my side for no visible benefit.
Kevin, any reason why you requested that ?


Ha, I just connected the dots. A V4 was sent to contains the update to the last 
patch. I got confused because that patch was in my mind independent and not 
included in that series at all. Sorry for the confusion and associated 
grumpyness.


Yeah, I was just trying to establish positively what part of the series was 
still active. Once part of a series is queued and another part is sliced off as 
a separate patch, I and our review tooling are both likely to drop the 
remainder on the floor (whether that's the intent or not).

As I understand it now, you've queued #5 out of v4 and the rest of v4 is still 
under review. Is that right?


...and sometime soon we'll have improved tooling that can understand queuing 
non-contiguous parts of a series.


Yep, I've queued patch #5 of the v4 (because I picked it up when it was 
Patch 1 of another series (flagged V3)).


Does this confusing statement lift your confusion?

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


Re: [PATCH v3] update: enable copy tracing for backwards and non-linear updates

2016-10-17 Thread Kevin Bullock
> On Oct 17, 2016, at 15:51, Kevin Bullock  
> wrote:
> 
>> On Oct 17, 2016, at 15:45, Pierre-Yves David 
>>  wrote:
>> 
>> On 10/17/2016 10:41 PM, Pierre-Yves David wrote:
>>> 
>>> On 10/17/2016 08:55 PM, Kevin Bullock wrote:
 Fair enough, I wasn't aware of that. In that case I would've said to
 resend just 8-11, but it's fine that you resent them as one chunk.
>>> 
>>> For the record, I would have preferred that part of the series to not be
>>> sent again as a V4. The V2 was still in review and no change had been
>>> requested to it. Having it resent is increasing list traffic, patch
>>> tracking work and confusion on my side for no visible benefit.
>>> Kevin, any reason why you requested that ?
>> 
>> Ha, I just connected the dots. A V4 was sent to contains the update to the 
>> last patch. I got confused because that patch was in my mind independent and 
>> not included in that series at all. Sorry for the confusion and associated 
>> grumpyness.
> 
> Yeah, I was just trying to establish positively what part of the series was 
> still active. Once part of a series is queued and another part is sliced off 
> as a separate patch, I and our review tooling are both likely to drop the 
> remainder on the floor (whether that's the intent or not).
> 
> As I understand it now, you've queued #5 out of v4 and the rest of v4 is 
> still under review. Is that right?

...and sometime soon we'll have improved tooling that can understand queuing 
non-contiguous parts of a series.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

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


Re: [PATCH v3] update: enable copy tracing for backwards and non-linear updates

2016-10-17 Thread Kevin Bullock
> On Oct 17, 2016, at 15:45, Pierre-Yves David  
> wrote:
> 
> On 10/17/2016 10:41 PM, Pierre-Yves David wrote:
>> 
>> On 10/17/2016 08:55 PM, Kevin Bullock wrote:
>>> Fair enough, I wasn't aware of that. In that case I would've said to
>>> resend just 8-11, but it's fine that you resent them as one chunk.
>> 
>> For the record, I would have preferred that part of the series to not be
>> sent again as a V4. The V2 was still in review and no change had been
>> requested to it. Having it resent is increasing list traffic, patch
>> tracking work and confusion on my side for no visible benefit.
>> Kevin, any reason why you requested that ?
> 
> Ha, I just connected the dots. A V4 was sent to contains the update to the 
> last patch. I got confused because that patch was in my mind independent and 
> not included in that series at all. Sorry for the confusion and associated 
> grumpyness.

Yeah, I was just trying to establish positively what part of the series was 
still active. Once part of a series is queued and another part is sliced off as 
a separate patch, I and our review tooling are both likely to drop the 
remainder on the floor (whether that's the intent or not).

As I understand it now, you've queued #5 out of v4 and the rest of v4 is still 
under review. Is that right?

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

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


Re: [PATCH 5 of 5 v4] update: enable copy tracing for backwards and non-linear updates

2016-10-17 Thread Pierre-Yves David



On 10/17/2016 08:42 PM, Gábor Stefanik wrote:

# HG changeset patch
# User Gábor Stefanik 
# Date 1472155346 -7200
#  Thu Aug 25 22:02:26 2016 +0200
# Node ID a41abe53dbc2c28d3b656f2a138da26949cf91d3
# Parent  3fc51a50bec71bb34c11beaaa6686d521ac706b1
update: enable copy tracing for backwards and non-linear updates


The V4 of that specific patches have been pushed. Thanks,

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


Re: [PATCH v3] update: enable copy tracing for backwards and non-linear updates

2016-10-17 Thread Pierre-Yves David



On 10/17/2016 08:55 PM, Kevin Bullock wrote:

On Oct 17, 2016, at 13:45, Gábor STEFANIK  wrote:

-Original Message-

From: Kevin Bullock [mailto:kbullock+mercur...@ringworld.org]
Sent: Monday, October 17, 2016 8:37 PM
To: Gábor STEFANIK 
Cc: mercurial-devel@mercurial-scm.org
Subject: Re: [PATCH v3] update: enable copy tracing for backwards and non-
linear updates


On Oct 17, 2016, at 13:27, Gábor Stefanik 

wrote:


# HG changeset patch
# User Gábor Stefanik  # Date 1472155346 -7200
#  Thu Aug 25 22:02:26 2016 +0200
# Node ID a41abe53dbc2c28d3b656f2a138da26949cf91d3
# Parent  3fc51a50bec71bb34c11beaaa6686d521ac706b1
update: enable copy tracing for backwards and non-linear updates


Urk. It's generally confusing to send just one updated patch to the end of an
in-flight series (but it's good you at least flagged it v3).

Since 1-7 of the v2 series are queued already, can you resend current
versions of 8-12 as a v4?


Done.

It was Pierre-Yves's request to separate the last patch from the series, since 
it's not related to graft.
But if there's disagreement on this, I'm more than happy to have it treated as 
part of the series.


Actually, my initial request was to not include this one in the original 
batch (and I missed the fact he did) and then to send that one when the 
first series would be in.


However, This patch seems to work just fine with only the initial first 
5 that are pushed. So resending it independently was a good idea.


So despite the general confusion on various sides, the end result of 
Gábor sending this on its own ended up being pretty good. I've pushed 
this patch.



Fair enough, I wasn't aware of that. In that case I would've said to resend 
just 8-11, but it's fine that you resent them as one chunk.


For the record, I would have preferred that part of the series to not be 
sent again as a V4. The V2 was still in review and no change had been 
requested to it. Having it resent is increasing list traffic, patch 
tracking work and confusion on my side for no visible benefit.

Kevin, any reason why you requested that ?

Cheers,

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


Re: [PATCH v3] update: enable copy tracing for backwards and non-linear updates

2016-10-17 Thread Kevin Bullock
> On Oct 17, 2016, at 13:45, Gábor STEFANIK  wrote:
> 
> -Original Message-
>> From: Kevin Bullock [mailto:kbullock+mercur...@ringworld.org]
>> Sent: Monday, October 17, 2016 8:37 PM
>> To: Gábor STEFANIK 
>> Cc: mercurial-devel@mercurial-scm.org
>> Subject: Re: [PATCH v3] update: enable copy tracing for backwards and non-
>> linear updates
>> 
>>> On Oct 17, 2016, at 13:27, Gábor Stefanik 
>> wrote:
>>> 
>>> # HG changeset patch
>>> # User Gábor Stefanik  # Date 1472155346 -7200
>>> #  Thu Aug 25 22:02:26 2016 +0200
>>> # Node ID a41abe53dbc2c28d3b656f2a138da26949cf91d3
>>> # Parent  3fc51a50bec71bb34c11beaaa6686d521ac706b1
>>> update: enable copy tracing for backwards and non-linear updates
>> 
>> Urk. It's generally confusing to send just one updated patch to the end of an
>> in-flight series (but it's good you at least flagged it v3).
>> 
>> Since 1-7 of the v2 series are queued already, can you resend current
>> versions of 8-12 as a v4?
> 
> Done.
> 
> It was Pierre-Yves's request to separate the last patch from the series, 
> since it's not related to graft.
> But if there's disagreement on this, I'm more than happy to have it treated 
> as part of the series.

Fair enough, I wasn't aware of that. In that case I would've said to resend 
just 8-11, but it's fine that you resent them as one chunk.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

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


RE: [PATCH v3] update: enable copy tracing for backwards and non-linear updates

2016-10-17 Thread Gábor STEFANIK
>


--
This message, including its attachments, is confidential. For more information 
please read NNG's email policy here:
http://www.nng.com/emailpolicy/
By responding to this email you accept the email policy.


-Original Message-
> From: Kevin Bullock [mailto:kbullock+mercur...@ringworld.org]
> Sent: Monday, October 17, 2016 8:37 PM
> To: Gábor STEFANIK 
> Cc: mercurial-devel@mercurial-scm.org
> Subject: Re: [PATCH v3] update: enable copy tracing for backwards and non-
> linear updates
>
> > On Oct 17, 2016, at 13:27, Gábor Stefanik 
> wrote:
> >
> > # HG changeset patch
> > # User Gábor Stefanik  # Date 1472155346 -7200
> > #  Thu Aug 25 22:02:26 2016 +0200
> > # Node ID a41abe53dbc2c28d3b656f2a138da26949cf91d3
> > # Parent  3fc51a50bec71bb34c11beaaa6686d521ac706b1
> > update: enable copy tracing for backwards and non-linear updates
>
> Urk. It's generally confusing to send just one updated patch to the end of an
> in-flight series (but it's good you at least flagged it v3).
>
> Since 1-7 of the v2 series are queued already, can you resend current
> versions of 8-12 as a v4?

Done.

It was Pierre-Yves's request to separate the last patch from the series, since 
it's not related to graft.
But if there's disagreement on this, I'm more than happy to have it treated as 
part of the series.

>
> pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
> Kevin R. Bullock

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


RE: [PATCH] bashcompletion: allow skipping completion for 'hg status'

2016-10-17 Thread Sean Farley
"De Mare, Mathias (Nokia - BE)"  writes:

>> -Original Message-
>> From: Yuya Nishihara [mailto:you...@gmail.com] On Behalf Of Yuya
>> Nishihara
>> Sent: donderdag 13 oktober 2016 15:09
>> To: De Mare, Mathias (Nokia - BE) 
>> Cc: mercurial-devel@mercurial-scm.org
>> Subject: Re: [PATCH] bashcompletion: allow skipping completion for 'hg
>> status'
>> 
>> On Wed, 05 Oct 2016 09:01:51 -0500, Mathias De Maré wrote:
>> > # HG changeset patch
>> > # User Mathias De Maré  # Date
>> 1474879657
>> > -7200
>> > #  Mon Sep 26 10:47:37 2016 +0200
>> > # Node ID 1ad8d68d6e495200969a650992f9cf7ff3f934d1
>> > # Parent  1779dde4c9ef97cb242f8d501655f236f66e5439
>> > bashcompletion: allow skipping completion for 'hg status'
>> 
>> because 'hg status' might be slow? Can you add more details to the commit
>> message?
>
> That's indeed the reason, it has a lot of impact on autocomplete (slowness 
> for large repos on slow disks).

I had that problem, too, until I started to use watchman :-/
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 5 of 5 v4] update: enable copy tracing for backwards and non-linear updates

2016-10-17 Thread Gábor Stefanik
# HG changeset patch
# User Gábor Stefanik 
# Date 1472155346 -7200
#  Thu Aug 25 22:02:26 2016 +0200
# Node ID a41abe53dbc2c28d3b656f2a138da26949cf91d3
# Parent  3fc51a50bec71bb34c11beaaa6686d521ac706b1
update: enable copy tracing for backwards and non-linear updates

As a followup to the issue4028 series, this fixes a variant of the issue
that can occur when updating with uncommited local changes.

The duplicated .hgsub warning is coming from wc.dirty(). We would previously
skip this call because it's only relevant when we're going to perform copy
tracing, which we didn't do before.

The change to the update summary line is because we now treat the rename as a
proper rename (which counts as a change), rather than an add+delete pair
(which counts as a change and a delete).

diff -r 3fc51a50bec7 -r a41abe53dbc2 mercurial/merge.py
--- a/mercurial/merge.pyTue Oct 11 04:39:47 2016 +0200
+++ b/mercurial/merge.pyThu Aug 25 22:02:26 2016 +0200
@@ -1555,15 +1555,16 @@
 pas = [p1]
 
 # deprecated config: merge.followcopies
-followcopies = False
+followcopies = repo.ui.configbool('merge', 'followcopies', True)
 if overwrite:
 pas = [wc]
+followcopies = False
 elif pas == [p2]: # backwards
-pas = [wc.p1()]
-elif not branchmerge and not wc.dirty(missing=True):
-pass
-elif pas[0] and repo.ui.configbool('merge', 'followcopies', True):
-followcopies = True
+pas = [p1]
+elif not pas[0]:
+followcopies = False
+if not branchmerge and not wc.dirty(missing=True):
+followcopies = False
 
 ### calculate phase
 actionbyfile, diverge, renamedelete = calculateupdates(
diff -r 3fc51a50bec7 -r a41abe53dbc2 tests/test-merge-local.t
--- a/tests/test-merge-local.t  Tue Oct 11 04:39:47 2016 +0200
+++ b/tests/test-merge-local.t  Thu Aug 25 22:02:26 2016 +0200
@@ -66,7 +66,7 @@
   merging zzz1_merge_ok
   merging zzz2_merge_bad
   warning: conflicts while merging zzz2_merge_bad! (edit, then use 'hg resolve 
--mark')
-  2 files updated, 1 files merged, 3 files removed, 1 files unresolved
+  2 files updated, 1 files merged, 2 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges
   [1]
 
@@ -104,7 +104,7 @@
   merging zzz1_merge_ok
   merging zzz2_merge_bad
   warning: conflicts while merging zzz2_merge_bad! (edit, then use 'hg resolve 
--mark')
-  2 files updated, 1 files merged, 3 files removed, 1 files unresolved
+  2 files updated, 1 files merged, 2 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges
   [1]
 
diff -r 3fc51a50bec7 -r a41abe53dbc2 tests/test-mq-subrepo.t
--- a/tests/test-mq-subrepo.t   Tue Oct 11 04:39:47 2016 +0200
+++ b/tests/test-mq-subrepo.t   Thu Aug 25 22:02:26 2016 +0200
@@ -304,6 +304,7 @@
   record this change to '.hgsub'? [Ynesfdaq?] y
   
   warning: subrepo spec file '.hgsub' not found
+  warning: subrepo spec file '.hgsub' not found
   abort: uncommitted changes in subrepository 'sub'
   [255]
   % update substate when adding .hgsub w/clean updated subrepo
@@ -319,6 +320,7 @@
   record this change to '.hgsub'? [Ynesfdaq?] y
   
   warning: subrepo spec file '.hgsub' not found
+  warning: subrepo spec file '.hgsub' not found
   path sub
source   sub
revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
diff -r 3fc51a50bec7 -r a41abe53dbc2 tests/test-up-local-change.t
--- a/tests/test-up-local-change.t  Tue Oct 11 04:39:47 2016 +0200
+++ b/tests/test-up-local-change.t  Thu Aug 25 22:02:26 2016 +0200
@@ -67,6 +67,10 @@
   summary: 2
   
   $ hg --debug up 0
+  starting 4 threads for background file closing (?)
+searching for copies back to rev 0
+unmatched files in local (from topological common ancestor):
+ b
   resolving manifests
branchmerge: False, force: False, partial: False
ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
@@ -222,4 +226,20 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg st
 
+test updating backwards through a rename
+
+  $ hg mv a b
+  $ hg ci -m b
+  $ echo b > b
+  $ hg up -q 0
+  $ hg st
+  M a
+  $ hg diff --nodates
+  diff -r cb9a9f314b8b a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,1 @@
+  -a
+  +b
+
   $ cd ..
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 5 v4] mergecopies: add logic to process incomplete data

2016-10-17 Thread Gábor Stefanik
# HG changeset patch
# User Gábor Stefanik 
# Date 1475578314 -7200
#  Tue Oct 04 12:51:54 2016 +0200
# Node ID f5f046a680e6730485df1760f82a0e0084305873
# Parent  d8379d11021b681a06cda08a07da237eaca520b2
mergecopies: add logic to process incomplete data

We first combine incomplete copies on the two sides of the topological CA
into complete copies.
Any leftover incomplete copies are then combined with the incomplete
divergences to reconstruct divergences spanning over the topological CA.
Finally we promote any divergences falsely flagged as incomplete to full
divergences.

Right now, there is nothing generating incomplete copy/divergence data,
so this code does nothing. Changes to _checkcopies to populate these
dicts are coming later in this series.

diff -r d8379d11021b -r f5f046a680e6 mercurial/copies.py
--- a/mercurial/copies.py   Wed Oct 12 11:54:03 2016 +0200
+++ b/mercurial/copies.py   Tue Oct 04 12:51:54 2016 +0200
@@ -289,6 +289,22 @@
 return fctx
 return util.lrucachefunc(makectx)
 
+def _combinecopies(copyfrom, copyto, finalcopy, diverge, incompletediverge):
+"""combine partial copy paths"""
+remainder = {}
+for f in copyfrom:
+if f in copyto:
+finalcopy[copyto[f]] = copyfrom[f]
+del copyto[f]
+for f in incompletediverge:
+assert f not in diverge
+ic = incompletediverge[f]
+if ic[0] in copyto:
+diverge[f] = [copyto[ic[0]], ic[1]]
+else:
+remainder[f] = ic
+return remainder
+
 def mergecopies(repo, c1, c2, base):
 """
 Find moves and copies between context c1 and c2 that are relevant
@@ -360,14 +376,21 @@
 # - diverge = record all diverges in this dict
 # - copy = record all non-divergent copies in this dict
 # - fullcopy = record all copies in this dict
+# - incomplete = record non-divergent partial copies here
+# - incompletediverge = record divergent partial copies here
 diverge = {} # divergence data is shared
+incompletediverge  = {}
 data1 = {'copy': {},
  'fullcopy': {},
+ 'incomplete': {},
  'diverge': diverge,
+ 'incompletediverge': incompletediverge,
 }
 data2 = {'copy': {},
  'fullcopy': {},
+ 'incomplete': {},
  'diverge': diverge,
+ 'incompletediverge': incompletediverge,
 }
 
 # find interesting file sets from manifests
@@ -398,6 +421,13 @@
 copy = dict(data1['copy'].items() + data2['copy'].items())
 fullcopy = dict(data1['fullcopy'].items() + data2['fullcopy'].items())
 
+if dirtyc1:
+_combinecopies(data2['incomplete'], data1['incomplete'], copy, diverge,
+   incompletediverge)
+else:
+_combinecopies(data1['incomplete'], data2['incomplete'], copy, diverge,
+   incompletediverge)
+
 renamedelete = {}
 renamedeleteset = set()
 divergeset = set()
@@ -416,13 +446,36 @@
 repo.ui.debug("  unmatched files new in both:\n   %s\n"
   % "\n   ".join(bothnew))
 bothdiverge = {}
-bothdata = {'copy': {},
-'fullcopy': {},
-'diverge': bothdiverge,
-   }
+bothincompletediverge = {}
+both1 = {'copy': {},
+ 'fullcopy': {},
+ 'incomplete': {},
+ 'diverge': bothdiverge,
+ 'incompletediverge': bothincompletediverge
+}
+both2 = {'copy': {},
+ 'fullcopy': {},
+ 'incomplete': {},
+ 'diverge': bothdiverge,
+ 'incompletediverge': bothincompletediverge
+}
 for f in bothnew:
-_checkcopies(c1, f, m1, m2, base, tca, limit, bothdata)
-_checkcopies(c2, f, m2, m1, base, tca, limit, bothdata)
+_checkcopies(c1, f, m1, m2, base, tca, limit, both1)
+_checkcopies(c2, f, m2, m1, base, tca, limit, both2)
+if dirtyc1:
+assert both2['incomplete'] == {}
+remainder = _combinecopies({}, both1['incomplete'], copy, bothdiverge,
+   bothincompletediverge)
+else:
+assert both1['incomplete'] == {}
+remainder = _combinecopies({}, both2['incomplete'], copy, bothdiverge,
+   bothincompletediverge)
+for f in remainder:
+assert f not in bothdiverge
+ic = remainder[f]
+if ic[0] in (m1 if dirtyc1 else m2):
+# backed-out rename on one side, but watch out for deleted files
+bothdiverge[f] = ic
 for of, fl in bothdiverge.items():
 if len(fl) == 2 and fl[0] == fl[1]:
 copy[fl[0]] = of # not actually divergent, just matching renames
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 3 of 5 v4] checkcopies: add logic to handle remotebase

2016-10-17 Thread Gábor Stefanik
# HG changeset patch
# User Gábor Stefanik 
# Date 1476152759 -7200
#  Tue Oct 11 04:25:59 2016 +0200
# Node ID d1a0366565988c2a58a21f1788557064c9590c46
# Parent  f5f046a680e6730485df1760f82a0e0084305873
checkcopies: add logic to handle remotebase

As the two _checkcopies passes' ranges are separated by tca, not base,
only one of the two passes will actually encounter the base.
Pass "remotebase" to the other pass to let it know not to expect passing
over the base. This is required for handling a few unusual rename cases.

diff -r f5f046a680e6 -r d1a036656598 mercurial/copies.py
--- a/mercurial/copies.py   Tue Oct 04 12:51:54 2016 +0200
+++ b/mercurial/copies.py   Tue Oct 11 04:25:59 2016 +0200
@@ -413,10 +413,10 @@
   baselabel='topological common ancestor')
 
 for f in u1u:
-_checkcopies(c1, f, m1, m2, base, tca, limit, data1)
+_checkcopies(c1, f, m1, m2, base, tca, dirtyc1, limit, data1)
 
 for f in u2u:
-_checkcopies(c2, f, m2, m1, base, tca, limit, data2)
+_checkcopies(c2, f, m2, m1, base, tca, dirtyc2, limit, data2)
 
 copy = dict(data1['copy'].items() + data2['copy'].items())
 fullcopy = dict(data1['fullcopy'].items() + data2['fullcopy'].items())
@@ -460,8 +460,8 @@
  'incompletediverge': bothincompletediverge
 }
 for f in bothnew:
-_checkcopies(c1, f, m1, m2, base, tca, limit, both1)
-_checkcopies(c2, f, m2, m1, base, tca, limit, both2)
+_checkcopies(c1, f, m1, m2, base, tca, dirtyc1, limit, both1)
+_checkcopies(c2, f, m2, m1, base, tca, dirtyc2, limit, both2)
 if dirtyc1:
 assert both2['incomplete'] == {}
 remainder = _combinecopies({}, both1['incomplete'], copy, bothdiverge,
@@ -590,7 +590,7 @@
 except StopIteration:
 return False
 
-def _checkcopies(ctx, f, m1, m2, base, tca, limit, data):
+def _checkcopies(ctx, f, m1, m2, base, tca, remotebase, limit, data):
 """
 check possible copies of f from m1 to m2
 
@@ -600,6 +600,7 @@
 m2 = the destination manifest
 base = the changectx used as a merge base
 tca = topological common ancestor for graft-like scenarios
+remotebase = True if base is outside tca::ctx, False otherwise
 limit = the rev number to not search beyond
 data = dictionary of dictionary to store copy data. (see mergecopies)
 
@@ -619,7 +620,7 @@
 # In the case there is both backward and forward renames (before and after
 # the base) this is more complicated as we must detect a divergence.
 # We use 'backwards = False' in that case.
-backwards = base != tca and f in mb
+backwards = not remotebase and base != tca and f in mb
 getfctx = _makegetfctx(ctx)
 
 of = None
@@ -652,6 +653,10 @@
 data['copy'][of] = f
 elif of in mb:
 data['copy'][f] = of
+elif remotebase: # special case: a <- b <- a -> b "ping-pong" 
rename
+data['copy'][of] = f
+del data['fullcopy'][f]
+data['fullcopy'][of] = f
 else: # divergence w.r.t. graft CA on one side of topological CA
 for sf in seen:
 if sf in mb:
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 5 v4] checkcopies: handle divergences contained entirely in tca::ctx

2016-10-17 Thread Gábor Stefanik
# HG changeset patch
# User Gábor Stefanik 
# Date 1476266043 -7200
#  Wed Oct 12 11:54:03 2016 +0200
# Node ID d8379d11021b681a06cda08a07da237eaca520b2
# Parent  475efa21684cbd7c7fffba34250267dc500a7e9e
checkcopies: handle divergences contained entirely in tca::ctx

During a graftlike merge, _checkcopies runs from ctx to tca, possibly
passing over the merge base. If there is a rename both before and after
the base, then we're actually dealing with divergent renames.
If there is no rename on the other side of tca, then the divergence is
contained entirely in the range of one _checkcopies invocation, and
should be detected "in the loop" without having to rely on the other
_checkcopies pass.

diff -r 475efa21684c -r d8379d11021b mercurial/copies.py
--- a/mercurial/copies.py   Mon Sep 26 10:47:37 2016 +0200
+++ b/mercurial/copies.py   Wed Oct 12 11:54:03 2016 +0200
@@ -564,9 +564,8 @@
 # traversed backwards.
 #
 # In the case there is both backward and forward renames (before and after
-# the base) this is more complicated as we must detect a divergence. This
-# is currently broken and hopefully some later code update will make that
-# work (we use 'backwards = False' in that case)
+# the base) this is more complicated as we must detect a divergence.
+# We use 'backwards = False' in that case.
 backwards = base != tca and f in mb
 getfctx = _makegetfctx(ctx)
 
@@ -600,6 +599,12 @@
 data['copy'][of] = f
 elif of in mb:
 data['copy'][f] = of
+else: # divergence w.r.t. graft CA on one side of topological CA
+for sf in seen:
+if sf in mb:
+assert sf not in data['diverge']
+data['diverge'][sf] = [f, of]
+break
 return
 
 if of in mb:
diff -r 475efa21684c -r d8379d11021b tests/test-graft.t
--- a/tests/test-graft.tMon Sep 26 10:47:37 2016 +0200
+++ b/tests/test-graft.tWed Oct 12 11:54:03 2016 +0200
@@ -982,6 +982,9 @@
 
   $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit
   grafting 3:b69f5839d2d9 "D0"
+  note: possible conflict - f3b was renamed multiple times to:
+   f3d
+   f3a
   warning: can't find ancestor for 'f3d' copied from 'f3b'!
 
 Set up the repository for some further tests
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 4 of 5 v4] copies: make _checkcopies handle copy sequences spanning the TCA (issue4028)

2016-10-17 Thread Gábor Stefanik
# HG changeset patch
# User Gábor Stefanik 
# Date 1476153587 -7200
#  Tue Oct 11 04:39:47 2016 +0200
# Node ID 3fc51a50bec71bb34c11beaaa6686d521ac706b1
# Parent  d1a0366565988c2a58a21f1788557064c9590c46
copies: make _checkcopies handle copy sequences spanning the TCA (issue4028)

When working in a rotated DAG (for a graftlike merge), there can be files
that are renamed both between the base and the topological CA, and between
the TCA and the endpoint farther from the base. Such renames span the TCA
(and thus need both passes of _checkcopies to be fully detected), but may
not necessarily be divergent.

Make _checkcopies return "incomplete copies" and "incomplete divergences"
in this case, and let mergecopies recombine them once data from both passes
of _checkcopies is available.

With this patch, all known cases involving renames and grafts pass.

(Developed together with Pierre-Yves David)

diff -r d1a036656598 -r 3fc51a50bec7 mercurial/copies.py
--- a/mercurial/copies.py   Tue Oct 11 04:25:59 2016 +0200
+++ b/mercurial/copies.py   Tue Oct 11 04:39:47 2016 +0200
@@ -611,6 +611,7 @@
 """
 
 mb = base.manifest()
+mta = tca.manifest()
 # Might be true if this call is about finding backward renames,
 # This happens in the case of grafts because the DAG is then rotated.
 # If the file exists in both the base and the source, we are not looking
@@ -665,8 +666,17 @@
 break
 return
 
-if of in mb:
-data['diverge'].setdefault(of, []).append(f)
+if of in mta:
+if backwards or remotebase:
+data['incomplete'][of] = f
+else:
+for sf in seen:
+if sf in mb:
+if tca == base:
+data['diverge'].setdefault(sf, []).append(f)
+else:
+data['incompletediverge'][sf] = [of, f]
+return
 
 def duplicatecopies(repo, rev, fromrev, skiprev=None):
 '''reproduce copies from fromrev to rev in the dirstate
diff -r d1a036656598 -r 3fc51a50bec7 tests/test-graft.t
--- a/tests/test-graft.tTue Oct 11 04:25:59 2016 +0200
+++ b/tests/test-graft.tTue Oct 11 04:39:47 2016 +0200
@@ -957,15 +957,6 @@
   grafting 2:f58c7e2b28fa "C0"
   merging f1a and f1b to f1a
   merging f5a
-  warning: conflicts while merging f5a! (edit, then use 'hg resolve --mark')
-  abort: unresolved conflicts, can't continue
-  (use 'hg resolve' and 'hg graft --continue')
-  [255]
-  $ hg resolve f5a -t ':other' # XXX work around failure
-  (no more unresolved files)
-  continue: hg graft --continue
-  $ hg graft --continue # XXX work around failure
-  grafting 2:f58c7e2b28fa "C0"
   warning: can't find ancestor for 'f5a' copied from 'f5b'!
   $ hg status --change .
   M f1a
@@ -975,7 +966,7 @@
   $ hg cat f1a
   c1c
   $ hg cat f1b
-  f1b: no such file in rev 43e4b415492d
+  f1b: no such file in rev c9763722f9bd
   [1]
 
 Test the cases A.0 (f4x) and A.6 (f3x)
@@ -997,23 +988,23 @@
   $ hg mv f5a f5b
   $ hg ci -qAm "E0"
   $ hg log -G
-  @  changeset:   6:ebba59d1fb02
+  @  changeset:   6:6bd1736cab86
   |  tag: tip
   |  parent:  0:11f7a1b56675
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
   |  summary: E0
   |
-  | o  changeset:   5:4f4ba7a6e606
+  | o  changeset:   5:560daee679da
   | |  user:test
   | |  date:Thu Jan 01 00:00:00 1970 +
   | |  summary: D1
   | |
-  | o  changeset:   4:43e4b415492d
+  | o  changeset:   4:c9763722f9bd
   |/   parent:  0:11f7a1b56675
   |user:test
   |date:Thu Jan 01 00:00:00 1970 +
-  |summary: C0
+  |summary: C1
   |
   | o  changeset:   3:b69f5839d2d9
   | |  user:test
@@ -1041,34 +1032,24 @@
 
   $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
   grafting 2:f58c7e2b28fa "C0"
-  other [graft] changed f1b which local [local] deleted
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
+  merging f1e and f1b to f1e
   merging f2a and f2c to f2c
   merging f5b and f5a to f5a
-  abort: unresolved conflicts, can't continue
-  (use 'hg resolve' and 'hg graft --continue')
-  [255]
-  $ hg resolve f1b -t ':other' # XXX work around failure
-  (no more unresolved files)
-  continue: hg graft --continue
-  $ hg graft --continue # XXX work around failure
-  grafting 2:f58c7e2b28fa "C0"
-  grafting 4:43e4b415492d "C0"
-  merging f1e and f1a to f1e
-  merging f2c
-  warning: can't find ancestor for 'f2c' copied from 'f2a'!
 
 Test the cases A.1 (f4x) and A.7 (f3x).
 
   $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit
   grafting 3:b69f5839d2d9 "D0"
+  note: possible conflict - f3b was renamed multiple times to:
+   f3e
+   f3d
   merging f4e and f4a to f4e
   warning: can't find ancestor for 'f3d' copied from 'f3b'!
 
 Check the results of the grafts tested
 
   $ hg log -CGv --patch --git
-  @  changeset:   

Re: [PATCH v3] update: enable copy tracing for backwards and non-linear updates

2016-10-17 Thread Kevin Bullock
> On Oct 17, 2016, at 13:27, Gábor Stefanik  wrote:
> 
> # HG changeset patch
> # User Gábor Stefanik 
> # Date 1472155346 -7200
> #  Thu Aug 25 22:02:26 2016 +0200
> # Node ID a41abe53dbc2c28d3b656f2a138da26949cf91d3
> # Parent  3fc51a50bec71bb34c11beaaa6686d521ac706b1
> update: enable copy tracing for backwards and non-linear updates

Urk. It's generally confusing to send just one updated patch to the end of an 
in-flight series (but it's good you at least flagged it v3).

Since 1-7 of the v2 series are queued already, can you resend current versions 
of 8-12 as a v4?

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

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


[PATCH] revset: optimize for destination() being "inefficient"

2016-10-17 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1476726516 -7200
#  Mon Oct 17 19:48:36 2016 +0200
# Node ID 50a7bbe82bd3b63a934640b1480ee643cf14ec5f
# Parent  5cb830801855dbb63e98b948e355bc995d295bf3
revset: optimize for destination() being "inefficient"

destination() will scan through the whole subset and read extras for each
revision to get its source.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2594,7 +2594,7 @@ def _optimize(x, small):
 f = getsymbol(x[1])
 wa, ta = _optimize(x[2], small)
 if f in ('author', 'branch', 'closed', 'date', 'desc', 'file', 'grep',
- 'keyword', 'outgoing', 'user'):
+ 'keyword', 'outgoing', 'user', 'destination'):
 w = 10 # slow
 elif f in ('modifies', 'adds', 'removes'):
 w = 30 # slower
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH stable] largefiles: fix 'deleted' files sometimes persistently appearing with R status

2016-10-17 Thread Augie Fackler
Queued this, thanks

> On Oct 17, 2016, at 11:12, Mads Kiilerich  wrote:
> 
> # HG changeset patch
> # User Mads Kiilerich 
> # Date 1476717144 -7200
> #  Mon Oct 17 17:12:24 2016 +0200
> # Node ID bba9f6bba98f82f2403aac8dc656569562690472
> # Parent  92414d57a05de39864aecc625e775c693d9edb51
> largefiles: fix 'deleted' files sometimes persistently appearing with R status
> 
> A code snippet that has been around since largefiles was introduced was wrong:
> Standins no longer found in lfdirstate has *not* been removed -
> they have probably just been deleted ... or not created.
> 
> This wrong reporting did that 'up -C' didn't undo the change and didn't sync
> the two dirstates.
> 
> Instead of reporting such files as removed, propagate the deletion to the
> standin file and report the file as deleted.
> 
> diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
> --- a/hgext/largefiles/reposetup.py
> +++ b/hgext/largefiles/reposetup.py
> @@ -164,8 +164,8 @@ def reposetup(ui, repo):
> # files from lfdirstate
> unsure, s = lfdirstate.status(match, [], False, listclean,
>   False)
> -(modified, added, removed, clean) = (s.modified, s.added,
> - s.removed, s.clean)
> +(modified, added, removed, deleted, clean) = (
> +s.modified, s.added, s.removed, s.deleted, s.clean)
> if parentworking:
> for lfile in unsure:
> standin = lfutil.standin(lfile)
> @@ -206,14 +206,18 @@ def reposetup(ui, repo):
> removed = [lfile for lfile in removed
>if lfutil.standin(lfile) in ctx1]
> 
> -# Standins no longer found in lfdirstate has been
> -# removed
> +# Standins no longer found in lfdirstate have been 
> deleted
> for standin in ctx1.walk(lfutil.getstandinmatcher(self)):
> lfile = lfutil.splitstandin(standin)
> if not match(lfile):
> continue
> if lfile not in lfdirstate:
> -removed.append(lfile)
> +deleted.append(lfile)
> +# Sync "largefile has been removed" back to the
> +# standin. Removing a file as a side effect of
> +# running status is gross, but the alternatives 
> (if
> +# any) are worse.
> +self.wvfs.unlink(standin)
> 
> # Filter result lists
> result = list(result)
> @@ -237,7 +241,7 @@ def reposetup(ui, repo):
> normals = [[fn for fn in filelist
> if not lfutil.isstandin(fn)]
>for filelist in result]
> -lfstatus = (modified, added, removed, s.deleted, [], [],
> +lfstatus = (modified, added, removed, deleted, [], [],
> clean)
> result = [sorted(list1 + list2)
>   for (list1, list2) in zip(normals, lfstatus)]
> diff --git a/tests/test-largefiles-update.t b/tests/test-largefiles-update.t
> --- a/tests/test-largefiles-update.t
> +++ b/tests/test-largefiles-update.t
> @@ -751,30 +751,22 @@ added:
>   $ hg up -Cr "8" --config 
> extensions.crashupdatelfiles=../crashupdatelfiles.py
>   [7]
> Check large1 content and status ... and that update will undo modifications:
> -BUG: large is R
>   $ cat large1
>   large1 in #3
>   $ hg st
>   M large1
> -  R largeX
> +  ! largeX
>   $ hg up -Cr .
>   getting changed largefiles
> -  1 largefiles updated, 0 removed
> -  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  2 largefiles updated, 0 removed
> +  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
>   $ cat large1
>   manually modified before 'hg transplant --continue'
>   $ hg st
> -  R largeX
> -Force largefiles rehashing and check again - which makes it realize that 
> largeX
> -not has been removed but just doesn't exist:
> +Force largefiles rehashing and check that all changes have been caught by
> +status and update:
>   $ rm .hg/largefiles/dirstate
>   $ hg st
> -  ! largeX
> -  $ hg up -Cr .
> -  getting changed largefiles
> -  1 largefiles updated, 0 removed
> -  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
> -  $ hg st
> 
>   $ cd ..
> 
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH stable] largefiles: fix 'deleted' files sometimes persistently appearing with R status

2016-10-17 Thread Mads Kiilerich

On 10/17/2016 05:12 PM, Mads Kiilerich wrote:

# HG changeset patch
# User Mads Kiilerich 
# Date 1476717144 -7200
#  Mon Oct 17 17:12:24 2016 +0200
# Node ID bba9f6bba98f82f2403aac8dc656569562690472
# Parent  92414d57a05de39864aecc625e775c693d9edb51
largefiles: fix 'deleted' files sometimes persistently appearing with R status

A code snippet that has been around since largefiles was introduced was wrong:
Standins no longer found in lfdirstate has *not* been removed -
they have probably just been deleted ... or not created.

This wrong reporting did that 'up -C' didn't undo the change and didn't sync
the two dirstates.

Instead of reporting such files as removed, propagate the deletion to the
standin file and report the file as deleted.

diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -164,8 +164,8 @@ def reposetup(ui, repo):
  # files from lfdirstate
  unsure, s = lfdirstate.status(match, [], False, listclean,
False)
-(modified, added, removed, clean) = (s.modified, s.added,
- s.removed, s.clean)
+(modified, added, removed, deleted, clean) = (
+s.modified, s.added, s.removed, s.deleted, s.clean)
  if parentworking:
  for lfile in unsure:
  standin = lfutil.standin(lfile)
@@ -206,14 +206,18 @@ def reposetup(ui, repo):
  removed = [lfile for lfile in removed
 if lfutil.standin(lfile) in ctx1]
  
-# Standins no longer found in lfdirstate has been

-# removed
+# Standins no longer found in lfdirstate have been deleted
  for standin in ctx1.walk(lfutil.getstandinmatcher(self)):
  lfile = lfutil.splitstandin(standin)
  if not match(lfile):
  continue
  if lfile not in lfdirstate:
-removed.append(lfile)
+deleted.append(lfile)
+# Sync "largefile has been removed" back to the

Hmm ... for clarity, this should have been "deleted"

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


Re: [PATCH] osutil: implement listdir for linux

2016-10-17 Thread Maciej Fijalkowski
Hi Gregory.

It's needed because fstatat is faster (uses less system time). As far
as backport of scandir - scandir is written entirely in C, so it's not
completely clear to me how you would backport that to use cffi. I
don't believe dropping python2 support will be a viable option for
quite a while, if you ask me

On Sun, Oct 16, 2016 at 6:55 PM, Gregory Szorc  wrote:
> On Fri, Oct 14, 2016 at 12:02 AM, Maciej Fijalkowski 
> wrote:
>>
>> # HG changeset patch
>> # User Maciej Fijalkowski 
>> # Date 1476428549 -7200
>> #  Fri Oct 14 09:02:29 2016 +0200
>> # Node ID 4e80a66124279e235dec7ae8f58c0a14b0b137bf
>> # Parent  c770219dc4c253d7cd82519ce3c74438bb2829d3
>> osutil: implement listdir for linux
>>
>> diff --git a/mercurial/pure/osutil.py b/mercurial/pure/osutil.py
>> --- a/mercurial/pure/osutil.py
>> +++ b/mercurial/pure/osutil.py
>> @@ -66,13 +66,20 @@
>>  return result
>>
>>  ffi = None
>> -if modulepolicy not in policynocffi and sys.platform == 'darwin':
>> +if modulepolicy not in policynocffi and (
>> +sys.platform == 'darwin' or sys.platform.startswith('linux')):
>>  try:
>>  from _osutil_cffi import ffi, lib
>>  except ImportError:
>>  if modulepolicy == 'cffi': # strict cffi import
>>  raise
>>
>> +class stat_res(object):
>> +def __init__(self, st_mode, st_mtime, st_size):
>> +self.st_mode = st_mode
>> +self.st_mtime = st_mtime
>> +self.st_size = st_size
>> +
>>  if sys.platform == 'darwin' and ffi is not None:
>>  listdir_batch_size = 4096
>>  # tweakable number, only affects performance, which chunks
>> @@ -88,12 +95,6 @@
>>  attrkinds[lib.VFIFO] = statmod.S_IFIFO
>>  attrkinds[lib.VSOCK] = statmod.S_IFSOCK
>>
>> -class stat_res(object):
>> -def __init__(self, st_mode, st_mtime, st_size):
>> -self.st_mode = st_mode
>> -self.st_mtime = st_mtime
>> -self.st_size = st_size
>> -
>>  tv_sec_ofs = ffi.offsetof("struct timespec", "tv_sec")
>>  buf = ffi.new("char[]", listdir_batch_size)
>>
>> @@ -117,7 +118,7 @@
>>  tp = attrkinds[cur.obj_type]
>>  if name == "." or name == "..":
>>  continue
>> -if skip == name and tp == statmod.S_ISDIR:
>> +if skip == name and tp == statmod.S_IFDIR:
>>  return []
>>  if stat:
>>  mtime = cur.mtime.tv_sec
>> @@ -146,12 +147,74 @@
>>  try:
>>  ret = listdirinternal(dfd, req, stat, skip)
>>  finally:
>> +lib.close(dfd)
>> +return ret
>> +
>> +elif sys.platform.startswith('linux') and ffi is not None:
>> +
>> +_known_common_file_types = {
>> +lib.DT_DIR:  statmod.S_IFDIR,
>> +lib.DT_CHR:  statmod.S_IFCHR,
>> +lib.DT_BLK:  statmod.S_IFBLK,
>> +lib.DT_REG:  statmod.S_IFREG,
>> +lib.DT_FIFO: statmod.S_IFIFO,
>> +lib.DT_LNK:  statmod.S_IFLNK,
>> +lib.DT_SOCK: statmod.S_IFSOCK,
>> +}
>> +
>> +def listdirinternal(dir, dirfd, stat, skip):
>> +buf = ffi.new("struct stat *")
>> +ret = []
>> +while True:
>> +ffi.errno = 0
>> +dirent = lib.readdir(dir)
>> +if not dirent:
>> +break
>> +dname = dirent.d_name
>> +if dname[0] == "." and (dname[1] == "\x00" or
>> +(dname[1] == "." and dname[2] == "\x00")):
>> +continue
>> +#
>> +dtype = dirent.d_type
>> +if stat or dtype not in _known_common_file_types:
>> +if lib.fstatat(dirfd, dirent.d_name, buf,
>> +   lib.AT_SYMLINK_NOFOLLOW) != 0:
>> +raise OSError(ffi.errno, os.strerror(ffi.errno))
>> +tp = statmod.S_IFMT(buf.st_mode)
>> +else:
>> +tp = _known_common_file_types[dtype]
>> +#
>> +name = ffi.string(dirent.d_name)
>> +if skip == name and tp == statmod.S_IFDIR:
>> +return []
>> +if stat:
>> +ret.append((name, tp, stat_res(
>> +   st_mode  = buf.st_mode,
>> +   st_mtime = buf.st_mtim.tv_sec,
>> +   st_size  = buf.st_size)))
>> +else:
>> +ret.append((name, tp))
>> +
>> +if ffi.errno != 0:
>> +raise OSError(ffi.errno, os.strerror(ffi.errno))
>> +return ret
>> +
>> +def listdir(path, stat=False, skip=None):
>> +dfd = os.open(path, os.O_RDONLY)
>> +dir = lib.fdopendir(dfd)
>> +if dir == ffi.NULL:
>>  try:
>> -lib.close(dfd)
>> +os.close(dfd)
>>  except BaseException:
>> -pass # we ignore all 

[PATCH] keyword: handle filectx _customcmp

2016-10-17 Thread Christian Ebert
# HG changeset patch
# User Christian Ebert 
# Date 1476718966 -7200
#  Mon Oct 17 17:42:46 2016 +0200
# Node ID ebef6b5593fa812e907fb4dae920a0c8b2ee00a0
# Parent  b85fa6bf298be07804a74d8fdec0d19fdbc6d740
keyword: handle filectx _customcmp

Related to issue5364.

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -737,6 +737,8 @@ def reposetup(ui, repo):
 return ret
 
 def kwfilectx_cmp(orig, self, fctx):
+if fctx._customcmp:
+return fctx.cmp(self)
 # keyword affects data size, comparing wdir and filelog size does
 # not make sense
 if (fctx._filenode is None and
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: disrstate._check(link|exec) modifies repo dir mtime

2016-10-17 Thread Mads Kiilerich

On 10/17/2016 03:55 PM, Yuya Nishihara wrote:

Please correct me if I misread the patch.

  1. checkexec() on normal unix filesystem: creates 'checkisexec' 0755
  2. copy it to VFAT: 'checkisexec' 0644
  3. copy back from VFAT: 'checkisexec' 0644
  4. checkexec() returns False because no exec flag set



You are right. I had local changes that not had been posted. I will 
resend after 4.0 .


/Mads

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


Re: [PATCH v2] bashcompletion: allow skipping completion for 'hg status'

2016-10-17 Thread Yuya Nishihara
On Mon, 17 Oct 2016 02:14:59 -0500, Mathias De Maré wrote:
> # HG changeset patch
> # User Mathias De Maré 
> # Date 1474879657 -7200
> #  Mon Sep 26 10:47:37 2016 +0200
> # Node ID b1a58a479b5af23c7224b58413477daa007728e0
> # Parent  1779dde4c9ef97cb242f8d501655f236f66e5439
> bashcompletion: allow skipping completion for 'hg status'
> 
> On systems with large repositories and slow disks,
> the calls to 'hg status' make autocomplete annoyingly slow.
> This fix makes it possible to avoid the slowdown.

Queued this. Thanks for updating the commit message.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2 stable] largefiles: more safe handling of interruptions while updating modifications

2016-10-17 Thread Yuya Nishihara
On Sun, 16 Oct 2016 02:30:01 +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich 
> # Date 1476577785 -7200
> #  Sun Oct 16 02:29:45 2016 +0200
> # Node ID dcd190cb73a0740be570bdfbc1090066c38e1173
> # Parent  2105975810c843d016ba930c44e63699af2703a6
> largefiles: more safe handling of interruptions while updating modifications
> 
> Largefiles are fragile with the design where dirstate and lfdirstate must be
> kept in sync.
> 
> To be less fragile, mark all clean largefiles as unsure ("normallookup") 
> before
> updating standins. After standins have been updated and we know exactly which
> largefile standins actually was changed, mark the unchanged largefiles back to
> clean ("normal").

This sounds good to me and the change looks correct. Queued, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: disrstate._check(link|exec) modifies repo dir mtime

2016-10-17 Thread Yuya Nishihara
On Mon, 17 Oct 2016 14:41:53 +0200, Mads Kiilerich wrote:
> On 10/16/2016 04:19 PM, Yuya Nishihara wrote on the users list:
> > On Sun, 16 Oct 2016 14:08:52 +0200, Mads Kiilerich wrote:
> >> On 10/16/2016 12:29 PM, Yuya Nishihara wrote:
> >>> On Sat, 1 Oct 2016 11:35:40 -0700, Dorian Taylor wrote:
>  is there a reason why all this testing can’t go on in $REPO/.hg?
> >>> No idea why, but there was an attempt to move check* files to .hg/cache.
> >>>
> >>> https://www.mercurial-scm.org/pipermail/mercurial-devel/2015-October/074885.html
> >>> https://www.mercurial-scm.org/pipermail/mercurial-devel/2015-November/074971.html
> >> About that:
> >>> I don't think this is sufficient. This case can occur, for instance, if
> >>> someone naively copies a repo from one machine to another with a USB
> >>> stick. Or perhaps they've done a naive recursive chmod. Then we're
> >>> permanently stuck thinking our filesystem doesn't have exec bits. If
> >>> our fast-path files don't have the right permissions (for who knows
> >>> what reasons), then we have to do the entire slow path.
> >> I don't see how copying or chmod can trigger wrong measurement of file
> >> system capabilities. "Wrong" files will be removed again - just like in
> >> the old slow path. The slow path will pretty much be the existing slow
> >> path - it will not be slower than before but it will usually not be used.
> > Can we distinguish "no exec bit support" with "cache/checkisexec was chmod
> > by user" ? If a repository is copied through VFAT USB stick, exec bit could
> > be dropped from both checkisexec and checknoexec.
> 
> The basic idea (IIRC) in 
> https://www.mercurial-scm.org/pipermail/mercurial-devel/2015-October/074887.html
>  
> is that if we have one cached file that is exec and another that isn't, 
> then we can be pretty sure that that file system supports X bit. (That 
> assumption might be wrong for filesystems that cache the x bit but 
> doesn't persist it - but in that case the repo will be screwed anyway.)
> 
> If we can't conclude anything from stat'ing existing files, we remove 
> them and check the old way ... and if the result is positive, we leave 
> the files behind so it can take the fast path next time.
> 
> I thus don't see what you are asking for that not already is taken care of.

Please correct me if I misread the patch.

 1. checkexec() on normal unix filesystem: creates 'checkisexec' 0755
 2. copy it to VFAT: 'checkisexec' 0644
 3. copy back from VFAT: 'checkisexec' 0644
 4. checkexec() returns False because no exec flag set
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH STABLE] keyword: use fctx.filenode() instead of internal var (issue5364)

2016-10-17 Thread Christian Ebert
* Yuya Nishihara on Friday, September 09, 2016 at 21:50:31 +0900
> On Thu, 08 Sep 2016 17:12:34 +0100, Christian Ebert wrote:
>> # HG changeset patch
>> # User Christian Ebert 
>> # Date 1473350741 -3600
>> #  Thu Sep 08 17:05:41 2016 +0100
>> # Branch stable
>> # Node ID d4f2b7b5b2e382dcc34409ddcb89b9280262c2d0
>> # Parent  e7766022a61a66a7c4218526b647f96bd442a4ce
>> keyword: use fctx.filenode() instead of internal var (issue5364)
>> 
>> I caved in to the proposal to use internal _filenode variable:
>> https://www.mercurial-scm.org/pipermail/mercurial-devel/2010-October/025237.html
> 
> Ah, I got the point why internal _filenode was preferred. I think Nicolas
> was right. Since kwfilectx_cmp() heavily depends on the internal of the 
> filectx,
> using _filenode would catch more bugs.

As mentioned in the bug tracker, the current version uses
_filenode since 4a65c9c6cd3f, and I actually cannot repro the
issue with it.

>> --- a/hgext/keyword.py
>> +++ b/hgext/keyword.py
>> @@ -739,7 +739,7 @@ def reposetup(ui, repo):
>> def kwfilectx_cmp(orig, self, fctx):
> 
> Maybe we'll have to handle _customcmp instead?
> 
> https://selenic.com/repo/hg/log?rev=bd19561b98d9%3A%3A7b038ec6c5fd

To be honest, I can't wrap my head around that. But do you simply mean
something like:

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -737,6 +737,8 @@ def reposetup(ui, repo):
 return ret

 def kwfilectx_cmp(orig, self, fctx):
+if fctx._customcmp:
+return fctx.comp(self)
 # keyword affects data size, comparing wdir and filelog size does
 # not make sense
 if (fctx.filenode() is None and


-- 
theatre - books - texts - movies
Black Trash Productions at home: https://blacktrash.org
Black Trash Productions on Facebook:
https://www.facebook.com/blacktrashproductions
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2 V3] py3: use namedtuple._replace to produce new tokens

2016-10-17 Thread Pierre-Yves David



On 10/16/2016 11:05 PM, Martijn Pieters wrote:

On 16 Oct 2016, at 15:30, Pierre-Yves David  
wrote:



py3: use namedtuple._replace to produce new tokens


We seems to be using a private function of some stdlib type?
Can you elaborate on why this is a good move?


It is not private. This is one of the exceptions to the Python style guide; the 
namedtuple methods all have a single leading underscore to avoid clashing with 
the field names. If they didn't, you wouldn't be able to name a field `replace`.


That was probably worth mentioning in the description. Thanks for the 
enlightening, I've accepted it as is.


Cheers

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


Re: [PATCH] py3: update test output

2016-10-17 Thread Pierre-Yves David



On 10/17/2016 12:44 AM, Gregory Szorc wrote:

On Sun, Oct 16, 2016 at 3:03 PM, Pulkit Goyal <7895pul...@gmail.com
> wrote:

# HG changeset patch
# User Pulkit Goyal <7895pul...@gmail.com >
# Date 1476557196 -19800
#  Sun Oct 16 00:16:36 2016 +0530
# Node ID d49781829eafd0ee4917c7792aaa8987170ffe78
# Parent  c1134c39ff3ad961af17a4130623f87e0a42d392
py3: update test output

A lot of patches have been pushed related to porting. This patch
updates both
our py3 tests.

diff -r c1134c39ff3a -r d49781829eaf tests/test-check-py3-commands.t
--- a/tests/test-check-py3-commands.t   Sun Oct 16 10:38:52 2016 -0700
+++ b/tests/test-check-py3-commands.t   Sun Oct 16 00:16:36 2016 +0530
@@ -9,6 +9,6 @@
   >   $PYTHON3 `which hg` $cmd 2>&1 2>&1 | tail -1
   > done
   version
-  TypeError: str expected, not bytes
+  ImportError:
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64
   debuginstall
-  TypeError: str expected, not bytes
+  ImportError:
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64
diff -r c1134c39ff3a -r d49781829eaf tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t Sun Oct 16 10:38:52 2016 -0700
+++ b/tests/test-check-py3-compat.t Sun Oct 16 00:16:36 2016 +0530
@@ -16,14 +16,164 @@
   $ hg files 'set:(**.py) - grep(pygments)' | sed 's|\\|/|g' \
   > | xargs $PYTHON3 contrib/check-py3-compat.py \
   > | sed 's/[0-9][0-9]*)$/*)/'
-  hgext/convert/transport.py: error importing:  No
module named 'svn.client' (error at transport.py:*)
-  hgext/fsmonitor/pywatchman/capabilities.py: error importing:
 No module named 'pybser' (error at __init__.py:*)
-  hgext/fsmonitor/pywatchman/pybser.py: error importing:
 No module named 'pybser' (error at __init__.py:*)
-  hgext/fsmonitor/watchmanclient.py: error importing: 
No module named 'pybser' (error at __init__.py:*)
-  hgext/mq.py: error importing:  __import__() argument 1
must be str, not bytes (error at extensions.py:*)
-  mercurial/scmwindows.py: error importing:  No module
named 'winreg' (error at scmwindows.py:*)
+  hgext/acl.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/automv.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/blackbox.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/bugzilla.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/censor.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/chgserver.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/children.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/churn.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/clonebundles.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/color.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/convert/bzr.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/convert/common.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/convert/convcmd.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/convert/cvs.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/convert/cvsps.py: error importing: 
/tmp/hgtests.fqjMQo/install/lib/python/mercurial/osutil.so:
undefined symbol: Py_InitModule4_64 (error at util.py:*)
+  hgext/convert/darcs.py: error importing: 

[PATCH v2] bashcompletion: allow skipping completion for 'hg status'

2016-10-17 Thread Mathias De Maré
# HG changeset patch
# User Mathias De Maré 
# Date 1474879657 -7200
#  Mon Sep 26 10:47:37 2016 +0200
# Node ID b1a58a479b5af23c7224b58413477daa007728e0
# Parent  1779dde4c9ef97cb242f8d501655f236f66e5439
bashcompletion: allow skipping completion for 'hg status'

On systems with large repositories and slow disks,
the calls to 'hg status' make autocomplete annoyingly slow.
This fix makes it possible to avoid the slowdown.

diff --git a/contrib/bash_completion b/contrib/bash_completion
--- a/contrib/bash_completion
+++ b/contrib/bash_completion
@@ -89,9 +89,11 @@
 
 _hg_status()
 {
-local files="$(_hg_cmd status -n$1 "glob:$cur**")"
-local IFS=$'\n'
-COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur"))
+if [ -z "$HGCOMPLETE_NOSTATUS" ]; then
+local files="$(_hg_cmd status -n$1 "glob:$cur**")"
+local IFS=$'\n'
+COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur"))
+fi
 }
 
 _hg_branches()
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


RE: [PATCH] bashcompletion: allow skipping completion for 'hg status'

2016-10-17 Thread De Mare, Mathias (Nokia - BE)


> -Original Message-
> From: Yuya Nishihara [mailto:you...@gmail.com] On Behalf Of Yuya
> Nishihara
> Sent: donderdag 13 oktober 2016 15:09
> To: De Mare, Mathias (Nokia - BE) 
> Cc: mercurial-devel@mercurial-scm.org
> Subject: Re: [PATCH] bashcompletion: allow skipping completion for 'hg
> status'
> 
> On Wed, 05 Oct 2016 09:01:51 -0500, Mathias De Maré wrote:
> > # HG changeset patch
> > # User Mathias De Maré  # Date
> 1474879657
> > -7200
> > #  Mon Sep 26 10:47:37 2016 +0200
> > # Node ID 1ad8d68d6e495200969a650992f9cf7ff3f934d1
> > # Parent  1779dde4c9ef97cb242f8d501655f236f66e5439
> > bashcompletion: allow skipping completion for 'hg status'
> 
> because 'hg status' might be slow? Can you add more details to the commit
> message?

That's indeed the reason, it has a lot of impact on autocomplete (slowness for 
large repos on slow disks).
I've pushed a V2 now.

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