Patchwork [3,of,3,v4] revset: use localrepo revbranchcache for branch name filtering

login
register
mail settings
Submitter Matt Harbison
Date Jan. 10, 2015, 3:26 a.m.
Message ID <op.xr785xks9lwrgf@envy>
Download mbox | patch
Permalink /patch/7413/
State Accepted
Commit 678f53865c6860a950392691814766957ee89316
Headers show

Comments

Matt Harbison - Jan. 10, 2015, 3:26 a.m.
On Fri, 09 Jan 2015 11:04:00 -0500, Mads Kiilerich <mads@kiilerich.com>  
wrote:

> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1420671663 -3600
> #      Thu Jan 08 00:01:03 2015 +0100
> # Node ID 596acd20068b01d7f2ad2d6f6cd8f5963183ce80
> # Parent  1885dd81dd140a9c56b94dd3af811cc040d07a54
> revset: use localrepo revbranchcache for branch name filtering

I get this failure on Windows:

  with the cache invalidation scheme used by branchmap
    $ hg log -r tip+b -T'{rev}:{node|short} {branch}\n'
@@ -578,7 +578,7 @@
    $ hg debugrevspec 'branch("hacked")'
    13
    $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
-  22424d7e106c894336d9d705b0241bc5  .hg/cache/rbc-revs-v1
+  79accc678dbad7cf2c1e5d1c1dde87fb  .hg/cache/rbc-revs-v1
  cleanup, restore old state
    $ hg --config extensions.strip= strip --no-b -qr -2:
    $ hg pull -q bu.hg
@@ -591,7 +591,7 @@
    $ hg debugrevspec 'branch("re:a ")'
    7
    $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
-  d8c2acdc229bf942fde1dfdbe8f9d933  .hg/cache/rbc-revs-v1
+  17a0f0688018932c5c63e14ce7919b59  .hg/cache/rbc-revs-v1
    $ cat .hg/cache/rbc-names-v1
    default\x00a\x00b\x00c\x00a branch name much longer than the default  
justification used by branches\x00hacked (no-eol) (esc)


It looks like all of the file opens in cb99bacb9b4e, as well as md5sum.py  
are binary, so I'm not sure what the issue is.

--Matt
Adrian Buehlmann - Jan. 10, 2015, 8:19 a.m.
On 2015-01-10 04:26, Matt Harbison wrote:
> On Fri, 09 Jan 2015 11:04:00 -0500, Mads Kiilerich <mads@kiilerich.com>  
> wrote:
> 
>> # HG changeset patch
>> # User Mads Kiilerich <madski@unity3d.com>
>> # Date 1420671663 -3600
>> #      Thu Jan 08 00:01:03 2015 +0100
>> # Node ID 596acd20068b01d7f2ad2d6f6cd8f5963183ce80
>> # Parent  1885dd81dd140a9c56b94dd3af811cc040d07a54
>> revset: use localrepo revbranchcache for branch name filtering
> 
> I get this failure on Windows:
> 
> --- c:/Users/Matt/Projects/hg/tests/test-branches.t
> +++ c:/Users/Matt/Projects/hg/tests/test-branches.t.err
> @@ -545,20 +545,20 @@
>   lazy update after commit
>     $ hg tag tag
>     $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
> -  d0c0166808ee0a1f0e8894915ad363b6  .hg/cache/rbc-revs-v1
> +  d476c97818f64ee150cb0aa40d5dbfbe  .hg/cache/rbc-revs-v1
>     $ hg debugrevspec 'branch("re:a ")'
>     7
>     $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
> -  d0c0166808ee0a1f0e8894915ad363b6  .hg/cache/rbc-revs-v1
> +  d476c97818f64ee150cb0aa40d5dbfbe  .hg/cache/rbc-revs-v1
>   update after rollback - cache keeps stripped revs until written for other  
> reasons
>     $ hg up -qr '.^'
>     $ hg rollback -qf
>     $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
> -  d8c2acdc229bf942fde1dfdbe8f9d933  .hg/cache/rbc-revs-v1
> +  3f073173f0a19049c768f52bc8d272d7  .hg/cache/rbc-revs-v1
>     $ hg debugrevspec 'branch("re:a ")'
>     7
>     $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
> -  d8c2acdc229bf942fde1dfdbe8f9d933  .hg/cache/rbc-revs-v1
> +  3f073173f0a19049c768f52bc8d272d7  .hg/cache/rbc-revs-v1
>   handle history mutations that doesn't change the tip node - this is a  
> problem
>   with the cache invalidation scheme used by branchmap
>     $ hg log -r tip+b -T'{rev}:{node|short} {branch}\n'
> @@ -578,7 +578,7 @@
>     $ hg debugrevspec 'branch("hacked")'
>     13
>     $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
> -  22424d7e106c894336d9d705b0241bc5  .hg/cache/rbc-revs-v1
> +  79accc678dbad7cf2c1e5d1c1dde87fb  .hg/cache/rbc-revs-v1
>   cleanup, restore old state
>     $ hg --config extensions.strip= strip --no-b -qr -2:
>     $ hg pull -q bu.hg
> @@ -591,7 +591,7 @@
>     $ hg debugrevspec 'branch("re:a ")'
>     7
>     $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
> -  d8c2acdc229bf942fde1dfdbe8f9d933  .hg/cache/rbc-revs-v1
> +  17a0f0688018932c5c63e14ce7919b59  .hg/cache/rbc-revs-v1
>     $ cat .hg/cache/rbc-names-v1
>     default\x00a\x00b\x00c\x00a branch name much longer than the default  
> justification used by branches\x00hacked (no-eol) (esc)
> 
> 
> It looks like all of the file opens in cb99bacb9b4e, as well as md5sum.py  
> are binary, so I'm not sure what the issue is.
> 
> --Matt

