[PATCH 4 of 4 RFC stream clone bundles] commands.unbundle: support consuming streaming clone bundles
Augie Fackler
raf at durin42.com
Thu Oct 15 12:01:44 CDT 2015
On Wed, Oct 14, 2015 at 03:34:03PM -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1444861540 25200
> # Wed Oct 14 15:25:40 2015 -0700
> # Node ID c927f2b34d0a420d074152464e854901c746527a
> # Parent e577b42c94d917eb3fbbe866bf66e455a251bb1b
> commands.unbundle: support consuming streaming clone bundles
Series looks mostly reasonable to me. I do wonder if it'd be equally
good to have a streamgroup part in a bundle2 container, but it's
probably not worth the overhead.
>
> Now that we can produce streaming clone bundles `hg bundle`, it makes
> sense to support consuming them with `hg unbundle` too.
>
> We don't need to perform any sanity checking in the command because the
> application code in clonebundles.py does this. So the integration here
> is pretty simple.
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -6530,8 +6530,11 @@ def unbundle(ui, repo, fname1, *fnames,
> tr.release()
> changes = [r.get('return', 0)
> for r in op.records['changegroup']]
> modheads = changegroup.combineresults(changes)
> + elif isinstance(gen, streamclone.unbundler):
> + gen.apply(repo)
> + modheads = len(repo.heads())
> else:
> modheads = changegroup.addchangegroup(repo, gen, 'unbundle',
> 'bundle:' + fname)
> finally:
> diff --git a/tests/test-bundle.t b/tests/test-bundle.t
> --- a/tests/test-bundle.t
> +++ b/tests/test-bundle.t
> @@ -277,8 +277,22 @@ packed1 is produced properly
> 0010: 00 00 00 00 0a 30 00 09 72 65 76 6c 6f 67 76 31 |.....0..revlogv1|
> 0020: 00 64 61 74 61 2f 61 64 69 66 66 65 72 65 6e 74 |.data/adifferent|
> 0030: 66 69 6c 65 2e 69 00 31 33 39 0a 00 01 00 01 00 |file.i.139......|
>
> +We can unpack packed1 bundles
> +
> + $ hg init packed
> + $ hg -R packed unbundle packed.hg
> + 6 files to transfer, 2.55 KB of data
> + transferred 2.55 KB in *.* seconds (*/sec) (glob)
> + (run 'hg heads' to see heads, 'hg merge' to merge)
> +
> +We can't unpack packed1 bundles on non-empty repos
> +
> + $ hg -R packed unbundle packed.hg
> + abort: cannot apply stream clone bundle on non-empty repo
> + [255]
> +
> Create partial clones
>
> $ rm -r empty
> $ hg init empty
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list