[PATCH] showstack: add an extension docstring

2018-01-16 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1512938553 -3600
#  Sun Dec 10 21:42:33 2017 +0100
# Node ID bff8fba926e22982e6b5be544fc36e1e16cedfdd
# Parent  ebf14075a5c113f4fea6e89a4394d8c8fc9e6935
# EXP-Topic showstack-doc
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
bff8fba926e2
showstack: add an extension docstring

Now, running `hg help showstack` will give details on how to use the extension.

diff --git a/contrib/showstack.py b/contrib/showstack.py
--- a/contrib/showstack.py
+++ b/contrib/showstack.py
@@ -1,6 +1,8 @@
 # showstack.py - extension to dump a Python stack trace on signal
 #
 # binds to both SIGQUIT (Ctrl-\) and SIGINFO (Ctrl-T on BSDs)
+"""dump stack trace when receiving SIGQUIT (Ctrl-\) and SIGINFO (Ctrl-T on 
BSDs)
+"""
 
 from __future__ import absolute_import
 import signal
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2] lfs: migrate most file filtering from threshold to custom filter

2018-01-16 Thread Boris Feld
On Sun, 2018-01-14 at 17:26 +0900, Yuya Nishihara wrote:
> On Sun, 14 Jan 2018 00:22:05 -0500, Matt Harbison wrote:
> > On Sat, 13 Jan 2018 21:11:45 -0500, Yuya Nishihara 
> > wrote:
> > 
> > > On Sat, 13 Jan 2018 02:23:16 -0500, Matt Harbison wrote:
> > > > # HG changeset patch
> > > > # User Matt Harbison 
> > > > # Date 1514706889 18000
> > > > #  Sun Dec 31 02:54:49 2017 -0500
> > > > # Node ID 66976f55793cced57929dedc8993204be340c717
> > > > # Parent  868cc63bfe9d7d7f5b40bc8cd70175cf1a608a95
> > > > lfs: migrate most file filtering from threshold to custom
> > > > filter
> > > 
> > > Queued, thanks.
> > > 
> > > > -threshold = repo.ui.configbytes('lfs', 'threshold')
> > > > +trackspec = repo.ui.config('lfs', 'track')
> > > > 
> > > > -repo.svfs.options['lfsthreshold'] = threshold
> > > > +# deprecated config: lfs.threshold
> > > > +threshold = repo.ui.configbytes('lfs', 'threshold')
> > > > +if threshold:
> > > > +trackspec = "(%s) | size('>%s')" % (trackspec,
> > > > threshold)
> > > 
> > > I've added fileset.parse(trackspec) to detect bad spec like '..)
> > > ..  
> > > (..', and
> > > s/%s/%d/ to make sure threshold is integer so no need of string
> > > escape.
> > 
> > Thanks.
> > 
> > I assume that your amend obsoleted something local only to your
> > system?   
> > The reason I ask is because I ran `hg extdiff --patch --hidden -r  
> > 'precursors(c780e06)' -r c780e06`, and it aborted with an empty
> > revision.   
> > It's the precursors() predicate coming up empty.  I ended up
> > using  
> > 'last(allprecursors(c780e06))', and that found what I
> > submitted.  But that  
> > seems inconsistent with the obsolete line of that logged revision
> > pointing  
> > directly to c780e06.
> 
> What I generally do is:
> 
>  hg import --obsolete mails  # yours->mine
>  hg amend# mine->committed
> 
> > At minimum, it would be nice to have a shorter way to spell that.
> 
> I think allprecursors() should be renamed to precursors(), and
> delete/rename
> the original precursors().
> 
> > But it
> > seems weird that the log predicate would care about revisions not
> > in the  
> > repo.  Boris- it looks like '{precursors}' will skip the obsolete
> > revision  
> > not on my system, and agrees with 'last(..)'.
> >  

I checked the precursors revset and the behavior is not the one
expected, thank you for pointing that.


I also realized that the revset is in Evolve and not in Core, which
makes it a good opportunity to upstream it.

I'm not sure if we should keep only the equivalent of allprecursors(),
what about having a predecessor() and allpredecessors() revsets.

predecessors() would returns the closests locally known predecessors,
like the {predecessors} template keyword while allpredecessors() would
returns all the locally known predecessors.

What do you think?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2] lfs: migrate most file filtering from threshold to custom filter

2018-01-16 Thread Matt Harbison

> On Jan 16, 2018, at 5:26 AM, Boris Feld  wrote:
> 
>> On Sun, 2018-01-14 at 17:26 +0900, Yuya Nishihara wrote:
>>> On Sun, 14 Jan 2018 00:22:05 -0500, Matt Harbison wrote:
>>> On Sat, 13 Jan 2018 21:11:45 -0500, Yuya Nishihara 
>>> wrote:
>>> 
> On Sat, 13 Jan 2018 02:23:16 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1514706889 18000
> #  Sun Dec 31 02:54:49 2017 -0500
> # Node ID 66976f55793cced57929dedc8993204be340c717
> # Parent  868cc63bfe9d7d7f5b40bc8cd70175cf1a608a95
> lfs: migrate most file filtering from threshold to custom
> filter
 
 Queued, thanks.
 
> -threshold = repo.ui.configbytes('lfs', 'threshold')
> +trackspec = repo.ui.config('lfs', 'track')
> 
> -repo.svfs.options['lfsthreshold'] = threshold
> +# deprecated config: lfs.threshold
> +threshold = repo.ui.configbytes('lfs', 'threshold')
> +if threshold:
> +trackspec = "(%s) | size('>%s')" % (trackspec,
> threshold)
 
 I've added fileset.parse(trackspec) to detect bad spec like '..)
 ..  
 (..', and
 s/%s/%d/ to make sure threshold is integer so no need of string
 escape.
>>> 
>>> Thanks.
>>> 
>>> I assume that your amend obsoleted something local only to your
>>> system?   
>>> The reason I ask is because I ran `hg extdiff --patch --hidden -r  
>>> 'precursors(c780e06)' -r c780e06`, and it aborted with an empty
>>> revision.   
>>> It's the precursors() predicate coming up empty.  I ended up
>>> using  
>>> 'last(allprecursors(c780e06))', and that found what I
>>> submitted.  But that  
>>> seems inconsistent with the obsolete line of that logged revision
>>> pointing  
>>> directly to c780e06.
>> 
>> What I generally do is:
>> 
>> hg import --obsolete mails  # yours->mine
>> hg amend# mine->committed
>> 
>>> At minimum, it would be nice to have a shorter way to spell that.
>> 
>> I think allprecursors() should be renamed to precursors(), and
>> delete/rename
>> the original precursors().
>> 
>>> But it
>>> seems weird that the log predicate would care about revisions not
>>> in the  
>>> repo.  Boris- it looks like '{precursors}' will skip the obsolete
>>> revision  
>>> not on my system, and agrees with 'last(..)'.
>>> 
> 
> I checked the precursors revset and the behavior is not the one
> expected, thank you for pointing that.
> 
> 
> I also realized that the revset is in Evolve and not in Core, which
> makes it a good opportunity to upstream it.
> 
> I'm not sure if we should keep only the equivalent of allprecursors(),
> what about having a predecessor() and allpredecessors() revsets.
> 
> predecessors() would returns the closests locally known predecessors,
> like the {predecessors} template keyword while allpredecessors() would
> returns all the locally known predecessors.
> 
> What do you think?

I think a dedicated revset to find the first generation, for lack of a better 
word, of predecessors is useful.  I use it all the time to ensure rebase/evolve 
conflict resolution didn’t drop anything, though it only works if it wasn’t 
split or folded.

There was a proposal for short handing something like this, so maybe a 
dedicated predicate won’t be needed in the future.  But it would be nice if the 
template and revset agreed, and I don’t see an “all” template as being as 
useful as the current one.

http://mercurial.markmail.org/thread/sjnnwa43s4eksu62

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


Re: [PATCH 2 of 2] lfs: migrate most file filtering from threshold to custom filter

2018-01-16 Thread Boris Feld
On Tue, 2018-01-16 at 08:05 -0500, Matt Harbison wrote:
> On Jan 16, 2018, at 5:26 AM, Boris Feld 
> wrote:
> 
> > On Sun, 2018-01-14 at 17:26 +0900, Yuya Nishihara wrote:
> > > On Sun, 14 Jan 2018 00:22:05 -0500, Matt Harbison wrote:
> > > > On Sat, 13 Jan 2018 21:11:45 -0500, Yuya Nishihara  > > > rg>
> > > > wrote:
> > > > 
> > > > > On Sat, 13 Jan 2018 02:23:16 -0500, Matt Harbison wrote:
> > > > > > # HG changeset patch
> > > > > > # User Matt Harbison 
> > > > > > # Date 1514706889 18000
> > > > > > #  Sun Dec 31 02:54:49 2017 -0500
> > > > > > # Node ID 66976f55793cced57929dedc8993204be340c717
> > > > > > # Parent  868cc63bfe9d7d7f5b40bc8cd70175cf1a608a95
> > > > > > lfs: migrate most file filtering from threshold to custom
> > > > > > filter
> > > > > 
> > > > > Queued, thanks.
> > > > > 
> > > > > > -threshold = repo.ui.configbytes('lfs', 'threshold')
> > > > > > +trackspec = repo.ui.config('lfs', 'track')
> > > > > > 
> > > > > > -repo.svfs.options['lfsthreshold'] = threshold
> > > > > > +# deprecated config: lfs.threshold
> > > > > > +threshold = repo.ui.configbytes('lfs', 'threshold')
> > > > > > +if threshold:
> > > > > > +trackspec = "(%s) | size('>%s')" % (trackspec,
> > > > > > threshold)
> > > > > 
> > > > > I've added fileset.parse(trackspec) to detect bad spec like
> > > > > '..)
> > > > > ..  
> > > > > (..', and
> > > > > s/%s/%d/ to make sure threshold is integer so no need of
> > > > > string
> > > > > escape.
> > > > 
> > > > Thanks.
> > > > 
> > > > I assume that your amend obsoleted something local only to your
> > > > system?   
> > > > The reason I ask is because I ran `hg extdiff --patch --hidden
> > > > -r  
> > > > 'precursors(c780e06)' -r c780e06`, and it aborted with an empty
> > > > revision.   
> > > > It's the precursors() predicate coming up empty.  I ended up
> > > > using  
> > > > 'last(allprecursors(c780e06))', and that found what I
> > > > submitted.  But that  
> > > > seems inconsistent with the obsolete line of that logged
> > > > revision
> > > > pointing  
> > > > directly to c780e06.
> > > 
> > > What I generally do is:
> > > 
> > >  hg import --obsolete mails  # yours->mine
> > >  hg amend# mine->committed
> > > 
> > > > At minimum, it would be nice to have a shorter way to spell
> > > > that.
> > > 
> > > I think allprecursors() should be renamed to precursors(), and
> > > delete/rename
> > > the original precursors().
> > > 
> > > > But it
> > > > seems weird that the log predicate would care about revisions
> > > > not
> > > > in the  
> > > > repo.  Boris- it looks like '{precursors}' will skip the
> > > > obsolete
> > > > revision  
> > > > not on my system, and agrees with 'last(..)'.
> > > > 
> > 
> > I checked the precursors revset and the behavior is not the one
> > expected, thank you for pointing that.
> > 
> > 
> > I also realized that the revset is in Evolve and not in Core, which
> > makes it a good opportunity to upstream it.
> > 
> > I'm not sure if we should keep only the equivalent of
> > allprecursors(),
> > what about having a predecessor() and allpredecessors() revsets.
> > 
> > predecessors() would returns the closests locally known
> > predecessors,
> > like the {predecessors} template keyword while allpredecessors()
> > would
> > returns all the locally known predecessors.
> > 
> > What do you think?
> 
> I think a dedicated revset to find the first generation, for lack of
> a better word, of predecessors is useful.  I use it all the time to
> ensure rebase/evolve conflict resolution didn’t drop anything, though
> it only works if it wasn’t split or folded.

I think the term we used is closest predecessor, at least we have a
function named closestpredecessors in obsutil.py.

> There was a proposal for short handing something like this, so maybe
> a dedicated predicate won’t be needed in the future.  But it would be
> nice if the template and revset agreed, and I don’t see an “all”
> template as being as useful as the current one.
> 
> 
> http://mercurial.markmail.org/thread/sjnnwa43s4eksu62
> 

I was not aware of this proposal. I think a dedicated predicate would
be usefull too to have more verbose and more readable templates.

When you are speaking about an "all" tempalte, do you means that you
don't think an "allpredecessors" template would be usefull in core?___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 3] svnsubrepo: decorate dirty method with annotatesubrepoerror

2018-01-16 Thread Jordi Gutiérrez Hermoso
# HG changeset patch
# User Jordi Gutiérrez Hermoso 
# Date 1515949528 18000
#  Sun Jan 14 12:05:28 2018 -0500
# Node ID fde3cd2487e1f4d5867bf8c6e79139b6fe475779
# Parent  58fda95a0202fc6327d1f5d9df26f7ff16538d57
svnsubrepo: decorate dirty method with annotatesubrepoerror

This function invokes svn commands which can error out in any number
of ways, so it's helpful to know in which subrepo this error happens.

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1331,6 +1331,7 @@ class svnsubrepo(abstractsubrepo):
 return True, True, bool(missing)
 return bool(changes), False, bool(missing)
 
+@annotatesubrepoerror
 def dirty(self, ignoreupdate=False, missing=False):
 wcchanged = self._wcchanged()
 changed = wcchanged[0] or (missing and wcchanged[2])
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 3] svnsubrepo: add new method _svnmissing

2018-01-16 Thread Jordi Gutiérrez Hermoso
# HG changeset patch
# User Jordi Gutiérrez Hermoso 
# Date 1515949626 18000
#  Sun Jan 14 12:07:06 2018 -0500
# Node ID cebbb137db75c45e891a65a8dbc50631ed8cb83c
# Parent  fde3cd2487e1f4d5867bf8c6e79139b6fe475779
svnsubrepo: add new method _svnmissing

This is modelled after _gitmissing from dea6efdd7ec4 and also
necessary for svn. I'm not sure exactly how this hasn't been more of a
problem for svn until now, actually.

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1284,6 +1284,9 @@ class svnsubrepo(abstractsubrepo):
 raise error.Abort(_('cannot retrieve svn tool version'))
 return (int(m.group(1)), int(m.group(2)))
 
+def _svnmissing(self):
+return not self.wvfs.exists('.svn')
+
 def _wcrevs(self):
 # Get the working directory revision as well as the last
 # commit revision so we can compare the subrepo state with
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 3 of 3] svnsubrepo: check if subrepo is missing when checking dirty state (issue5657)

