Patchwork [2,of,8] test-flagprocessor: use changegroup3 in bundle2

login
register
mail settings
Submitter Jun Wu
Date April 7, 2017, 2:08 a.m.
Message ID <f9c75f4ee30e0102d8fb.1491530890@x1c>
Download mbox | patch
Permalink /patch/19985/
State Accepted
Headers show

Comments

Jun Wu - April 7, 2017, 2:08 a.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1491524600 25200
#      Thu Apr 06 17:23:20 2017 -0700
# Node ID f9c75f4ee30e0102d8fb5a65eaee988e7ca30139
# Parent  3d62d68ed4245359b5ae5b6b6c1959a15ffa84e9
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r f9c75f4ee30e
test-flagprocessor: use changegroup3 in bundle2

This will force "hg bundle" to use changegroup3 in the test. It is
important since only changegroup3 preserves revlog flags.
Yuya Nishihara - April 7, 2017, 1:51 p.m.
On Thu, 6 Apr 2017 19:08:10 -0700, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark@fb.com>
> # Date 1491524600 25200
> #      Thu Apr 06 17:23:20 2017 -0700
> # Node ID f9c75f4ee30e0102d8fb5a65eaee988e7ca30139
> # Parent  3d62d68ed4245359b5ae5b6b6c1959a15ffa84e9
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r f9c75f4ee30e
> test-flagprocessor: use changegroup3 in bundle2
> 
> This will force "hg bundle" to use changegroup3 in the test. It is
> important since only changegroup3 preserves revlog flags.
> 
> diff --git a/tests/flagprocessorext.py b/tests/flagprocessorext.py
> --- a/tests/flagprocessorext.py
> +++ b/tests/flagprocessorext.py
> @@ -8,4 +8,5 @@ import zlib
>  from mercurial import (
>      changegroup,
> +    exchange,
>      extensions,
>      filelog,
> @@ -104,4 +105,8 @@ def extsetup(ui):
>      revlog.REVIDX_FLAGS_ORDER.extend(flags)
>  
> +    # Teach exchange to use changegroup 3
> +    for k in exchange._bundlespeccgversions.keys():
> +        exchange._bundlespeccgversions[k] = '03'

Is this a temporary hack until cg3 bundle is officially supported?
Jun Wu - April 7, 2017, 2:05 p.m.
Excerpts from Yuya Nishihara's message of 2017-04-07 22:51:38 +0900:
> On Thu, 6 Apr 2017 19:08:10 -0700, Jun Wu wrote:
> > # HG changeset patch
> > # User Jun Wu <quark@fb.com>
> > # Date 1491524600 25200
> > #      Thu Apr 06 17:23:20 2017 -0700
> > # Node ID f9c75f4ee30e0102d8fb5a65eaee988e7ca30139
> > # Parent  3d62d68ed4245359b5ae5b6b6c1959a15ffa84e9
> > # Available At https://bitbucket.org/quark-zju/hg-draft 
> > #              hg pull https://bitbucket.org/quark-zju/hg-draft  -r f9c75f4ee30e
> > test-flagprocessor: use changegroup3 in bundle2
> > 
> > This will force "hg bundle" to use changegroup3 in the test. It is
> > important since only changegroup3 preserves revlog flags.
> > 
> > diff --git a/tests/flagprocessorext.py b/tests/flagprocessorext.py
> > --- a/tests/flagprocessorext.py
> > +++ b/tests/flagprocessorext.py
> > @@ -8,4 +8,5 @@ import zlib
> >  from mercurial import (
> >      changegroup,
> > +    exchange,
> >      extensions,
> >      filelog,
> > @@ -104,4 +105,8 @@ def extsetup(ui):
> >      revlog.REVIDX_FLAGS_ORDER.extend(flags)
> >  
> > +    # Teach exchange to use changegroup 3
> > +    for k in exchange._bundlespeccgversions.keys():
> > +        exchange._bundlespeccgversions[k] = '03'
> 
> Is this a temporary hack until cg3 bundle is officially supported?

Yes. The treemanifest part may be non-trivial.

Patch

diff --git a/tests/flagprocessorext.py b/tests/flagprocessorext.py
--- a/tests/flagprocessorext.py
+++ b/tests/flagprocessorext.py
@@ -8,4 +8,5 @@  import zlib
 from mercurial import (
     changegroup,
+    exchange,
     extensions,
     filelog,
@@ -104,4 +105,8 @@  def extsetup(ui):
     revlog.REVIDX_FLAGS_ORDER.extend(flags)
 
+    # Teach exchange to use changegroup 3
+    for k in exchange._bundlespeccgversions.keys():
+        exchange._bundlespeccgversions[k] = '03'
+
     # Add wrappers for addrevision, responsible to set flags depending on the
     # revision data contents.