I'm currently not motivated to have a deep look myself, but this reminds
me of http://selenic.com/repo/hg/rev/48c232873a54

(pattern of calling tell() right after open())

I at least would suggest to check this.
Mads Kiilerich - Jan. 10, 2015, 12:42 p.m.
On 01/10/2015 09:19 AM, Adrian Buehlmann wrote:
> On 2015-01-10 04:26, Matt Harbison wrote:
>> On Fri, 09 Jan 2015 11:04:00 -0500, Mads Kiilerich <mads@kiilerich.com>
>> wrote:
>>
>>> # HG changeset patch
>>> # User Mads Kiilerich <madski@unity3d.com>
>>> # Date 1420671663 -3600
>>> #      Thu Jan 08 00:01:03 2015 +0100
>>> # Node ID 596acd20068b01d7f2ad2d6f6cd8f5963183ce80
>>> # Parent  1885dd81dd140a9c56b94dd3af811cc040d07a54
>>> revset: use localrepo revbranchcache for branch name filtering
>> I get this failure on Windows:
> I'm currently not motivated to have a deep look myself, but this reminds
> me of http://selenic.com/repo/hg/rev/48c232873a54
>
> (pattern of calling tell() right after open())
>
> I at least would suggest to check this.


Thanks - that seems like the problem. Matt, can you confirm that adding 
a seek to end solves the problem?

/Mads
Matt Harbison - Jan. 10, 2015, 5:16 p.m.
On Sat, 10 Jan 2015 07:42:25 -0500, Mads Kiilerich <mads@kiilerich.com>  
wrote:

> On 01/10/2015 09:19 AM, Adrian Buehlmann wrote:
>> On 2015-01-10 04:26, Matt Harbison wrote:
>>> On Fri, 09 Jan 2015 11:04:00 -0500, Mads Kiilerich <mads@kiilerich.com>
>>> wrote:
>>>
>>>> # HG changeset patch
>>>> # User Mads Kiilerich <madski@unity3d.com>
>>>> # Date 1420671663 -3600
>>>> #      Thu Jan 08 00:01:03 2015 +0100
>>>> # Node ID 596acd20068b01d7f2ad2d6f6cd8f5963183ce80
>>>> # Parent  1885dd81dd140a9c56b94dd3af811cc040d07a54
>>>> revset: use localrepo revbranchcache for branch name filtering
>>> I get this failure on Windows:
>> I'm currently not motivated to have a deep look myself, but this reminds
>> me of http://selenic.com/repo/hg/rev/48c232873a54
>>
>> (pattern of calling tell() right after open())
>>
>> I at least would suggest to check this.
>
>
> Thanks - that seems like the problem. Matt, can you confirm that adding  
> a seek to end solves the problem?
>
> /Mads