2018-01-16 Thread Jordi Gutiérrez Hermoso
# HG changeset patch
# User Jordi Gutiérrez Hermoso 
# Date 1516110014 18000
#  Tue Jan 16 08:40:14 2018 -0500
# Node ID 3a379eceab7886ae9a8f661c648c2759c69a9013
# Parent  cebbb137db75c45e891a65a8dbc50631ed8cb83c
svnsubrepo: check if subrepo is missing when checking dirty state (issue5657)

During an hg convert command, subrepos are not checked out. However, a
manifestmerge may occur during an hg convert if there is a merge
commit, which in particular will check the dirty state of subrepos.
Before this change, the lack of a checked out subrepo would error out.

This check for svn subrepos is modelled after 2fdea636f254 for git
subrepos.

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1336,6 +1336,8 @@ class svnsubrepo(abstractsubrepo):
 
 @annotatesubrepoerror
 def dirty(self, ignoreupdate=False, missing=False):
+if self._svnmissing():
+return self._state[1] != ''
 wcchanged = self._wcchanged()
 changed = wcchanged[0] or (missing and wcchanged[2])
 if not changed:
diff --git a/tests/test-convert-svn-source.t b/tests/test-convert-svn-source.t
--- a/tests/test-convert-svn-source.t
+++ b/tests/test-convert-svn-source.t
@@ -253,3 +253,72 @@ depot that can be seen from the test env
   abort: svn-empty: missing or unsupported repository
   [255]
   $ mv format svn-empty/format
+
+enable svn subrepos
+
+  $ cat >> $HGRCPATH < [subrepos]
+  > svn:allowed = true
+  > EOF
+
+try converting when we have an svn subrepo and a merge in hg superrepo 
(issue5657)
+
+  $ cd "$TESTTMP"
+  $ hg init withmerge
+  $ cd withmerge
+  $ echo "subrepo = [svn]$SVNREPOURL" >.hgsub
+  $ hg add .hgsub
+  $ svn checkout "$SVNREPOURL" subrepo
+  Asubrepo/proj B
+  Asubrepo/proj B/mytrunk
+  Asubrepo/proj B/mytrunk/letter .txt
+  Asubrepo/proj B/mytrunk/letter2.txt
+  Asubrepo/proj B/tags
+  Asubrepo/proj B/tags/v0.1
+  Asubrepo/proj B/tags/v0.1/letter .txt
+  Asubrepo/proj B/tags/v0.2
+  Asubrepo/proj B/tags/v0.2/letter .txt
+  Asubrepo/proj B/tags/v0.2/letter2.txt
+  Checked out revision 9.
+  $ hg ci -m "Adding svn subrepo"
+  $ touch file1.txt
+  $ hg add file1.txt
+  $ hg ci -m "Adding file1"
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ touch file2.txt
+  $ hg add file2.txt
+  $ hg ci -m "Adding file2"
+  created new head
+  $ hg merge 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m "merged"
+  $ cd ..
+  $ hg --config extensions.convert= convert withmerge withmerge-converted
+  initializing destination withmerge-converted repository
+  scanning source...
+  sorting...
+  converting...
+  3 Adding svn subrepo
+  2 Adding file1
+  1 Adding file2
+  0 merged
+  $ cd withmerge-converted
+  $ hg up
+  Asubrepo/proj B
+  Asubrepo/proj B/mytrunk
+  Asubrepo/proj B/mytrunk/letter .txt
+  Asubrepo/proj B/mytrunk/letter2.txt
+  Asubrepo/proj B/tags
+  Asubrepo/proj B/tags/v0.1
+  Asubrepo/proj B/tags/v0.1/letter .txt
+  Asubrepo/proj B/tags/v0.2
+  Asubrepo/proj B/tags/v0.2/letter .txt
+  Asubrepo/proj B/tags/v0.2/letter2.txt
+  Checked out revision 9.
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ ls
+  file1.txt
+  file2.txt
+  subrepo
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] showstack: add an extension docstring

2018-01-16 Thread Yuya Nishihara
On Tue, 16 Jan 2018 10:26:55 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld 
> # Date 1512938553 -3600
> #  Sun Dec 10 21:42:33 2017 +0100
> # Node ID bff8fba926e22982e6b5be544fc36e1e16cedfdd
> # Parent  ebf14075a5c113f4fea6e89a4394d8c8fc9e6935
> # EXP-Topic showstack-doc
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> bff8fba926e2
> showstack: add an extension docstring

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


Re: [PATCH] bookmark: run 'pushkey' hooks after bookmark move, not 'prepushkey'

2018-01-16 Thread Yuya Nishihara
On Mon, 15 Jan 2018 17:37:01 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld 
> # Date 1516013089 0
> #  Mon Jan 15 10:44:49 2018 +
> # Node ID 4d0d11752cf1d6e0f60bc3c9cc3d036dfa36e0a9
> # Parent  ebf14075a5c113f4fea6e89a4394d8c8fc9e6935
> # EXP-Topic fix-book
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> 4d0d11752cf1
> bookmark: run 'pushkey' hooks after bookmark move, not 'prepushkey'

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


Re: [PATCH 1 of 3 V2] lfs: convert '{lfs_files}' keyword to a hybrid list

2018-01-16 Thread Yuya Nishihara
On Mon, 15 Jan 2018 21:42:18 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1515962350 18000
> #  Sun Jan 14 15:39:10 2018 -0500
> # Node ID 9a5f40a1d18f0a28538b9a38fdee0874c58e680f
> # Parent  48fe4f56a3b4138813ba912b012498ce349c4c24
> lfs: convert '{lfs_files}' keyword to a hybrid list

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


Re: [PATCH] hgweb: remove unused second argument of nextPageVarGet()

2018-01-16 Thread Yuya Nishihara
On Mon, 15 Jan 2018 21:16:03 +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov 
> # Date 1516016658 -28800
> #  Mon Jan 15 19:44:18 2018 +0800
> # Node ID edffa2f39c620cb2a8e9c177b96b3aeedf28bae9
> # Parent  a177c6aa055a86799e9dd9cecc3bbb3531759bcc
> hgweb: remove unused second argument of nextPageVarGet()

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


Re: [PATCH V3] lfs: add the '{raw}' template keyword to '{lfs_files}'

2018-01-16 Thread Yuya Nishihara
On Tue, 16 Jan 2018 00:40:20 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1515967224 18000
> #  Sun Jan 14 17:00:24 2018 -0500
> # Node ID 5147a1a45b239a79765499b58f253b6503ea
> # Parent  4f66e5c58c21d6a743d1ea69398b7fa2b9ff6419
> lfs: add the '{raw}' template keyword to '{lfs_files}'
> 
> Even though it is (probably) weird to have multiline output from a keyword,
> something similar to this is useful as the public interface to dump the raw
> pointer content.  I still haven't figured out how to use `hg debugdata` in a 
> non
> trivial repo, and that will just be another point of aggravation when 
> debugging
> a problem.  The raw text is accessed directly here, so that we don't mask any
> problems in the data while deserializing and processing it (or abort).
> 
> Ultimately, this functionality should probably be provided by something like
> `hg cat file -T '{raw}'`, and this keyword translated to a dict of the 
> metadata.
> For non-LFS files, this would do the same thing as normal `hg cat`.  This 
> would
> be similar (I think) to `git show HEAD:{filename}`.  But with the freeze
> looming, I won't have time to figure that out, and it could be a valuable
> debugging tool as this extension gets a wider audience.
> 
> diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py
> --- a/hgext/lfs/__init__.py
> +++ b/hgext/lfs/__init__.py
> @@ -231,6 +231,7 @@
>  makemap = lambda v: {
>  'file': v,
>  'oid': pointers[v].oid(),
> +'raw': ctx[v].rawdata(),  # pointersfromctx() filters out removed 
> files

This looks much better than V2.

My two cents, let's call it {rawdata}. "hg cat" provides {data} for fctx.data().
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2] lfs: migrate most file filtering from threshold to custom filter

2018-01-16 Thread Yuya Nishihara
On Tue, 16 Jan 2018 14:20:32 +0100, Boris Feld wrote:
> On Tue, 2018-01-16 at 08:05 -0500, Matt Harbison wrote:
> > On Jan 16, 2018, at 5:26 AM, Boris Feld 
> > wrote:
> > > I also realized that the revset is in Evolve and not in Core, which
> > > makes it a good opportunity to upstream it.
> > > 
> > > I'm not sure if we should keep only the equivalent of
> > > allprecursors(),
> > > what about having a predecessor() and allpredecessors() revsets.
> > > 
> > > predecessors() would returns the closests locally known
> > > predecessors,
> > > like the {predecessors} template keyword while allpredecessors()
> > > would
> > > returns all the locally known predecessors.
> > > 
> > > What do you think?
> > 
> > I think a dedicated revset to find the first generation, for lack of
> > a better word, of predecessors is useful.  I use it all the time to
> > ensure rebase/evolve conflict resolution didn’t drop anything, though
> > it only works if it wasn’t split or folded.
> 
> I think the term we used is closest predecessor, at least we have a
> function named closestpredecessors in obsutil.py.
> 
> > There was a proposal for short handing something like this, so maybe
> > a dedicated predicate won’t be needed in the future.  But it would be
> > nice if the template and revset agreed, and I don’t see an “all”
> > template as being as useful as the current one.
> > 
> > 
> > http://mercurial.markmail.org/thread/sjnnwa43s4eksu62
> > 
> 
> I was not aware of this proposal. I think a dedicated predicate would
> be usefull too to have more verbose and more readable templates.

Perhaps.

For the record, the core already has successors() which behaves more like
allsuccessors() in evolve. Maybe it could have depth=n option?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH] templater: make sure expression is terminated by '}'

2018-01-16 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1516106562 -32400
#  Tue Jan 16 21:42:42 2018 +0900
# Node ID 1700a9086c9cd3777a35f3e9212cdc0826d7b26b
# Parent  20dbbfdf7e253211ccbd31d9c44013f41f6e2461
templater: make sure expression is terminated by '}'

This can't be ensured by the tokenize() generator since the parser stop
consuming tokens once it reached an end of an operation.

Spotted by Matt Harbison.

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -184,6 +184,8 @@ def _parsetemplate(tmpl, start, stop, qu
 return parsed, n + 1
 
 parseres, pos = p.parse(tokenize(tmpl, n + 1, stop, '}'))
+if not tmpl.endswith('}', n + 1, pos):
+raise error.ParseError(_("invalid token"), pos)
 parsed.append(parseres)
 
 if quote:
diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -2756,6 +2756,15 @@ Error on syntax:
   $ hg log -T '{date'
   hg: parse error at 1: unterminated template expansion
   [255]
+  $ hg log -T '{date(}'
+  hg: parse error at 7: not a prefix: end
+  [255]
+  $ hg log -T '{date)}'
+  hg: parse error at 5: invalid token
+  [255]
+  $ hg log -T '{date date}'
+  hg: parse error at 6: invalid token
+  [255]
 
 Behind the scenes, this will throw TypeError
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH] update: fix crash on bare update when directaccess is enabled

2018-01-16 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1516107087 -32400
#  Tue Jan 16 21:51:27 2018 +0900
# Node ID 14f119c9ff3630859b64e207b389c49d68840b96
# Parent  1700a9086c9cd3777a35f3e9212cdc0826d7b26b
update: fix crash on bare update when directaccess is enabled

'rev' may be None. An empty 'rev' string shouldn't also be passed to
unhidehashlikerevs().

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5530,7 +5530,8 @@ def update(ui, repo, node=None, rev=None
 
 # if we defined a bookmark, we have to remember the original name
 brev = rev
-repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
+if rev:
+repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
 ctx = scmutil.revsingle(repo, rev, rev)
 rev = ctx.rev()
 if ctx.hidden():
diff --git a/tests/test-directaccess.t b/tests/test-directaccess.t
--- a/tests/test-directaccess.t
+++ b/tests/test-directaccess.t
@@ -162,6 +162,9 @@ This should not throw error
   $ hg up 3
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
+  $ hg up
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
 `hg revert`
 
   $ hg revert -r 28ad74 --all
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH] match: do not weirdly include explicit files excluded by -X option

2018-01-16 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1516108473 -32400
#  Tue Jan 16 22:14:33 2018 +0900
# Node ID ca4d61bf46160a31c6653c4f0794cd6e8ae788a4
# Parent  14f119c9ff3630859b64e207b389c49d68840b96
match: do not weirdly include explicit files excluded by -X option

Actually, this was the original behavior. Before a83a7d27911e, "log" and
"files" showed nothing if "FILE -X FILE" was specified, whereas "debugwalk"
got confused by an explicit FILE pattern. Under the hood, "log" and "files"
use m() and ctx.matches(m) respectively, and "debugwalk" uses ctx.walk(m).
I suspect dirstate.walk() goes wrong in _walkexplicit(), which seems to
blindly trust m.files().

I reckon the original "log"/"files" behavior is correct, and drop the hack
from the differencematcher.

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -457,17 +457,10 @@ class exactmatcher(basematcher):
 
 class differencematcher(basematcher):
 '''Composes two matchers by matching if the first matches and the second
-does not. Well, almost... If the user provides a pattern like "-X foo foo",
-Mercurial actually does match "foo" against that. That's because exact
-matches are treated specially. So, since this differencematcher is used for
-excludes, it needs to special-case exact matching.
+does not.
 
 The second matcher's non-matching-attributes (root, cwd, bad, explicitdir,
 traversedir) are ignored.
-
-TODO: If we want to keep the behavior described above for exact matches, we
-should consider instead treating the above case something like this:
-union(exact(foo), difference(pattern(foo), include(foo)))
 '''
 def __init__(self, m1, m2):
 super(differencematcher, self).__init__(m1._root, m1._cwd)
@@ -478,7 +471,7 @@ class differencematcher(basematcher):
 self.traversedir = m1.traversedir
 
 def matchfn(self, f):
-return self._m1(f) and (not self._m2(f) or self._m1.exact(f))
+return self._m1(f) and not self._m2(f)
 
 @propertycache
 def _files(self):
diff --git a/tests/test-locate.t b/tests/test-locate.t
--- a/tests/test-locate.t
+++ b/tests/test-locate.t
@@ -103,6 +103,11 @@ Issue294: hg remove --after dir fails wh
   $ hg files b
   b
 
+-X with explicit path:
+
+  $ hg files b -X b
+  [1]
+
   $ mkdir otherdir
   $ cd otherdir
 
diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -102,6 +102,10 @@ log on directory
   summary: c
   
 
+-X, with explicit path
+
+  $ hg log a -X a
+
 -f, non-existent directory
 
   $ hg log -f dir
