[PATCH 5 of 9 V3] perf: add `parent-1` as possible source for perfrevlogwrite

2018-11-06 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1541427302 -3600
#  Mon Nov 05 15:15:02 2018 +0100
# Node ID 934e67cf46a673a89aac27a846977c808b23e071
# Parent  e7f2594431ac5fba43ae345b345d3aab1a4ab47c
# EXP-Topic revlog-perf
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
934e67cf46a6
perf: add `parent-1` as possible source for perfrevlogwrite

This source will use a diff against p1 in all case.

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -1580,6 +1580,7 @@ def perfrevlogwrite(ui, repo, file_=None
 
 Possible source value are:
 * `full`: add from a full text (default).
+* `parent-1`: add from a delta to the first parent
 """
 opts = _byteskwargs(opts)
 
@@ -1591,7 +1592,7 @@ def perfrevlogwrite(ui, repo, file_=None
 stoprev = rllen + stoprev
 
 source = opts['source']
-validsource = (b'full',)
+validsource = (b'full', b'parent-1')
 if source not in validsource:
 raise error.Abort('invalid source type: %s' % source)
 
@@ -1693,6 +1694,9 @@ def _getrevisionseed(orig, rev, tr, sour
 
 if source == b'full':
 text = orig.revision(rev)
+elif source == b'parent-1':
+baserev = orig.rev(p1)
+cachedelta = (baserev, orig.revdiff(p1, rev))
 
 return ((text, tr, linkrev, p1, p2),
 {'node': node, 'flags':flags, 'cachedelta': cachedelta})
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: parent -1

2016-12-03 Thread Pierre-Yves David



On 12/02/2016 09:22 PM, Uwe Brauer wrote:


   > On 11/29/2016 11:29 PM, Uwe Brauer wrote:

   > The warning here means that for some reason some Mercurial internal
   > state got "corrupt" and was recording a current "checked out" revision
   > now unknown to Mercurial.

This is most likely the reason for this behaviour the local repo has
been copied via rsync to a USB stick and then to another machine. Rsync
is not foolproof (at least I had several data loss issues with it).


   >  For some reason, this is not a fatal error
   > when reading the repository (since operation not touching the working
   > copy works fine), however this is apparently still just a warning for
   > operation like commit. In that case, the working copy parent fallback
   > to nullid.

   > It seems like we should turn the warning into a hard failure in the
   > case of a commit (or similar operation), can you fill a bug about this
   > on http://bz.mercurial-scm.org/.

I am not sure what you are suggesting. Do you mean that in the case of
data corruption, mercurial should *refuse* the commit?

That looks reasonable to me, but I want to be sure.


Yes, in that case, the "warning" should be an abort.

Cheers,

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


Re: parent -1

2016-12-02 Thread Uwe Brauer

   > On 11/29/2016 11:29 PM, Uwe Brauer wrote:

   > The warning here means that for some reason some Mercurial internal
   > state got "corrupt" and was recording a current "checked out" revision
   > now unknown to Mercurial.

This is most likely the reason for this behaviour the local repo has
been copied via rsync to a USB stick and then to another machine. Rsync
is not foolproof (at least I had several data loss issues with it).


   >  For some reason, this is not a fatal error
   > when reading the repository (since operation not touching the working
   > copy works fine), however this is apparently still just a warning for
   > operation like commit. In that case, the working copy parent fallback
   > to nullid.

   > It seems like we should turn the warning into a hard failure in the
   > case of a commit (or similar operation), can you fill a bug about this
   > on http://bz.mercurial-scm.org/.

I am not sure what you are suggesting. Do you mean that in the case of
data corruption, mercurial should *refuse* the commit?

That looks reasonable to me, but I want to be sure.

Thanks

Uwe 

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


Re: parent -1

2016-12-02 Thread Pierre-Yves David



On 11/29/2016 11:29 PM, Uwe Brauer wrote:

Hi

A collaborator of mine, after pulling from the common repo wanted to
commit and obtained:

hg commit -m "Msg"

warning: ignoring unknown working parent fb3007ebc0d2!
created new head


The warning here means that for some reason some Mercurial internal 
state got "corrupt" and was recording a current "checked out" revision 
now unknown to Mercurial. For some reason, this is not a fatal error 
when reading the repository (since operation not touching the working 
copy works fine), however this is apparently still just a warning for 
operation like commit. In that case, the working copy parent fallback to 
nullid.


It seems like we should turn the warning into a hard failure in the case 
of a commit (or similar operation), can you fill a bug about this  on 
http://bz.mercurial-scm.org/.


thanks,

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


parent -1

2016-11-29 Thread Uwe Brauer
Hi

A collaborator of mine, after pulling from the common repo wanted to
commit and obtained:

hg commit -m "Msg"

warning: ignoring unknown working parent fb3007ebc0d2!
created new head

hg log -g

Gives

changeset:   66:1406bbd18e67
tag:     tip
parent:  -1:
user:John Foo <j...@foo.com>
date:Tue Nov 29 21:35:40 2016 +0200
summary: Msg

I told him to move out the modified files, to strip, to pull again and
then try to commit again.

Anybody has an explanation?
What does
parent:  -1:

Mean?

Uwe Brauer 

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