Thanks, that did the trick.  I submitted a patch for it.

Maybe vfs.open() should automatically seek to the end if opened in append  
mode?  This seems like a fairly easy to miss implementation detail,  
especially since Linux apparently does what everyone assumes is the  
correct thing.  Not sure if it is a good idea this close to the code  
freeze though.

--Matt
Augie Fackler - Jan. 12, 2015, 10:15 p.m.
On Sat, Jan 10, 2015 at 12:16:27PM -0500, Matt Harbison wrote:
> On Sat, 10 Jan 2015 07:42:25 -0500, Mads Kiilerich <mads@kiilerich.com>
> wrote:
>
> >On 01/10/2015 09:19 AM, Adrian Buehlmann wrote:
> >>On 2015-01-10 04:26, Matt Harbison wrote:
> >>>On Fri, 09 Jan 2015 11:04:00 -0500, Mads Kiilerich <mads@kiilerich.com>
> >>>wrote:
> >>>
> >>>># HG changeset patch
> >>>># User Mads Kiilerich <madski@unity3d.com>
> >>>># Date 1420671663 -3600
> >>>>#      Thu Jan 08 00:01:03 2015 +0100
> >>>># Node ID 596acd20068b01d7f2ad2d6f6cd8f5963183ce80
> >>>># Parent  1885dd81dd140a9c56b94dd3af811cc040d07a54
> >>>>revset: use localrepo revbranchcache for branch name filtering
> >>>I get this failure on Windows:
> >>I'm currently not motivated to have a deep look myself, but this reminds
> >>me of http://selenic.com/repo/hg/rev/48c232873a54
> >>
> >>(pattern of calling tell() right after open())
> >>
> >>I at least would suggest to check this.
> >
> >
> >Thanks - that seems like the problem. Matt, can you confirm that adding a
> >seek to end solves the problem?
> >
> >/Mads
>
> Thanks, that did the trick.  I submitted a patch for it.
>
> Maybe vfs.open() should automatically seek to the end if opened in append
> mode?  This seems like a fairly easy to miss implementation detail,
> especially since Linux apparently does what everyone assumes is the correct
> thing.

Agreed. I'd love to see a patch for that, but probably at the start of
the next cycle rather than now.

> Not sure if it is a good idea this close to the code freeze though.
>
> --Matt
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

--- c:/Users/Matt/Projects/hg/tests/test-branches.t
+++ c:/Users/Matt/Projects/hg/tests/test-branches.t.err
@@ -545,20 +545,20 @@ 
  lazy update after commit
    $ hg tag tag
    $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
-  d0c0166808ee0a1f0e8894915ad363b6  .hg/cache/rbc-revs-v1
+  d476c97818f64ee150cb0aa40d5dbfbe  .hg/cache/rbc-revs-v1
    $ hg debugrevspec 'branch("re:a ")'
    7
    $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
-  d0c0166808ee0a1f0e8894915ad363b6  .hg/cache/rbc-revs-v1
+  d476c97818f64ee150cb0aa40d5dbfbe  .hg/cache/rbc-revs-v1
  update after rollback - cache keeps stripped revs until written for other  
reasons
    $ hg up -qr '.^'
    $ hg rollback -qf
    $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
-  d8c2acdc229bf942fde1dfdbe8f9d933  .hg/cache/rbc-revs-v1
+  3f073173f0a19049c768f52bc8d272d7  .hg/cache/rbc-revs-v1
    $ hg debugrevspec 'branch("re:a ")'
    7
    $ "$TESTDIR/md5sum.py" .hg/cache/rbc-revs-v1
-  d8c2acdc229bf942fde1dfdbe8f9d933  .hg/cache/rbc-revs-v1
+  3f073173f0a19049c768f52bc8d272d7  .hg/cache/rbc-revs-v1
  handle history mutations that doesn't change the tip node - this is a  
problem