diff --git a/tests/test-walk.t b/tests/test-walk.t
--- a/tests/test-walk.t
+++ b/tests/test-walk.t
@@ -344,6 +344,21 @@
   abort: path 'beans/.hg' is inside nested repo 'beans'
   [255]
 
+Test explicit paths and excludes:
+(BROKEN: nothing should be included, but wctx.walk() does)
+
+  $ hg debugwalk fennel -X fennel
+  matcher: , m2=>
+  f  fennel  fennel  exact
+  $ hg debugwalk fennel -X 'f*'
+  matcher: , m2=>
+  f  fennel  fennel  exact
+  $ hg debugwalk beans/black -X 'path:beans'
+  matcher: , m2=>
+  f  beans/black  beans/black  exact
+  $ hg debugwalk -I 'path:beans/black' -X 'path:beans'
+  matcher: , m2=>
+
 Test absolute paths:
 
   $ hg debugwalk `pwd`/beans
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] update: fix crash on bare update when directaccess is enabled

2018-01-16 Thread Pulkit Goyal
Oops, thanks for the fix. Looks good to me.

On Tue, Jan 16, 2018 at 7:55 PM, Yuya Nishihara  wrote:
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1516107087 -32400
> #  Tue Jan 16 21:51:27 2018 +0900
> # Node ID 14f119c9ff3630859b64e207b389c49d68840b96
> # Parent  1700a9086c9cd3777a35f3e9212cdc0826d7b26b
> update: fix crash on bare update when directaccess is enabled
>
> 'rev' may be None. An empty 'rev' string shouldn't also be passed to
> unhidehashlikerevs().
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -5530,7 +5530,8 @@ def update(ui, repo, node=None, rev=None
>
>  # if we defined a bookmark, we have to remember the original name
>  brev = rev
> -repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
> +if rev:
> +repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
>  ctx = scmutil.revsingle(repo, rev, rev)
>  rev = ctx.rev()
>  if ctx.hidden():
> diff --git a/tests/test-directaccess.t b/tests/test-directaccess.t
> --- a/tests/test-directaccess.t
> +++ b/tests/test-directaccess.t
> @@ -162,6 +162,9 @@ This should not throw error
>$ hg up 3
>1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>
> +  $ hg up
> +  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +
>  `hg revert`
>
>$ hg revert -r 28ad74 --all
> ___
> 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 6 of 6] largefiles: modernize how capabilities are added to the wire protocol

2018-01-16 Thread Augie Fackler


> On Jan 15, 2018, at 23:59, Matt Harbison  wrote:
> 
> On Mon, 15 Jan 2018 12:33:19 -0500, Augie Fackler  wrote:
> 
>> We’re generally more relaxed for things that only matter for experimental 
>> code, and UX improvements can happen if they’re important enough.
>> 
>> Ugh, I forgot the freeze. We might need to do this UX improvement in the 
>> next cycle as part of making lfs not experimental...
> 
> Any idea when the official cutoff is?  I've been assuming the 18th, hopefully 
> late evening -0500.  In addition to the stuff I have in flight, I need to 
> tweak the User-Agent again, and default to no lfs workers to avoid the upload 
> error.  The latter two are probably important to get into the -rc installer 
> to avoid a bad first impression.

Late on the 18th or first thing on the 19th seems likely as a time when one of 
us will cut the RC, which starts the freeze. I won't do it before EOD on the 
18th.

> I'm fine holding off on that UX improvement.  I'm sure we will hit it, but 
> it's manageable.

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


Evolve 7.2.0 released

2018-01-16 Thread Boris Feld
We pushed a new release of evolve and topic.

As usual, the release is available on pypi and upgrade is recommended.

This version comes with the usual various bug fixes and improvement. It
also includes a large rework of the experimental obsolescence markers
discovery protocol we call "obshashrange". The newer protocol is faster
to compute and cache. It was able to handle all the repositories it has
been tested on (up to around 1 millions revisions). The experimental is
still turned off by default, use experimental.obshashrange=yes to use
it.

Full changelog below.

   * evolve: changes to the on-disk format for interrupted evolve
   * evolve: --continue now properly preserve phase (issue5720)
   * evolve: --continue now properly reports merges as evolve
   * commit: suggest using topic on new heads
   * uncommit: `--revert` flag added to clean the wdir after uncommit
   * obslog: add color support to content-diff output with --patch
   * fix `hg prev` behavior on obsolete changesets
   * no longer issues "obsolete working copy" message during no-op

   * use the new instabilities names from mercurial 4.4+
 (in `hg evolve --list` and other messages)

   * new algorithm for obshashrange discovery:

 The new algorithm is faster, simpler to cache and with better
 complexity. It is able to handle repository of any size (naive
 python implementation is a bit slow). Support for the previous
 experimental approach has been dropped, please update both clients
 and servers. This new discovery method is disabled by default.
 Use experimental.obshashrang=yes on both client and server.

topic (0.7.0)

   * fix compatibility with Mercurial-4.3
   * new template keyword `topic` to get changesets topic

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


[Bug 5771] New: Mercurial patch parser behavior for "--git" patches creating files with spaces differs from Git when the patch file omits trailing tabs

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

Bug ID: 5771
   Summary: Mercurial patch parser behavior for "--git" patches
creating files with spaces differs from Git when the
patch file omits trailing tabs
   Product: Mercurial
   Version: default branch
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: sele...@yghe.net
CC: mercurial-devel@mercurial-scm.org

This is a tangled mess that dates back to at least 1991 and not really a bug in
Mercurial, but I figured I'd discuss it upstream for completeness in case
someone else runs into it eventually or it's otherwise helpful.

Briefly: `hg import` can parse and apply Git patches, but the behavior of `hg
import` for certain inputs (patch files which are invalid, but look reasonable)
differs from the behavior of `git apply` for the same patch files.

When a change creates a file with a space in it, like `X Y.txt`, `git` emits a
patch with a trailing tab literal:

```
diff --git ...
...
+++ b/X Y.txt\t
...
```

All of `git apply`, `hg import`, and `patch` apply this patch correctly.

However, if the semantic, trailing tab literal is removed, `git apply` parses
the file path `X Y.txt` while Mercurial parses the file path `X`.

`patch` agrees with Mercurial, but this is a `diff --git`, so arguably
Mercurial should do what Git does instead. In this case, Git's behavior is also
what the user is likely to expect.

Since 2006 (see
)
there is no way to generate these patches directly with Git. They can only be
generated by damaging a patch file in a way that strips trailing tabs (e.g.,
maybe emailing it and then copy/pasting it) or by a third-party tool generating
synthetic patches and missing this implementation detail (as here; the need to
apply a trailing tab literal to files with spaces in the names evaded me when
implementing patch generation behavior in Phabricator).

Mercurial uses this logic to parse the filename (in `patch.py`):

```
def parsefilename(str):
# --- filename \t|space stuff
s = str[4:].rstrip('\r\n')
i = s.find('\t')
if i < 0:
i = s.find(' ')
if i < 0:
return s
return s[:i]
```

Simply removing the test for spaces would make the behavior match Git's
behavior in this specific, narrow case. However, it might change behavior in
other cases, and I wasn't able to dig up the provenance of this logic (it
vanishes into Chris Mason's `mpatch` library in 2007, and I can't find a
repository for that library since the Oracle repository no longer seems to
exist). So I don't know if this change is safe or reasonable. Since it requires
a herculean effort to even encounter this behavior, the change may not be
worthwhile.

This logic also executes for both `--git` patches and unified patches, and the
implementation might reasonably prefer to match the behavior of `patch` for
patches not marked as `--git`.

Realistically, you should probably just close this issue and forget about it.

See  for additional context about how we
encountered and resolved this and what Git and `diff` do and some guesses at
why.

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


[Bug 5772] New: hg fold doesn't move bookmarks

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

Bug ID: 5772
   Summary: hg fold doesn't move bookmarks
   Product: Mercurial
   Version: 4.4.2
  Hardware: PC
OS: Windows
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: evolution
  Assignee: bugzi...@mercurial-scm.org
  Reporter: c...@perspexis.com
CC: mercurial-devel@mercurial-scm.org,
pierre-yves.da...@ens-lyon.org

If you have activate a bookmark and do `hg fold` the bookmark should move to
the new commit.

$ hg init
$ echo a > a
$ hg add a
$ hg commit -m "a"
$ echo b > b
$ hg add b
$ hg commit -m "b"
$ hg book @

$ hg la
@   1 cody tip @ (2018-01-16)
|  b
o   0 cody (2018-01-16)
   a

$ hg fold -r . -r .^ --exact
2 changesets folded
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ # current result

$ hg la
@   2 cody tip (2018-01-16)
   b
x   1 cody @ (2018-01-16)
|  b
x   0 cody (2018-01-16)
   a

$ hg book @
moving bookmark '@' forward from b53d2f525529
$ # desired result

$ hg la
@   2 cody tip @ (2018-01-16)
   b

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


Re: [PATCH] match: do not weirdly include explicit files excluded by -X option

2018-01-16 Thread Martin von Zweigbergk via Mercurial-devel
On Tue, Jan 16, 2018 at 6:27 AM, Yuya Nishihara  wrote:
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1516108473 -32400
> #  Tue Jan 16 22:14:33 2018 +0900
> # Node ID ca4d61bf46160a31c6653c4f0794cd6e8ae788a4
> # Parent  14f119c9ff3630859b64e207b389c49d68840b96
> match: do not weirdly include explicit files excluded by -X option
>
> Actually, this was the original behavior. Before a83a7d27911e, "log" and
> "files" showed nothing if "FILE -X FILE" was specified, whereas "debugwalk"
> got confused by an explicit FILE pattern. Under the hood, "log" and "files"
> use m() and ctx.matches(m) respectively, and "debugwalk" uses ctx.walk(m).
> I suspect dirstate.walk() goes wrong in _walkexplicit(), which seems to
> blindly trust m.files().

Aha, that's how it was working! Nice find, and thanks for the patch.
Great to see this weird case gone. Queued.

I'm surprised there are no tests that need updating. I wonder how I
even noticed that debugwalk was behaving the way it was. I checked
that there were no test failures even at a83a7d27911e with this patch
on top.

>
> I reckon the original "log"/"files" behavior is correct, and drop the hack
> from the differencematcher.
>
> diff --git a/mercurial/match.py b/mercurial/match.py
> --- a/mercurial/match.py
> +++ b/mercurial/match.py
> @@ -457,17 +457,10 @@ class exactmatcher(basematcher):
>
>  class differencematcher(basematcher):
>  '''Composes two matchers by matching if the first matches and the second
> -does not. Well, almost... If the user provides a pattern like "-X foo 
> foo",
> -Mercurial actually does match "foo" against that. That's because exact
> -matches are treated specially. So, since this differencematcher is used 
> for
> -excludes, it needs to special-case exact matching.
> +does not.
>
>  The second matcher's non-matching-attributes (root, cwd, bad, 
> explicitdir,
>  traversedir) are ignored.
> -
> -TODO: If we want to keep the behavior described above for exact matches, 
> we
> -should consider instead treating the above case something like this:
> -union(exact(foo), difference(pattern(foo), include(foo)))
>  '''
>  def __init__(self, m1, m2):
>  super(differencematcher, self).__init__(m1._root, m1._cwd)
> @@ -478,7 +471,7 @@ class differencematcher(basematcher):
>  self.traversedir = m1.traversedir
>
>  def matchfn(self, f):
> -return self._m1(f) and (not self._m2(f) or self._m1.exact(f))
> +return self._m1(f) and not self._m2(f)
>
>  @propertycache
>  def _files(self):

There's also a comment in visitdir() that should be removed now. I'll
do that in flight. For reference: here's that hunk:

@@ -486,9 +486,6 @@ class differencematcher(basematcher):

 def visitdir(self, dir):
 if self._m2.visitdir(dir) == 'all':
-# There's a bug here: If m1 matches file 'dir/file' and m2 excludes
-# 'dir' (recursively), we should still visit 'dir' due to the
-# exception we have for exact matches.
 return False
 return bool(self._m1.visitdir(dir))

> diff --git a/tests/test-locate.t b/tests/test-locate.t
> --- a/tests/test-locate.t
> +++ b/tests/test-locate.t
> @@ -103,6 +103,11 @@ Issue294: hg remove --after dir fails wh
>$ hg files b
>b
>
> +-X with explicit path:
> +
> +  $ hg files b -X b
> +  [1]
> +
>$ mkdir otherdir
>$ cd otherdir
>
> diff --git a/tests/test-log.t b/tests/test-log.t
> --- a/tests/test-log.t
> +++ b/tests/test-log.t
> @@ -102,6 +102,10 @@ log on directory
>summary: c
>
>
> +-X, with explicit path
> +
> +  $ hg log a -X a
> +
>  -f, non-existent directory
>
>$ hg log -f dir
> diff --git a/tests/test-walk.t b/tests/test-walk.t
> --- a/tests/test-walk.t
> +++ b/tests/test-walk.t
> @@ -344,6 +344,21 @@
>abort: path 'beans/.hg' is inside nested repo 'beans'
>[255]
>
> +Test explicit paths and excludes:
> +(BROKEN: nothing should be included, but wctx.walk() does)
> +
> +  $ hg debugwalk fennel -X fennel
> +  matcher:  patterns='(?:fennel(?:/|$))'>, m2= includes='(?:fennel(?:/|$))'>>
> +  f  fennel  fennel  exact
> +  $ hg debugwalk fennel -X 'f*'
> +  matcher:  patterns='(?:fennel(?:/|$))'>, m2= includes='(?:f[^/]*(?:/|$))'>>
> +  f  fennel  fennel  exact
> +  $ hg debugwalk beans/black -X 'path:beans'
> +  matcher:  patterns='(?:beans\\/black(?:/|$))'>, m2= includes='(?:beans(?:/|$))'>>
> +  f  beans/black  beans/black  exact
> +  $ hg debugwalk -I 'path:beans/black' -X 'path:beans'
> +  matcher:  includes='(?:beans\\/black(?:/|$))'>, m2= includes='(?:beans(?:/|$))'>>
> +
>  Test absolute paths:
>
>$ hg debugwalk `pwd`/beans
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@35590: 49 new changesets

2018-01-16 Thread Mercurial Commits
49 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/beb667c9880f
changeset:   35542:beb667c9880f
parent:  35537:58fda95a0202
user:Yuya Nishihara 
date:Sat Dec 30 17:55:23 2017 +0900
summary: revset: parse x^:: as (x^):: (issue5764)

https://www.mercurial-scm.org/repo/hg/rev/a7f7eff4ec08
changeset:   35543:a7f7eff4ec08
user:Yuya Nishihara 
date:Thu Jan 04 10:51:41 2018 +0900
summary: log: merge getlogrevs() and getgraphlogrevs()

https://www.mercurial-scm.org/repo/hg/rev/8494944940e5
changeset:   35544:8494944940e5
user:Yuya Nishihara 
date:Sun Oct 22 23:04:07 2017 +0900
summary: log: use smartset.slice() to limit number of revisions to be 
displayed

https://www.mercurial-scm.org/repo/hg/rev/349bcd7fa670
changeset:   35545:349bcd7fa670
user:Yuya Nishihara 
date:Sun Oct 22 22:38:16 2017 +0900
summary: log: remove redundant handling of --limit

https://www.mercurial-scm.org/repo/hg/rev/5e1d4ccab455
changeset:   35546:5e1d4ccab455
user:Yuya Nishihara 
date:Sun Oct 22 22:52:36 2017 +0900
summary: graphlog: remove redundant check for empty revs

https://www.mercurial-scm.org/repo/hg/rev/b6dbc860570d
changeset:   35547:b6dbc860570d
user:Yuya Nishihara 
date:Thu Jan 04 12:00:18 2018 +0900
summary: log: don't expand aliases in revset built from command options

https://www.mercurial-scm.org/repo/hg/rev/b14c8bcfbad9
changeset:   35548:b14c8bcfbad9
user:Yuya Nishihara 
date:Sun Oct 22 22:49:11 2017 +0900
summary: log: drop unused expr from return value of getlogrevs()

https://www.mercurial-scm.org/repo/hg/rev/94a127152e25
changeset:   35549:94a127152e25
user:Yuya Nishihara 
date:Tue Jan 02 12:02:25 2018 +0900
summary: win32: allocate buffer of maximum length for GetVolumeInformation()

https://www.mercurial-scm.org/repo/hg/rev/ed30934165c9
changeset:   35550:ed30934165c9
user:Yuya Nishihara 
date:Tue Jan 02 12:14:08 2018 +0900
summary: win32: do not call GetVolumePathName() with the minimum buffer 
length

https://www.mercurial-scm.org/repo/hg/rev/fa9dd53eb23e
changeset:   35551:fa9dd53eb23e
user:Matt Harbison 
date:Thu Dec 21 18:56:04 2017 -0500
summary: lfs: introduce a localstore method for downloading from remote 
stores

https://www.mercurial-scm.org/repo/hg/rev/fd610befc37f
changeset:   35552:fd610befc37f
user:Matt Harbison 
date:Thu Dec 21 21:20:00 2017 -0500
summary: lfs: use the localstore download method to transfer from remote 
stores

https://www.mercurial-scm.org/repo/hg/rev/a77418095530
changeset:   35553:a77418095530
user:Matt Harbison 
date:Sun Jan 07 01:14:52 2018 -0500
summary: lfs: remove the verification option when writing to the local store

https://www.mercurial-scm.org/repo/hg/rev/99a25bde65a3
changeset:   35554:99a25bde65a3
user:Yuya Nishihara 
date:Wed Jan 03 17:09:16 2018 +0900
summary: test-glog: drop uninteresting nodes from AST output

https://www.mercurial-scm.org/repo/hg/rev/d984d9b3411e
changeset:   3:d984d9b3411e
user:Yuya Nishihara 
date:Wed Jan 03 17:12:30 2018 +0900
summary: test-glog: dump computed set

https://www.mercurial-scm.org/repo/hg/rev/b58964b9b541
changeset:   35556:b58964b9b541
user:Yuya Nishihara 
date:Thu Jan 04 12:30:55 2018 +0900
summary: test-glog: hook cmdutil.getlogrevs() so -frREV is rewritten 
accordingly

https://www.mercurial-scm.org/repo/hg/rev/2df8d12f23bc
changeset:   35557:2df8d12f23bc
user:Yuya Nishihara 
date:Sat Apr 01 16:50:11 2017 +0900
summary: revsetlang: avoid string concatenation in formatspec()

https://www.mercurial-scm.org/repo/hg/rev/dfc628611144
changeset:   35558:dfc628611144
user:Yuya Nishihara 
date:Sat Apr 01 16:55:28 2017 +0900
summary: revsetlang: use str.find() to scan expr in formatspec()

https://www.mercurial-scm.org/repo/hg/rev/a480551bd1b4
changeset:   35559:a480551bd1b4
user:Yuya Nishihara 
date:Sat Apr 01 16:56:47 2017 +0900
summary: revsetlang: unnest "if True" in formatrevspec()

https://www.mercurial-scm.org/repo/hg/rev/3a8810c1b9bc
changeset:   35560:3a8810c1b9bc
user:Yuya Nishihara 
date:Sat Apr 01 17:04:49 2017 +0900
summary: revsetlang: use iterator to track current argument in formatspec()

https://www.mercurial-scm.org/repo/hg/rev/4c3a4bb31c0e
changeset:   35561:4c3a4bb31c0e
user:Yuya Nishihara 
date:Sat Apr 01 17:12:48 2017 +0900
summary: revsetlang: raise ParseError to report invalid format character

https://www.mercurial-scm.org/repo/hg/rev/6580cf751418
changeset:   35562:6580cf751418
user:Boris Feld 
date:Fri Dec 15 09:30:16 2017 +0100
summary: debug: add a 'debugdownload' command

https://www.mercurial-scm.org/repo/hg/rev/4aa6ed598323
changeset:   35563:4aa6ed598323
u

[PATCH 2 of 4] httppeer: move url opening in its own method

2018-01-16 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1515752060 0
#  Fri Jan 12 10:14:20 2018 +
# Node ID 6d0599c2fe114d927f2d37fd5a22e061843c6974
# Parent  219d94744f12bec5dafca7d16c0d473bfe35e732
# EXP-Topic exchangedebug
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
6d0599c2fe11
httppeer: move url opening in its own method

This will help adding debugging logic to request opening when investigating
Mercurial performance.

diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -161,6 +161,9 @@ class httppeer(wireproto.wirepeer):
 h.close()
 getattr(h, "close_all", lambda: None)()
 
+def _openurl(self, req):
+return self._urlopener.open(req)
+
 # Begin of _basepeer interface.
 
 @util.propertycache
@@ -298,7 +301,7 @@ class httppeer(wireproto.wirepeer):
 self.ui.debug("sending %s bytes\n" % size)
 req.add_unredirected_header('Content-Length', '%d' % size)
 try:
-resp = self._urlopener.open(req)
+resp = self._openurl(req)
 except urlerr.httperror as inst:
 if inst.code == 401:
 raise error.Abort(_('authorization failed'))
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 4] http: add a debug version of the push test

2018-01-16 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1515754649 0
#  Fri Jan 12 10:57:29 2018 +
# Node ID 219d94744f12bec5dafca7d16c0d473bfe35e732
# Parent  58fda95a0202fc6327d1f5d9df26f7ff16538d57
# EXP-Topic exchangedebug
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
219d94744f12
http: add a debug version of the push test

This will be useful to test further debugging capabilities in coming changesets.

diff --git a/tests/test-http.t b/tests/test-http.t
--- a/tests/test-http.t
+++ b/tests/test-http.t
@@ -248,6 +248,53 @@ test http authentication
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
   $ hg rollback -q
+  $ hg -R dest push http://user:pass@localhost:$HGPORT2/ --debug
+  pushing to http://user:***@localhost:$HGPORT2/
+  using http://localhost:$HGPORT2/
+  http auth: user user, password 
+  sending capabilities command
+  query 1; heads
+  sending batch command
+  searching for changes
+  all remote heads known locally
+  preparing listkeys for "phases"
+  sending listkeys command
+  http auth: user user, password 
+  received listkey for "phases": 58 bytes
+  checking for updated bookmarks
+  preparing listkeys for "bookmarks"
+  sending listkeys command
+  received listkey for "bookmarks": 0 bytes
+  sending branchmap command
+  sending branchmap command
+  preparing listkeys for "bookmarks"
+  sending listkeys command
+  received listkey for "bookmarks": 0 bytes
+  1 changesets found
+  list of changesets:
+  7f4e523d01f2cc3765ac8934da3d14db775ff872
+  bundle2-output-bundle: "HG20", 5 parts total
+  bundle2-output-part: "replycaps" 178 bytes payload
+  bundle2-output-part: "check:phases" 24 bytes payload
+  bundle2-output-part: "check:heads" streamed payload
+  bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
+  bundle2-output-part: "phase-heads" 24 bytes payload
+  sending unbundle command
+  sending 986 bytes
+  bundle2-input-bundle: no-transaction
+  bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
+  bundle2-input-part: "output" (advisory) (params: 0 advisory) supported
+  bundle2-input-part: total payload size 100
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files
+  bundle2-input-part: "output" (advisory) supported
+  bundle2-input-bundle: 2 parts total
+  preparing listkeys for "phases"
+  sending listkeys command
+  received listkey for "phases": 15 bytes
+  $ hg rollback -q
 
   $ sed 's/.*] "/"/' < ../access.log
   "GET /?cmd=capabilities HTTP/1.1" 200 -
@@ -308,6 +355,16 @@ test http authentication
   "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks 
x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
   "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
   "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases 
x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
+  "GET /?cmd=capabilities HTTP/1.1" 200 -
+  "GET /?cmd=batch HTTP/1.1" 200 - 
x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 
x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
+  "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=phases 
x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
+  "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases 
x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
+  "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks 
x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
+  "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 
comp=$USUAL_COMPRESSIONS$
+  "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 
comp=$USUAL_COMPRESSIONS$
+  "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks 
x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
+  "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 
x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
+  "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases 
x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$
 
   $ cd ..
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 4 of 4] sshpeer: add support for request tracing

2018-01-16 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1515757977 0
#  Fri Jan 12 11:52:57 2018 +
# Node ID 6c6a7d225fef954f6e33eb734cd3a9ce72b0f85b
# Parent  2d1a4bbddd7e4075b0e082cabf84d901f5b92b5b
# EXP-Topic exchangedebug
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
6c6a7d225fef
sshpeer: add support for request tracing

The new 'devel.debug.peer-request' option now also display some information
about request going through ssh peer.

diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
--- a/mercurial/sshpeer.py
+++ b/mercurial/sshpeer.py
@@ -282,6 +282,16 @@ class sshpeer(wireproto.wirepeer):
 yield wireproto.unescapearg(work)
 
 def _callstream(self, cmd, **args):
+if self.ui.configbool('devel', 'debug.peer-request'):
+dbg = self.ui.debug
+line = 'devel-peer-request: %s\n'
+dbg(line % cmd)
+for key, value in sorted(args.items()):
+if not isinstance(value, dict):
+dbg(line % '  %s: %d bytes' % (key, len(value)))
+else:
+for dk, dv in sorted(value.items()):
+dbg(line % '  %s-%s: %d' % (key, dk, len(value)))
 args = pycompat.byteskwargs(args)
 self.ui.debug("sending %s command\n" % cmd)
 self._pipeo.write("%s\n" % cmd)
diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -478,19 +478,32 @@ stderr from remote commands should be pr
 
 debug output
 
-  $ hg pull --debug ssh://user@dummy/remote
+  $ hg pull --debug ssh://user@dummy/remote --config 
devel.debug.peer-request=yes
   pulling from ssh://user@dummy/remote
   running .* ".*/dummyssh" ['"]user@dummy['"] ('|")hg -R remote serve 
--stdio('|") (re)
+  devel-peer-request: hello
   sending hello command
+  devel-peer-request: between
+  devel-peer-request:   pairs: 81 bytes
   sending between command
   remote: 384
   remote: capabilities: lookup changegroupsubset branchmap pushkey known 
getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 
$USUAL_BUNDLE2_CAPS$ unbundle=HG10GZ,HG10BZ,HG10UN
   remote: 1
   query 1; heads
+  devel-peer-request: batch
+  devel-peer-request:   cmds: 141 bytes
   sending batch command
   searching for changes
   all remote heads known locally
   no changes found
+  devel-peer-request: getbundle
+  devel-peer-request:   bookmarks: 1 bytes
+  devel-peer-request:   bundlecaps: 233 bytes
+  devel-peer-request:   cg: 1 bytes
+  devel-peer-request:   common: 122 bytes
+  devel-peer-request:   heads: 122 bytes
+  devel-peer-request:   listkeys: 9 bytes
+  devel-peer-request:   phases: 1 bytes
   sending getbundle command
   bundle2-input-bundle: with-transaction
   bundle2-input-part: "bookmarks" supported
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 3 of 4] httppeer: add support for tracing all http request made by the peer

2018-01-16 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1515753663 0
#  Fri Jan 12 10:41:03 2018 +
# Node ID 2d1a4bbddd7e4075b0e082cabf84d901f5b92b5b
# Parent  6d0599c2fe114d927f2d37fd5a22e061843c6974
# EXP-Topic exchangedebug
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
2d1a4bbddd7e
httppeer: add support for tracing all http request made by the peer

This changeset introduces a new 'devel.debug.peer-request' config. When set to
True, debug message about request made by peer will be issued. This help to
understand what actually happens during an exchange and tracks source of
performance loss.

This changeset implement support for http peer only.

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -362,6 +362,9 @@ coreconfigitem('devel', 'user.obsmarker'
 coreconfigitem('devel', 'warn-config-unknown',
 default=None,
 )
+coreconfigitem('devel', 'debug.peer-request',
+default=False,
+)
 coreconfigitem('diff', 'nodates',
 default=False,
 )
diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -162,7 +162,38 @@ class httppeer(wireproto.wirepeer):
 getattr(h, "close_all", lambda: None)()
 
 def _openurl(self, req):
-return self._urlopener.open(req)
+if self._ui.configbool('devel', 'debug.peer-request'):
+dbg = self._ui.debug
+line = 'devel-peer-request: %s\n'
+dbg(line % '%s %s' % (req.get_method(), req.get_full_url()))
+hgargssize = None
+
+for header, value in sorted(req.header_items()):
+if header.startswith('X-hgarg-'):
+if hgargssize is None:
+hgargssize = 0
+hgargssize += len(value)
+else:
+dbg(line % '  %s %s' % (header, value))
+
+if hgargssize is not None:
+dbg(line % '  %d bytes of commands arguments in headers'
+% hgargssize)
+
+if req.has_data():
+data = req.get_data()
+length = getattr(data, 'length', None)
+if length is None:
+length = len(data)
+dbg(line % '  %d bytes of data' % length)
+
+start = util.timer()
+
+ret = self._urlopener.open(req)
+if self._ui.configbool('devel', 'debug.peer-request'):
+dbg(line % '  finished in %.4f seconds (%s)'
+% (util.timer() - start, ret.code))
+return ret
 
 # Begin of _basepeer interface.
 
diff --git a/tests/test-http.t b/tests/test-http.t
--- a/tests/test-http.t
+++ b/tests/test-http.t
@@ -248,27 +248,57 @@ test http authentication
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
   $ hg rollback -q
-  $ hg -R dest push http://user:pass@localhost:$HGPORT2/ --debug
+  $ hg -R dest push http://user:pass@localhost:$HGPORT2/ --debug  --config 
devel.debug.peer-request=yes
   pushing to http://user:***@localhost:$HGPORT2/
   using http://localhost:$HGPORT2/
   http auth: user user, password 
   sending capabilities command
+  devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities
+  devel-peer-request:   finished in *. seconds (200) (glob)
   query 1; heads
   sending batch command
+  devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch
+  devel-peer-request:   Vary X-HgArg-1,X-HgProto-1
+  devel-peer-request:   X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
+  devel-peer-request:   68 bytes of commands arguments in headers
+  devel-peer-request:   finished in *. seconds (200) (glob)
   searching for changes
   all remote heads known locally
   preparing listkeys for "phases"
   sending listkeys command
+  devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
+  devel-peer-request:   Vary X-HgArg-1,X-HgProto-1
+  devel-peer-request:   X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
+  devel-peer-request:   16 bytes of commands arguments in headers
   http auth: user user, password 
+  devel-peer-request:   finished in *. seconds (200) (glob)
   received listkey for "phases": 58 bytes
   checking for updated bookmarks
   preparing listkeys for "bookmarks"
   sending listkeys command
+  devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
+  devel-peer-request:   Vary X-HgArg-1,X-HgProto-1
+  devel-peer-request:   X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$
+  devel-peer-request:   19 bytes of commands arguments in headers
+  devel-peer-request:   finished in *. seconds (200) (glob)
   received listkey for "bookmarks": 0 bytes
   sending branchmap command
+  devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap
+  devel-peer-request:   Vary X-HgProto-1
+  devel-peer-request:   X-hgproto-1 0.1 0.2

mercurial@35596: 6 new changesets

2018-01-16 Thread Mercurial Commits
6 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/8f1a7adb3225
changeset:   35591:8f1a7adb3225
user:Yuya Nishihara 
date:Sat Apr 01 17:18:31 2017 +0900
summary: revsetlang: catch invalid format character with %l prefix

https://www.mercurial-scm.org/repo/hg/rev/0fd617afebc0
changeset:   35592:0fd617afebc0
user:Yuya Nishihara 
date:Sat Apr 01 17:25:45 2017 +0900
summary: revsetlang: check number of arguments passed to formatspec()

https://www.mercurial-scm.org/repo/hg/rev/850cd045b1df
changeset:   35593:850cd045b1df
user:Yuya Nishihara 
date:Sat Apr 01 17:28:28 2017 +0900
summary: revsetlang: check incomplete revspec format character

https://www.mercurial-scm.org/repo/hg/rev/468d7a1f6633
changeset:   35594:468d7a1f6633
user:Yuya Nishihara 
date:Sat Apr 01 17:44:07 2017 +0900
summary: revsetlang: catch invalid value passed to formatspec()

https://www.mercurial-scm.org/repo/hg/rev/91201737d07a
changeset:   35595:91201737d07a
user:Yuya Nishihara 
date:Sat Apr 01 17:51:56 2017 +0900
summary: revsetlang: fix quoting of %ls string

https://www.mercurial-scm.org/repo/hg/rev/a57acea31b3b
changeset:   35596:a57acea31b3b
bookmark:@
tag: tip
user:Yuya Nishihara 
date:Tue Jan 02 21:05:40 2018 +0900
summary: revsetlang: unnest inner functions from formatspec()

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


Ideas and mentors for GSoC 2018.

2018-01-16 Thread Pulkit Goyal
Hey everyone,

We are taking part in Google Summer of Code from past two years under
Python Software Foundation and we wish to continue the same this year.

If you have any idea or WIP, which you think can be a good student
project for this summers, please share.

Also, if you have sometime available during the summers and interested
to mentor a student in the program, it will be great. Please let me
know.

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


D1864: repair: drop unnecessary phase cache invalidation

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

REVISION SUMMARY
  After stripping the revlogs, we have been invalidating the phase cache
  since 
https://phab.mercurial-scm.org/rHGbf7b8157c483c3bdb14107099b6db08e94981181. 
Later, in 
https://phab.mercurial-scm.org/rHG8e3021fd1a44e48a4720bb6fa4538fba399ad213, I 
added a call to
  phasecache.filterunknown(). I apparently didn't realize it then, but I
  now think that that call made the existing phasecache.invalidate()
  call unnecessary, so this patch drops it. Both the test added in
  https://phab.mercurial-scm.org/rHGbf7b8157c483c3bdb14107099b6db08e94981181 
and the entire evolve extension test suite indeed still
  pass.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/repair.py

CHANGE DETAILS

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -222,8 +222,6 @@
 if not repo.ui.verbose:
 repo.ui.popbuffer()
 f.close()
-repo._phasecache.invalidate()
-
 
 with repo.transaction('repair') as tr:
 bmchanges = [(m, repo[newbmtarget].node()) for m in updatebm]



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


D1867: evolution: report new unstable changesets

2018-01-16 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  For the effects on the evolve repo, see 
https://bitbucket.org/martinvonz/mutable-history/commits/288b3db249c10bc22158d06cc11bceea94c0dc6a

REPOSITORY
  rHG Mercurial

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

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


D1863: repair: drop unnecessary phase cache invalidation

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

REVISION SUMMARY
  After stripping the revlogs, we have been invalidating the phase cache
  since 
https://phab.mercurial-scm.org/rHGbf7b8157c483c3bdb14107099b6db08e94981181. 
Later, in 
https://phab.mercurial-scm.org/rHG8e3021fd1a44e48a4720bb6fa4538fba399ad213, I 
added a call to
  phasecache.filterunknown(). I apparently didn't realize it then, but I
  now think that that call made the existing phasecache.invalidate()
  call unnecessary, so this patch drops it. Both the test added in
  https://phab.mercurial-scm.org/rHGbf7b8157c483c3bdb14107099b6db08e94981181 
and the entire evolve extension test suite indeed still
  pass.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/repair.py

CHANGE DETAILS

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -222,8 +222,6 @@
 if not repo.ui.verbose:
 repo.ui.popbuffer()
 f.close()
-repo._phasecache.invalidate()
-
 
 with repo.transaction('repair') as tr:
 bmchanges = [(m, repo[newbmtarget].node()) for m in updatebm]



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


D1867: evolution: report new unstable changesets

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


  LGTM on a first quick review

REPOSITORY
  rHG Mercurial

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

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


D1866: transaction: register summary callbacks only at start of transaction (BC)

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

REVISION SUMMARY
  We currently register summary callbacks every time
  localrepo.transaction() is called, so both when the transaction is
  started and when a nested transaction is created. That seems a little
  weirdly asymmetric, because the summary callbacks are thus not
  necessarily registred at the beginning of the outermost transaction,
  but they are only called when the outermost transaction closes (not
  when a nested transaction closes).
  
  I want to add another summary callback that records the repo state at
  the beginning of the transaction and compares to that when the
  transaction closes. However, because of the registration that happens
  when a nested transaction is created, that would need to go through
  extra trouble to not overwrite the callback and report the difference
  from the start time of the innermost transaction to the close of the
  outermost transaction.
  
  Also, the callbacks are registered with a name based on the order they
  are defined in the registersummarycallback(). For example, if both the
  "new changesets %s" and the "obsoleted %i changesets" hooks are
  registered, the first would be called 00-txnreport and the second
  would be called 01-txnreport. That gets really weird if
  registersummarycallback() gets called multiple times, because the last
  one wins, and a depending on which of the two callbacks get
  registered, we might hypothetically even overwrite on type of callback
  with another. For example, if when the outer transaction was started,
  we registered the "new changesets %s" callback first, and when the
  inner transaction was started, we registered only the "obsoleted %i
  changesets" callback, then only the latter message would get
  printed. What makes it hypothetical is that what gets registered
  depends on the transaction name, and the set of transaction names that
  we match on for the former latter message is a subset of the set of
  names we match on for the former. Still, that seems like a bug waiting
  to happen.
  
  That second issue could be solved independently, but the first issue
  seems enough for me to consider it a bug (affecting developers, not
  users), so this patch simply drops that extra registration.
  
  Note that this affects "hg transplant" in a user-visible way. When "hg
  transplant" is asked to transplant from a remote repo so it involves a
  pull, then the outermost transaction name is "transplant" and an inner
  transaction is created for "pull". That inner transaction is what led
  us to sometimes report "new changesets %s" from "hg transplant". After
  this patch, that no longer happens. That seems fine to me. We can make
  it instead print the message for all "hg transplant" invocations if we
  want (not just those involving a remote), but I'll leave that for
  someone else to do if they think it's important.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py
  tests/test-transplant.t

CHANGE DETAILS

diff --git a/tests/test-transplant.t b/tests/test-transplant.t
--- a/tests/test-transplant.t
+++ b/tests/test-transplant.t
@@ -354,7 +354,6 @@
   added 1 changesets with 1 changes to 1 files
   applying a53251cdf717
   a53251cdf717 transplanted to 8d9279348abb
-  new changesets 37a1297eb21b:8d9279348abb
   $ hg log --template '{rev} {parents} {desc}\n'
   2  b3
   1  b1
@@ -560,7 +559,6 @@
   added 2 changesets with 2 changes to 2 files
   applying a53251cdf717
   4:a53251cdf717 merged at 4831f4dc831a
-  new changesets 722f4667af76:4831f4dc831a
 
 test interactive transplant
 
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1134,7 +1134,6 @@
 raise error.ProgrammingError('transaction requires locking')
 tr = self.currenttransaction()
 if tr is not None:
-scmutil.registersummarycallback(self, tr, desc)
 return tr.nest()
 
 # abort here if the journal already exists



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


D1868: evolution: make reporting of new unstable changesets optional

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

REVISION SUMMARY
  This makes it possible to turn off the reporting of unstable
  changesets (e.g. "1 new orphan changesets"), just in case it's too
  slow for some users. Anyone who's been using the evolve extension has
  already been accepting the cost of the reporting, so this is just for
  the few users who have turned on obsmarkers but not been using the
  evolve extension (as I believe Facebook has).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/configitems.py
  mercurial/scmutil.py
  tests/test-obsolete.t

CHANGE DETAILS

diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -340,6 +340,17 @@
 
   $ cd ..
 
+Can disable transaction summary report
+
+  $ hg init transaction-summary
+  $ cd transaction-summary
+  $ mkcommit a
+  $ mkcommit b
+  $ hg up -q null
+  $ hg --config experimental.evolution.report-instabilities=false 
debugobsolete `getid a`
+  obsoleted 1 changesets
+  $ cd ..
+
 Exchange Test
 
 
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1260,7 +1260,8 @@
 repo.ui.status(_('obsoleted %i changesets\n')
% len(obsoleted))
 
-if obsolete.isenabled(repo, obsolete.createmarkersopt):
+if (obsolete.isenabled(repo, obsolete.createmarkersopt) and
+repo.ui.configbool('experimental', 'evolution.report-instabilities')):
 instabilitytypes = [
 ('orphan', 'orphan'),
 ('phase-divergent', 'phasedivergent'),
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -487,6 +487,9 @@
 coreconfigitem('experimental', 'evolution.track-operation',
 default=True,
 )
+coreconfigitem('experimental', 'evolution.report-instabilities',
+default=True,
+)
 coreconfigitem('experimental', 'worddiff',
 default=False,
 )



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


D1074: branch: add a --rev flag to change branch name of given revisions

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


  Apart from my review, it looks good to me.
  
  Also I don't think you have a test when trying to change the branch of 
several changesets on different branches. If not, could you add one?

INLINE COMMENTS

> cmdutil.py:731
> +if repo.revs('merge() and %ld', revs):
> +raise error.Abort(_("cannot change branch of a merge commit"))
> +if repo.revs('obsolete() and %ld', revs):

Might be helpful to precise which changeset is a merge commit.

> cmdutil.py:733
> +if repo.revs('obsolete() and %ld', revs):
> +raise error.Abort(_("cannot change branch of a obsolete 
> changeset"))
> +heads = repo.revs('head() and %ld', revs)

Might be helpful to precise which changeset is am obsolete commit.

> test-branch-change.t:143
> +  $ hg bookmark b1
> +  $ hg glog -r .
> +  @  6:7c1991464886 Added e

You should update the revset to use the same as the next glog call `(.^)::`

REPOSITORY
  rHG Mercurial

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

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


D1865: repair: filter out unknown revisions from phasecache within transaction

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

REVISION SUMMARY
  I'm about to add another summary report callback that needs to access
  phase information. These callbacks run at the end of the transaction
  and some of them failed because they tried to get the phase for
  stripped commits. The solution is to filter out unknown revisions
  before the transaction is closed.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/repair.py

CHANGE DETAILS

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -203,8 +203,8 @@
 
 deleteobsmarkers(repo.obsstore, stripobsidx)
 del repo.obsstore
+repo._phasecache.filterunknown(repo)
 
-repo._phasecache.filterunknown(repo)
 if tmpbundlefile:
 ui.note(_("adding branch\n"))
 f = vfs.open(tmpbundlefile, "rb")



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


D1856: wireproto: support for pullbundles

2018-01-16 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger updated this revision to Diff 4844.
joerg.sonnenberger edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1856?vs=4835&id=4846

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

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/configitems.py
  mercurial/exchange.py
  mercurial/help/config.txt
  mercurial/wireproto.py
  tests/common-pattern.py
  tests/test-acl.t
  tests/test-bookmarks-pushpull.t
  tests/test-debugcommands.t
  tests/test-http-bad-server.t
  tests/test-pull-r.t
  tests/test-ssh-bundle1.t
  tests/test-ssh.t

CHANGE DETAILS

diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -483,7 +483,7 @@
   running .* ".*/dummyssh" ['"]user@dummy['"] ('|")hg -R remote serve 
--stdio('|") (re)
   sending hello command
   sending between command
-  remote: 384
+  remote: 399
   remote: capabilities: lookup changegroupsubset branchmap pushkey known 
getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 
$USUAL_BUNDLE2_CAPS$ unbundle=HG10GZ,HG10BZ,HG10UN
   remote: 1
   query 1; heads
diff --git a/tests/test-ssh-bundle1.t b/tests/test-ssh-bundle1.t
--- a/tests/test-ssh-bundle1.t
+++ b/tests/test-ssh-bundle1.t
@@ -467,7 +467,7 @@
   running .* ".*/dummyssh" ['"]user@dummy['"] ('|")hg -R remote serve 
--stdio('|") (re)
   sending hello command
   sending between command
-  remote: 384
+  remote: 399
   remote: capabilities: lookup changegroupsubset branchmap pushkey known 
getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 
$USUAL_BUNDLE2_CAPS$ unbundle=HG10GZ,HG10BZ,HG10UN
   remote: 1
   preparing listkeys for "bookmarks"
diff --git a/tests/test-pull-r.t b/tests/test-pull-r.t
--- a/tests/test-pull-r.t
+++ b/tests/test-pull-r.t
@@ -144,3 +144,129 @@
   
 
   $ cd ..
+  $ killdaemons.py
+
+Test pullbundle functionality
+
+  $ cd repo
+  $ cat < .hg/hgrc
+  > [server]
+  > pullbundle = True
+  > EOF
+  $ hg bundle --base null -r 0 .hg/0.hg
+  1 changesets found
+  $ hg bundle --base 0 -r 1 .hg/1.hg
+  1 changesets found
+  $ hg bundle --base 1 -r 2 .hg/2.hg
+  1 changesets found
+  $ cat < .hg/pullbundles.manifest
+  > 2.hg heads=effea6de0384e684f44435651cb7bd70b8735bd4 
bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
+  > 1.hg heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a 
bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
+  > 0.hg heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
+  > EOF
+  $ hg serve --debug -p $HGPORT2 --pid-file=../repo.pid > ../repo-server.txt 
2>&1 &
+  $ while ! grep listening ../repo-server.txt > /dev/null; do sleep 1; done
+  $ cat ../repo.pid >> $DAEMON_PIDS
+  $ cd ..
+  $ hg clone -r 0 http://localhost:$HGPORT2/ repo.pullbundle
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  new changesets bbd179dfa0a7
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd repo.pullbundle
+  $ hg pull -r 1
+  pulling from http://localhost:$HGPORT2/
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  new changesets ed1b79f46b9a
+  (run 'hg update' to get a working copy)
+  $ hg pull -r 2
+  pulling from http://localhost:$HGPORT2/
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  new changesets effea6de0384
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ cd ..
+  $ killdaemons.py
+  $ grep 'sending pullbundle ' repo-server.txt
+  sending pullbundle "0.hg"
+  sending pullbundle "1.hg"
+  sending pullbundle "2.hg"
+
+Test pullbundle functionality for incremental pulls
+
+  $ cd repo
+  $ hg serve --debug -p $HGPORT2 --pid-file=../repo.pid > ../repo-server.txt 
2>&1 &
+  $ while ! grep listening ../repo-server.txt > /dev/null; do sleep 1; done
+  $ cat ../repo.pid >> $DAEMON_PIDS
+  $ cd ..
+  $ hg clone http://localhost:$HGPORT2/ repo.pullbundle2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  new changesets bbd179dfa0a7:66e3ba28d0d7
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ killdaemons.py
+  $ grep 'sending pullbundle ' repo-server.txt
+  sending pullbundle "0.hg"
+  sending pullbundle "2.hg"
+  sending pullbundle "1.hg"
+
+Test recovery from misconfigured server sending no new data
+
+  $ cd repo
+  $ cat < .hg/pullbundles.manifest
+

D1849: lfs: remove internal url in test

2018-01-16 Thread quark (Jun Wu)
quark updated this revision to Diff 4845.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1849?vs=4793&id=4845

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

AFFECTED FILES
  hgext/lfs/blobstore.py
  tests/test-lfs-test-server.t

CHANGE DETAILS

diff --git a/tests/test-lfs-test-server.t b/tests/test-lfs-test-server.t
--- a/tests/test-lfs-test-server.t
+++ b/tests/test-lfs-test-server.t
@@ -160,12 +160,12 @@
   $ rm -rf .hg/store/lfs
   $ rm -rf `hg config lfs.usercache`
   $ hg update -C '.^'
-  abort: LFS server claims required objects do not exist:
-  8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13!
+  abort: LFS server error. Remote object for "b" not found:(.*)! (re)
   [255]
 
 Check error message when object does not exist:
 
+  $ cd $TESTTMP
   $ hg init test && cd test
   $ echo "[extensions]" >> .hg/hgrc
   $ echo "lfs=" >> .hg/hgrc
@@ -183,7 +183,22 @@
   x-is-binary 0
   $ cd ..
   $ rm -rf `hg config lfs.usercache`
-  $ hg --config 'lfs.url=https://dewey-lfs.vip.facebook.com/lfs' clone test 
test2
+
+(Restart the server in a different location so it no longer has the content)
+
+  $ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
+  $ rm $DAEMON_PIDS
+  $ mkdir $TESTTMP/lfs-server2
+  $ cd $TESTTMP/lfs-server2
+#if no-windows
+  $ lfs-test-server &> lfs-server.log &
+  $ echo $! >> $DAEMON_PIDS
+#else
+  $ $PYTHON $TESTTMP/spawn.py >> $DAEMON_PIDS
+#endif
+
+  $ cd $TESTTMP
+  $ hg clone test test2
   updating to branch default
   abort: LFS server error. Remote object for "a" not found:(.*)! (re)
   [255]
diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py
--- a/hgext/lfs/blobstore.py
+++ b/hgext/lfs/blobstore.py
@@ -227,20 +227,27 @@
  % rawjson)
 return response
 
-def _checkforservererror(self, pointers, responses):
+def _checkforservererror(self, pointers, responses, action):
 """Scans errors from objects
 
 Returns LfsRemoteError if any objects has an error"""
 for response in responses:
-error = response.get('error')
-if error:
+# The server should return 404 when objects cannot be found. Some
+# server implementation (ex. lfs-test-server)  does not set "error"
+# but just removes "download" from "actions". Treat that case
+# as the same as 404 error.
+notfound = (response.get('error', {}).get('code') == 404
+or (action == 'download'
+and action not in response.get('actions', [])))
+if notfound:
 ptrmap = {p.oid(): p for p in pointers}
 p = ptrmap.get(response['oid'], None)
-if error['code'] == 404 and p:
+if p:
 filename = getattr(p, 'filename', 'unknown')
 raise LfsRemoteError(
 _(('LFS server error. Remote object '
   'for "%s" not found: %r')) % (filename, response))
+if 'error' in response:
 raise LfsRemoteError(_('LFS server error: %r') % response)
 
 def _extractobjects(self, response, pointers, action):
@@ -252,21 +259,11 @@
 """
 # Scan errors from objects - fail early
 objects = response.get('objects', [])
-self._checkforservererror(pointers, objects)
+self._checkforservererror(pointers, objects, action)
 
 # Filter objects with given action. Practically, this skips uploading
 # objects which exist in the server.
 filteredobjects = [o for o in objects if action in o.get('actions', 
[])]
-# But for downloading, we want all objects. Therefore missing objects
-# should be considered an error.
-if action == 'download':
-if len(filteredobjects) < len(objects):
-missing = [o.get('oid', '?')
-   for o in objects
-   if action not in o.get('actions', [])]
-raise LfsRemoteError(
-_('LFS server claims required objects do not exist:\n%s')
-% '\n'.join(missing))
 
 return filteredobjects
 



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


D1849: lfs: remove internal url in test

2018-01-16 Thread quark (Jun Wu)
quark added inline comments.

INLINE COMMENTS

> mharbison72 wrote in blobstore.py:239
> It looks like we still need the ‘if p’ test.

Sorry. I missed the comment. Fixed now.

REPOSITORY
  rHG Mercurial

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

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


D1867: evolution: report new unstable changesets

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

REVISION SUMMARY
  This adds a transaction summary callback that reports the number of
  new orphan, content-divergent and phase-divergent changesets.
  
  The code for reporting it is based on the code from the evolve
  extension, but simplified a bit. It simply counts the numbers for each
  kind of instability before and after the transaction. That's obviously
  not very efficient, but it's easy to reason about, so I'm doing this
  as a first step that can make us quite confident about the test case
  changes. We can optimize it later and make sure that the tests are not
  affected. The code has been used in the evolve extension for a long
  time and has apparently been sufficiently fast, so it doesn't seem
  like a pressing issue.
  
  Unlike the evolve extension's version of this report, this version
  applies to all commands (or all transactions run as part of any
  command, to be exact).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/scmutil.py
  tests/test-amend.t
  tests/test-cache-abuse.t
  tests/test-commit-amend.t
  tests/test-drawdag.t
  tests/test-exchange-obsmarkers-case-A3.t
  tests/test-exchange-obsmarkers-case-A4.t
  tests/test-exchange-obsmarkers-case-B5.t
  tests/test-exchange-obsmarkers-case-C1.t
  tests/test-exchange-obsmarkers-case-C4.t
  tests/test-exchange-obsmarkers-case-D1.t
  tests/test-exchange-obsmarkers-case-D4.t
  tests/test-histedit-obsolete.t
  tests/test-obshistory.t
  tests/test-obsmarker-template.t
  tests/test-obsolete-bundle-strip.t
  tests/test-obsolete-changeset-exchange.t
  tests/test-obsolete-distributed.t
  tests/test-obsolete-divergent.t
  tests/test-obsolete.t
  tests/test-push-checkheads-partial-C2.t
  tests/test-push-checkheads-partial-C4.t
  tests/test-push-checkheads-pruned-B2.t
  tests/test-push-checkheads-pruned-B3.t
  tests/test-push-checkheads-pruned-B4.t
  tests/test-push-checkheads-pruned-B5.t
  tests/test-push-checkheads-pruned-B8.t
  tests/test-push-checkheads-superceed-A2.t
  tests/test-push-checkheads-superceed-A3.t
  tests/test-push-checkheads-superceed-A6.t
  tests/test-push-checkheads-superceed-A7.t
  tests/test-push-checkheads-unpushed-D2.t
  tests/test-push-checkheads-unpushed-D3.t
  tests/test-push-checkheads-unpushed-D4.t
  tests/test-push-checkheads-unpushed-D5.t
  tests/test-push-race.t
  tests/test-rebase-dest.t
  tests/test-rebase-obsolete.t
  tests/test-revset2.t
  tests/test-show-work.t
  tests/test-split.t
  tests/test-strip.t
  tests/test-unamend.t
  tests/test-uncommit.t

CHANGE DETAILS

diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t
--- a/tests/test-uncommit.t
+++ b/tests/test-uncommit.t
@@ -190,6 +190,7 @@
   $ hg bookmark
  foo   9:48e5bd7cd583
   $ hg uncommit
+  3 new orphan changesets
   $ hg status
   M files
   A file-abc
@@ -220,6 +221,7 @@
   $ hg bookmark
  foo   9:48e5bd7cd583
   $ hg uncommit file-ab
+  1 new orphan changesets
   $ hg status
   A file-ab
 
diff --git a/tests/test-unamend.t b/tests/test-unamend.t
--- a/tests/test-unamend.t
+++ b/tests/test-unamend.t
@@ -258,6 +258,7 @@
   2 files updated, 0 files merged, 2 files removed, 0 files unresolved
   $ echo bar >> f
   $ hg amend
+  3 new orphan changesets
   $ hg rebase -s 6 -d . -q
 
   $ hg glog
@@ -285,12 +286,14 @@
   [255]
 
   $ hg unamend
+  3 new orphan changesets
 
 Trying to unamend a public changeset
 
   $ hg up -C 23
   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg phase -r . -p
+  1 new phase-divergent changesets
   $ hg unamend
   abort: cannot unamend public changesets
   (see 'hg help phases' for details)
diff --git a/tests/test-strip.t b/tests/test-strip.t
--- a/tests/test-strip.t
+++ b/tests/test-strip.t
@@ -1285,6 +1285,7 @@
   > EOF
 
   $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
+  4 new orphan changesets
 
   $ rm .hg/localtags
   $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
diff --git a/tests/test-split.t b/tests/test-split.t
--- a/tests/test-split.t
+++ b/tests/test-split.t
@@ -417,6 +417,7 @@
   [255]
 #else
   $ runsplit -r 1 --no-rebase >/dev/null
+  3 new orphan changesets
   $ hg bookmark
  d12:b5c5ea414030
* d23:f4a0a8d004cc
@@ -459,6 +460,7 @@
   > |
   > A
   > EOS
+  2 new orphan changesets
   $ eval `hg tags -T '{tag}={node}\n'`
   $ rm .hg/localtags
   $ hg split $B --config experimental.evolution=createmarkers
diff --git a/tests/test-show-work.t b/tests/test-show-work.t
--- a/tests/test-show-work.t
+++ b/tests/test-show-work.t
@@ -242,6 +242,7 @@
   > EOF
   $ hg debugobsolete `hg log -r 'desc("commit 2")' -T "{node}"`
   obsoleted 1 changesets
+  1 new orphan changesets
   $ hg show work --color=deb

D1856: wireproto: support for pullbundles

2018-01-16 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger updated this revision to Diff 4846.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1856?vs=4844&id=4846

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

AFFECTED FILES
  hgext/clonebundles.py
  mercurial/bundle2.py
  mercurial/commands.py
  mercurial/configitems.py
  mercurial/exchange.py
  mercurial/help/config.txt
  mercurial/wireproto.py
  tests/common-pattern.py
  tests/test-acl.t
  tests/test-bookmarks-pushpull.t
  tests/test-debugcommands.t
  tests/test-help.t
  tests/test-http-bad-server.t
  tests/test-pull-r.t
  tests/test-ssh-bundle1.t
  tests/test-ssh.t

CHANGE DETAILS

diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -483,7 +483,7 @@
   running .* ".*/dummyssh" ['"]user@dummy['"] ('|")hg -R remote serve 
--stdio('|") (re)
   sending hello command
   sending between command
-  remote: 384
+  remote: 399
   remote: capabilities: lookup changegroupsubset branchmap pushkey known 
getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 
$USUAL_BUNDLE2_CAPS$ unbundle=HG10GZ,HG10BZ,HG10UN
   remote: 1
   query 1; heads
diff --git a/tests/test-ssh-bundle1.t b/tests/test-ssh-bundle1.t
--- a/tests/test-ssh-bundle1.t
+++ b/tests/test-ssh-bundle1.t
@@ -467,7 +467,7 @@
   running .* ".*/dummyssh" ['"]user@dummy['"] ('|")hg -R remote serve 
--stdio('|") (re)
   sending hello command
   sending between command
-  remote: 384
+  remote: 399
   remote: capabilities: lookup changegroupsubset branchmap pushkey known 
getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 
$USUAL_BUNDLE2_CAPS$ unbundle=HG10GZ,HG10BZ,HG10UN
   remote: 1
   preparing listkeys for "bookmarks"
diff --git a/tests/test-pull-r.t b/tests/test-pull-r.t
--- a/tests/test-pull-r.t
+++ b/tests/test-pull-r.t
@@ -144,3 +144,129 @@
   
 
   $ cd ..
+  $ killdaemons.py
+
+Test pullbundle functionality
+
+  $ cd repo
+  $ cat < .hg/hgrc
+  > [server]
+  > pullbundle = True
+  > EOF
+  $ hg bundle --base null -r 0 .hg/0.hg
+  1 changesets found
+  $ hg bundle --base 0 -r 1 .hg/1.hg
+  1 changesets found
+  $ hg bundle --base 1 -r 2 .hg/2.hg
+  1 changesets found
+  $ cat < .hg/pullbundles.manifest
+  > 2.hg heads=effea6de0384e684f44435651cb7bd70b8735bd4 
bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
+  > 1.hg heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a 
bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
+  > 0.hg heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
+  > EOF
+  $ hg serve --debug -p $HGPORT2 --pid-file=../repo.pid > ../repo-server.txt 
2>&1 &
+  $ while ! grep listening ../repo-server.txt > /dev/null; do sleep 1; done
+  $ cat ../repo.pid >> $DAEMON_PIDS
+  $ cd ..
+  $ hg clone -r 0 http://localhost:$HGPORT2/ repo.pullbundle
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  new changesets bbd179dfa0a7
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd repo.pullbundle
+  $ hg pull -r 1
+  pulling from http://localhost:$HGPORT2/
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  new changesets ed1b79f46b9a
+  (run 'hg update' to get a working copy)
+  $ hg pull -r 2
+  pulling from http://localhost:$HGPORT2/
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  new changesets effea6de0384
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ cd ..
+  $ killdaemons.py
+  $ grep 'sending pullbundle ' repo-server.txt
+  sending pullbundle "0.hg"
+  sending pullbundle "1.hg"
+  sending pullbundle "2.hg"
+
+Test pullbundle functionality for incremental pulls
+
+  $ cd repo
+  $ hg serve --debug -p $HGPORT2 --pid-file=../repo.pid > ../repo-server.txt 
2>&1 &
+  $ while ! grep listening ../repo-server.txt > /dev/null; do sleep 1; done
+  $ cat ../repo.pid >> $DAEMON_PIDS
+  $ cd ..
+  $ hg clone http://localhost:$HGPORT2/ repo.pullbundle2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  new changesets bbd179dfa0a7:66e3ba28d0d7
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ killdaemons.py
+  $ grep 'sending pullbundle ' repo-server.txt
+  sending pullbundle "0.hg"
+  sending pullbundle "2.hg"
+  sending pullbundle "1.hg"
+
+Test recovery from misconfigured server sending no new data
+
+  $ cd repo
+  $ cat < .hg/pullbundle

D1568: lfs: using workers in lfs prefetch

2018-01-16 Thread wlis (Wojciech Lis)
wlis added a comment.


  I finally got around to testing this properly and I can reproduce the issue. 
I looked into the code a bit and it is possible that we create keepalive 
connections before forking and we are illegally multiplexing same connection.
  The quick fix on our side is to not use workers on upload action, and it 
fixes the issue right away. Proper fix would be to fix the https handler, but 
it doesn't look like an easy one. I don't think I'll get to that any time soon.
  
  I'll try to submit a patch to only use workers for download to mitigate the 
issue.

REPOSITORY
  rHG Mercurial

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

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


[PATCH 1 of 2] cat: factor out a function that populates the formatter

2018-01-16 Thread Matt Harbison
# HG changeset patch
# User Matt Harbison 
# Date 1516150560 18000
#  Tue Jan 16 19:56:00 2018 -0500
# Node ID ac8052ec552b36d4bee5bc24bc92fcee36d843cb
# Parent  821d8a5ab4ff890a7732c2e4cdcc7f32191e5942
cat: factor out a function that populates the formatter

This will allow extensions to add data to the templater.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2962,6 +2962,18 @@
 
 return ret
 
+def _updatecatformatter(fm, ctx, matcher, path, decode):
+"""Hook for adding data to the formatter used by ``hg cat``.
+
+Extensions (e.g., lfs) can wrap this to inject keywords/data, but must call
+this method first."""
+data = ctx[path].data()
+if decode:
+data = ctx.repo().wwritedata(path, data)
+fm.startitem()
+fm.write('data', '%s', data)
+fm.data(abspath=path, path=matcher.rel(path))
+
 def cat(ui, repo, ctx, matcher, basefm, fntemplate, prefix, **opts):
 err = 1
 opts = pycompat.byteskwargs(opts)
@@ -2977,12 +2989,7 @@
 except OSError:
 pass
 with formatter.maybereopen(basefm, filename, opts) as fm:
-data = ctx[path].data()
-if opts.get('decode'):
-data = repo.wwritedata(path, data)
-fm.startitem()
-fm.write('data', '%s', data)
-fm.data(abspath=path, path=matcher.rel(path))
+_updatecatformatter(fm, ctx, matcher, path, opts.get('decode'))
 
 # Automation often uses hg cat on single files, so special case it
 # for performance to avoid the cost of parsing the manifest.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 2] lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`

2018-01-16 Thread Matt Harbison
# HG changeset patch
# User Matt Harbison 
# Date 1516151707 18000
#  Tue Jan 16 20:15:07 2018 -0500
# Node ID 2c12a42e20df3499a72194cd0f2911573ab82dc7
# Parent  ac8052ec552b36d4bee5bc24bc92fcee36d843cb
lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`

The only other interface to this data is `hg debugdata`, which requires
knowledge of the filelog revision that corresponds to the changeset.  Since the
data is uninterpreted, this is an important debugging capability, and needs to
be simpler to use than that.

For non-LFS files, this displays the regular data.

Alternately, we could forego the messy function extraction in the last patch if
this template keyword can just be added unconditionally.

diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py
--- a/hgext/lfs/__init__.py
+++ b/hgext/lfs/__init__.py
@@ -52,6 +52,7 @@
 from mercurial import (
 bundle2,
 changegroup,
+cmdutil,
 context,
 exchange,
 extensions,
@@ -169,6 +170,7 @@
 
 wrapfunction = extensions.wrapfunction
 
+wrapfunction(cmdutil, '_updatecatformatter', wrapper._updatecatformatter)
 wrapfunction(scmutil, 'wrapconvertsink', wrapper.convertsink)
 
 wrapfunction(upgrade, '_finishdatamigration',
diff --git a/hgext/lfs/wrapper.py b/hgext/lfs/wrapper.py
--- a/hgext/lfs/wrapper.py
+++ b/hgext/lfs/wrapper.py
@@ -179,6 +179,10 @@
 def filectxislfs(self):
 return _islfs(self.filelog(), self.filenode())
 
+def _updatecatformatter(orig, fm, ctx, matcher, path, decode):
+orig(fm, ctx, matcher, path, decode)
+fm.data(rawdata=ctx[path].rawdata())
+
 def convertsink(orig, sink):
 sink = orig(sink)
 if sink.repotype == 'hg':
diff --git a/tests/test-lfs.t b/tests/test-lfs.t
--- a/tests/test-lfs.t
+++ b/tests/test-lfs.t
@@ -842,7 +842,7 @@
   0 meta
   $ grep 'lfs' convert_normal/.hg/requires
   [1]
-  $ hg --cwd convert_normal debugdata a1 0
+  $ hg --cwd convert_normal cat a1 -r 0 -T '{rawdata}'
   THIS-IS-LFS-BECAUSE-10-BYTES
 
   $ hg --config extensions.convert= --config lfs.threshold=10B \
@@ -854,6 +854,12 @@
   2 a
   1 b
   0 meta
+
+  $ hg --cwd convert_lfs cat -r 0 a1 -T '{rawdata}'
+  version https://git-lfs.github.com/spec/v1
+  oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
+  size 29
+  x-is-binary 0
   $ hg --cwd convert_lfs debugdata a1 0
   version https://git-lfs.github.com/spec/v1
   oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2] lfs: migrate most file filtering from threshold to custom filter

2018-01-16 Thread Matt Harbison
On Tue, 16 Jan 2018 08:20:32 -0500, Boris Feld   
wrote:



On Tue, 2018-01-16 at 08:05 -0500, Matt Harbison wrote:

On Jan 16, 2018, at 5:26 AM, Boris Feld 
wrote:

> I checked the precursors revset and the behavior is not the one
> expected, thank you for pointing that.
>
>
> I also realized that the revset is in Evolve and not in Core, which
> makes it a good opportunity to upstream it.
>
> I'm not sure if we should keep only the equivalent of
> allprecursors(),
> what about having a predecessor() and allpredecessors() revsets.
>
> predecessors() would returns the closests locally known
> predecessors,
> like the {predecessors} template keyword while allpredecessors()
> would
> returns all the locally known predecessors.
>
> What do you think?

I think a dedicated revset to find the first generation, for lack of
a better word, of predecessors is useful.  I use it all the time to
ensure rebase/evolve conflict resolution didn’t drop anything, though
it only works if it wasn’t split or folded.


I think the term we used is closest predecessor, at least we have a
function named closestpredecessors in obsutil.py.


There was a proposal for short handing something like this, so maybe
a dedicated predicate won’t be needed in the future.  But it would be
nice if the template and revset agreed, and I don’t see an “all”
template as being as useful as the current one.


http://mercurial.markmail.org/thread/sjnnwa43s4eksu62



I was not aware of this proposal. I think a dedicated predicate would
be usefull too to have more verbose and more readable templates.

When you are speaking about an "all" tempalte, do you means that you
don't think an "allpredecessors" template would be usefull in core?


I meant "allpredecessors", yes.

I'm not against adding it, I just can't immediately think of a use for a  
list that could encompass splits -> folds -> resplits -> etc.  I'm fine  
with Yuya's idea of a limit parameter, though that's more typing so a  
shortcut would be nice.  I tend to spell out templates/args/etc in scripts  
for clarity, but that's a tiny fraction of my usage.

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


D1849: lfs: remove internal url in test

2018-01-16 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  LGTM, thanks.
  
  Any thoughts on what we should do if 'p' does come up None?  It's a clear 
server error (sending back an oid we didn't ask for).

REPOSITORY
  rHG Mercurial

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

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


D1568: lfs: using workers in lfs prefetch

2018-01-16 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  Thanks @wlis .  That makes sense, and aligns with what I saw (a couple of 
downloads worked with workers, though I still wasn't sure if that was safe or I 
was getting lucky).  If you don't get the chance to follow up, I've got a patch 
that puts lfs workers behind an experimental knob.  But there's no reason to 
disable for downloads if you're thinking that isn't buggy.

REPOSITORY
  rHG Mercurial

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

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


[Bug 5773] New: evolve extension should specify progress units

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

Bug ID: 5773
   Summary: evolve extension should specify progress units
   Product: Mercurial
   Version: stable branch
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: evolution
  Assignee: bugzi...@mercurial-scm.org
  Reporter: a...@dwimlabs.net
CC: mercurial-devel@mercurial-scm.org,
pierre-yves.da...@ens-lyon.org

You can tweak progress bar format using progress.format config option, which is
"topic bar number estimate" by default. If you add "speed", then progress bar
shows speed in units per second. For example, "1234 changesets/sec".

However, at least obsmarker discovery in evolve doesn't provide unit in
ui.progress() calls, so speed is reported as "1234 /sec", which doesn't look
great.

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


Re: Ideas and mentors for GSoC 2018.

2018-01-16 Thread Gregory Szorc
On Tue, Jan 16, 2018 at 11:31 AM, Pulkit Goyal <7895pul...@gmail.com> wrote:

> Hey everyone,
>
> We are taking part in Google Summer of Code from past two years under
> Python Software Foundation and we wish to continue the same this year.
>
> If you have any idea or WIP, which you think can be a good student
> project for this summers, please share.
>
> Also, if you have sometime available during the summers and interested
> to mentor a student in the program, it will be great. Please let me
> know.
>

Anything Rust would likely attract some attention :)

Whether we'll be in a good position to offer a Rust-based project by then,
I'm not sure. I hope so...
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 2 V2] lfs: control tracked file selection via a tracked file

2018-01-16 Thread Matt Harbison
# HG changeset patch
# User Matt Harbison 
# Date 1515971571 18000
#  Sun Jan 14 18:12:51 2018 -0500
# Node ID 074417bc25368171950f0e8e292b151f9641b5a0
# Parent  03d737594660bb74823317e02a6ad2e91456c12d
lfs: control tracked file selection via a tracked file

Since the lfs tracking policy can dramatically affect the repository, it makes
more sense to have the policy file checked in, than to rely on all developers
configuring their .hgrc properly.  The inspiration for this is the .hgeol file.
The configuration lives under '[track]', so that other things can be added in
the future.  Eventually, the config option should be limited to `convert` only.

If the file can't be parsed for any reason (including unrecognized elements of
the minifileset language), the commit will abort until the problem is corrected.
This seems more useful than the warning that hgeol emits, and has no effect on
reading the data, so there's no compatibility concerns.

My initial thought was to read the file and change each "key = value" line into
"((key) & (value))", so that each line could be ORed together, and make a single
pass at compiling.  Unfortunately, that prevents exclusions if there's a
catchall rule.  Consider what happens to a large *.c file here:

  [track]
  **.c = none()
  ** = size('>1MB')
  # ((**.c) & (none())) | ((**) & (size('>1MB'))) => anything > 1MB

I also thought about having separate [include] and [exclude] sections.  But that
just seems to open things up to user mistakes.  Consider:

  [include]
  **.zip = all()
  **.php = size('>10MB')

  [exclude]
  **.zip = all()  # Who wins?
  **.php = none() # Effectively 'all()' (i.e. nothing excluded), or >10MB ?

Therefore, it just compiles each key and value separately, and walks until the
key matches something.  I'm not sure how to enforce just file patterns on LHS
without leaking knowledge about the minifileset here.  That means this will
allow odd looking lines like this:

  [track]
  **.c | **.txt = none()

But that's also fewer lines to compile, so slightly more efficient?  Some things
like 'none()' won't work as expected on LHS though, because that won't match, so
that line is skipped.  For now, these quirks are not mentioned in the
documentation.

Jun previously expressed concern about efficiency when scaling to large repos,
so I tried avoiding 'repo[None]'.  (localrepo.commit() gets repo[None] already,
but doesn't tie it to the workingcommitctx used here.)  Therefore, I looked at
the passed context for 'AMR' status.  But that doesn't help with the normal case
where the policy file is tracked, but clean.  That requires looking up p1() to
read the file.  I don't see any way to get the content of one file without first
creating the full parent context.

diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py
--- a/hgext/lfs/__init__.py
+++ b/hgext/lfs/__init__.py
@@ -7,6 +7,30 @@
 
 """lfs - large file support (EXPERIMENTAL)
 
+The extension reads its configuration from a versioned ``.hglfs``
+configuration file found in the root of the working directory. The
+``.hglfs`` file uses the same syntax as all other Mercurial
+configuration files. It uses a single section, ``[track]``.
+
+The ``[track]`` section specifies which files are stored as LFS (or
+not). Each line is keyed by a file pattern, with a predicate value.
+The first file pattern match is used, so put more specific patterns
+first.  The available predicates are ``all()``, ``none()``, and
+``size()``. See "hg help filesets.size" for the latter.
+
+Example versioned ``.hglfs`` file::
+
+  [track]
+  # No Makefile or python file, anywhere, will be LFS
+  **Makefile = none()
+  **.py = none()
+
+  **.zip = all()
+  **.exe = size(">1MB")
+
+  # Catchall for everything not matched above
+  ** = size(">10MB")
+
 Configs::
 
 [lfs]
@@ -35,6 +59,9 @@
 # - (**.php & size(">2MB")) | (**.js & size(">5MB")) | **.tar.gz
 # | ("path:bin" & !"path:/bin/README") | size(">1GB")
 # (default: none())
+#
+# This is ignored if there is a tracked '.hglfs' file, and this setting
+# will eventually be deprecated and removed.
 track = size(">10M")
 
 # how many times to retry before giving up on transferring an object
@@ -52,7 +79,9 @@
 from mercurial import (
 bundle2,
 changegroup,
+config,
 context,
+error,
 exchange,
 extensions,
 filelog,
@@ -123,13 +152,20 @@
 if not repo.local():
 return
 
-repo.svfs.options['lfstrack'] = _trackedmatcher(repo)
 repo.svfs.lfslocalblobstore = blobstore.local(repo)
 repo.svfs.lfsremoteblobstore = blobstore.remote(repo)
 
 # Push hook
 repo.prepushoutgoinghooks.add('lfs', wrapper.prepush)
 
+class lfsrepo(repo.__class__):
+@localrepo.unfilteredmethod
+def commitctx(self, ctx, error=False):
+repo.svfs.options['lfstrack'] = _trackedmatcher(self, ctx)
+return super(lfsrepo, self).commitctx(ctx, error)
+
+repo.__class__ = lfsrepo
+
 if 

[PATCH 1 of 2 V2] lfs: move the tracked file function creation to a method

2018-01-16 Thread Matt Harbison
# HG changeset patch
# User Matt Harbison 
# Date 1515909885 18000
#  Sun Jan 14 01:04:45 2018 -0500
# Node ID 03d737594660bb74823317e02a6ad2e91456c12d
# Parent  821d8a5ab4ff890a7732c2e4cdcc7f32191e5942
lfs: move the tracked file function creation to a method

Once a commitable file format for tracked config is agreed upon, I can't see any
reason to have a config based way to control this.  (Other than convert.  That
will be necessary to override the file when converting to normal files.  Also,
converting to lfs needs this if not splicing the file in at the beginning.  So
maybe the existing config option should be `convert` specific.)  Looking to
hgeol for precedent, it looks like policy that affects how items are stored are
handled only by the tracked file, while policy that affects the checkout can be
handled by either a user config or the tracked file (but the latter takes
precedence).

We probably need a transition period, so this transition policy can be
controlled by the function.  Additionally, it provides a place for convert to
wrap to override the file based config.

diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py
--- a/hgext/lfs/__init__.py
+++ b/hgext/lfs/__init__.py
@@ -123,15 +123,7 @@
 if not repo.local():
 return
 
-trackspec = repo.ui.config('lfs', 'track')
-
-# deprecated config: lfs.threshold
-threshold = repo.ui.configbytes('lfs', 'threshold')
-if threshold:
-fileset.parse(trackspec)  # make sure syntax errors are confined
-trackspec = "(%s) | size('>%d')" % (trackspec, threshold)
-
-repo.svfs.options['lfstrack'] = minifileset.compile(trackspec)
+repo.svfs.options['lfstrack'] = _trackedmatcher(repo)
 repo.svfs.lfslocalblobstore = blobstore.local(repo)
 repo.svfs.lfsremoteblobstore = blobstore.remote(repo)
 
@@ -157,6 +149,19 @@
 ui.setconfig('hooks', 'commit.lfs', checkrequireslfs, 'lfs')
 ui.setconfig('hooks', 'pretxnchangegroup.lfs', checkrequireslfs, 'lfs')
 
+def _trackedmatcher(repo):
+"""Return a function (path, size) -> bool indicating whether or not to
+track a given file with lfs."""
+trackspec = repo.ui.config('lfs', 'track')
+
+# deprecated config: lfs.threshold
+threshold = repo.ui.configbytes('lfs', 'threshold')
+if threshold:
+fileset.parse(trackspec)  # make sure syntax errors are confined
+trackspec = "(%s) | size('>%d')" % (trackspec, threshold)
+
+return minifileset.compile(trackspec)
+
 def wrapfilelog(filelog):
 wrapfunction = extensions.wrapfunction
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@35615: 19 new changesets

2018-01-16 Thread Mercurial Commits
19 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/ed0902e8053e
changeset:   35597:ed0902e8053e
user:Yuya Nishihara 
date:Tue Jan 02 18:35:11 2018 +0900
summary: revsetlang: add %p specifier to format list of function arguments

https://www.mercurial-scm.org/repo/hg/rev/29248ea26b29
changeset:   35598:29248ea26b29
user:Paul Morelle 
date:Wed Jan 10 17:24:25 2018 +0100
summary: upgraderepo: select correct deltareuse depending on actions

https://www.mercurial-scm.org/repo/hg/rev/af25237be091
changeset:   35599:af25237be091
user:Boris Feld 
date:Sun Dec 17 04:31:27 2017 +0100
summary: perf: add threading capability to perfbdiff

https://www.mercurial-scm.org/repo/hg/rev/31acf6619f08
changeset:   35600:31acf6619f08
user:Gregory Szorc 
date:Wed Jan 10 19:04:52 2018 -0800
summary: run-tests: fix regular expression for path test

https://www.mercurial-scm.org/repo/hg/rev/98b87b8307e0
changeset:   35601:98b87b8307e0
user:Gregory Szorc 
date:Wed Jan 10 19:08:51 2018 -0800
summary: rust: move Cargo.lock

https://www.mercurial-scm.org/repo/hg/rev/998b585f156c
changeset:   35602:998b585f156c
user:Jun Wu 
date:Wed Jan 10 21:09:57 2018 -0800
summary: perf: do not import util.queue

https://www.mercurial-scm.org/repo/hg/rev/11c86ab69e67
changeset:   35603:11c86ab69e67
user:Gregory Szorc 
date:Wed Jan 10 19:23:36 2018 -0800
summary: rust: move import of PathBuf

https://www.mercurial-scm.org/repo/hg/rev/74bec9e74831
changeset:   35604:74bec9e74831
user:Gregory Szorc 
date:Wed Jan 10 19:36:45 2018 -0800
summary: rust: add TODO about lifetime of program_name variable

https://www.mercurial-scm.org/repo/hg/rev/45a816361926
changeset:   35605:45a816361926
user:Anton Shestakov 
date:Thu Jan 11 18:20:08 2018 +0800
summary: hgweb: drop support of browsers that don't understand  (BC)

https://www.mercurial-scm.org/repo/hg/rev/4b68ca118d8d
changeset:   35606:4b68ca118d8d
user:Boris Feld 
date:Thu Jan 11 11:57:59 2018 +
summary: pull: hold wlock for the full operation when --update is used

https://www.mercurial-scm.org/repo/hg/rev/24b5106e3e1e
changeset:   35607:24b5106e3e1e
user:Gregory Szorc 
date:Wed Jan 10 19:24:58 2018 -0800
summary: rust: avoid redundant 'static lifetime

https://www.mercurial-scm.org/repo/hg/rev/fe4e1352c035
changeset:   35608:fe4e1352c035
user:Boris Feld 
date:Fri Jan 12 11:09:04 2018 +
summary: visibility: fix a comment introduced before which is not up-to-date

https://www.mercurial-scm.org/repo/hg/rev/c026547454dd
changeset:   35609:c026547454dd
user:Boris Feld 
date:Fri Jan 12 11:10:18 2018 +
summary: visibility: make the filtered message translatable

https://www.mercurial-scm.org/repo/hg/rev/22c42bfbe7ab
changeset:   35610:22c42bfbe7ab
user:Boris Feld 
date:Fri Jan 12 11:15:41 2018 +
summary: visibility: pass a normal repo to _getfilteredreason

https://www.mercurial-scm.org/repo/hg/rev/7336ac5e786e
changeset:   35611:7336ac5e786e
user:Pulkit Goyal <7895pul...@gmail.com>
date:Fri Jan 05 22:28:06 2018 +0530
summary: bookmarks: add bookmarks to hidden revs if directaccess config is 
set

https://www.mercurial-scm.org/repo/hg/rev/edf52be98978
changeset:   35612:edf52be98978
user:Joerg Sonnenberger 
date:Fri Jan 12 17:10:55 2018 +0100
summary: test-pull-r: explicitly kill server processes

https://www.mercurial-scm.org/repo/hg/rev/991f0be9dc39
changeset:   35613:991f0be9dc39
user:Pulkit Goyal <7895pul...@gmail.com>
date:Fri Jan 12 18:11:05 2018 +0530
summary: py3: use bytes instead of pycompat.bytestr

https://www.mercurial-scm.org/repo/hg/rev/6d6d20658cce
changeset:   35614:6d6d20658cce
user:Matt Harbison 
date:Fri Jan 12 23:13:38 2018 -0500
summary: lfs: drop deprecated remote store config options

https://www.mercurial-scm.org/repo/hg/rev/0e369eca888f
changeset:   35615:0e369eca888f
bookmark:@
tag: tip
user:Matt Harbison 
date:Wed Jan 10 22:35:08 2018 -0500
summary: fileset: split the logic for matching a size expression to a 
separate method

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


D1856: wireproto: support for pullbundles

2018-01-16 Thread indygreg (Gregory Szorc)
indygreg requested changes to this revision.
indygreg added a comment.
This revision now requires changes to proceed.


  This is looking **much** better!
  
  There are some places where the code doesn't abide by our (IMO lousy) 
mergeallthewords naming convention.
  
  More importantly, I think there are some bugs around hidden changesets. We 
definitely need some test coverage involving hidden changesets. We should also 
have some basic tests for phases and bookmarks transfer. We want to be sure 
that all that data makes it across the wire and mirrors the remote's state. 
Specifically, I //think// there are still some bundle2 parts we only emit over 
the wire and not as part of local bundles generated via `hg bundle`. If so, 
then a pull serviced completely by pullbundles may not transfer all metadata. 
I'm not 100% sure about this. That's what tests will uncover. One thing we 
could do is ensure the client always sends a non-partial `getbundle` request to 
ensure the Mercurial server itself sends over any non-changegroup data. That 
shouldn't be necessary. And it complicates the wire protocol to communicate if 
the reply came from a pre-generated bundle. I'm not a huge fan of this... 
mostly thinking aloud here.
  
  Something else to think about (which is an outstanding problem with clone 
bundles) is generating the manifests. It is very much an exercise left to the 
reader. That kinda sucks. At some point we need to make `hg bundle` emit 
manifest lines or something. And the //bundlespec// format needs to be taught 
about individual bundle2 parts. We're still missing a way to define which 
parts/data to put in the generated bundle via `hg bundle` invocation (e.g. 
should we include obsolescence or phases parts) and how to express the presence 
of these parts in the //bundlespec//. I think we can implement this feature 
without solving those problems. But if `hg bundle` is producing bundles with 
required part processing, we won't be. (I'm not sure what `hg bundle` is doing 
these days.)
  
  Writing backwards and future compatible data storage and exchange protocols 
is hard...

INLINE COMMENTS

> clonebundles.py:61
> +4. If there is at least one matching bundle, the server sends it to the 
> client.
> +5. The client applies and bundle and notices that the server reply was
> +   incomplete. It initiates another pull.

Nit: "the" instead of "and"

> exchange.py:1383-1385
> +new_heads = headsofdiff(unficl.heads(), old_heads)
> +pullop.common = headsofunion(new_heads, pullop.common)
> +pullop.rheads = set(pullop.rheads) - pullop.common

I think there are some subtle bugs here around the use of unfiltered heads 
creeping into the wire protocol because `old_heads` can contained hidden 
changesets. The intent behind this code seems sound. But I think it needs to 
respect node visibility more strictly.

> wireproto.py:856
> +res = exchange.parseclonebundlesmanifest(repo, manifest)
> +res = exchange.filterclonebundleentries(repo, res)
> +if not res:

This filtering takes the current process's capabilities into consideration. 
Since this code runs on the server, it is filtering based on the server's 
abilities, not the client's. That's bad because it means the server can send a 
bundle that the client can't read.

There will need to be a bit of code written to pass the client's capabilities 
into this filtering. That will likely require a significant amount of plumbing 
in `exchange.py`.

It /might/ be easier to take a different approach completely: choosing the same 
architecture as clonebundles and having the client download the manifest and 
fetching the relevant bundles itself. If you squint hard enough, this seems 
possible. The hard part is discovery. The server could potentially order the 
bundles based on DAG relationship / define dependencies between bundles based 
on DAG relationship. I //think// you've thought about this design already. But 
just want to check.

> test-pull-r.t:149
> +
> +Test pullbundle functionality
> +

I'd separate this into its own test file, since it is highly domain specific.

> test-pull-r.t:167-168
> +  > EOF
> +  $ hg serve --debug -p $HGPORT2 --pid-file=../repo.pid > ../repo-server.txt 
> 2>&1 &
> +  $ while ! grep listening ../repo-server.txt > /dev/null; do sleep 1; done
> +  $ cat ../repo.pid >> $DAEMON_PIDS

I don't think I've seen this pattern in our .t tests before. I think you want 
to use `hg serve -d --accesslog  --errorlog ` like other tests do. 
There are no race conditions in daemon mode AFAIK, otherwise many tests would 
fall into this trap.

> test-pull-r.t:266
> +  added 0 changesets with 0 changes to 1 files
> +  abort: 00changelog.i@ed1b79f46b9a: no node!
> +  [255]

That's a pretty bad error message for something the user has no control over (a 
misconfigured server).

First, the error message should be better. Something like "the server didn't 
send expected data."

Second, the error message s