How to display bundle contents ?
Matt Mackall
mpm at selenic.com
Wed Sep 10 19:14:59 UTC 2008
On Wed, 2008-09-10 at 20:36 +0200, Vladimir Marek wrote:
> > >> hg init empty-repo
> > >> cd empty-repo
> > >> hg incoming -p bundle.hg | less
> > >
> > > Does not seem to be working for me.
> > >
> > > $ hg log
> > > $ /store/rcs/hg-incoming/hg incoming -p ../b95b1f74b308-backup
> > > comparing with ../b95b1f74b308-backup
> > > abort: 00changelog.i at 8eeaa62e6be6: unknown parent!
> >
> > Yep, you need the proper parent.
> >
> > You could hack some stuff in bundlerepo.py to display what you want
> > (it's going to be partial).
>
> I'll rather submit bug report, as IMO this limits bundle usage as a
> backup (for example after strip).
>
> something like "unbundle -p" would be nice if the bundle itself contains
> enough informations to produce diff.
It doesn't. It's a highly compressed format that assumes a starting
context is available.
Let's imagine a bundle containing one change to one file. That's going
to contain:
- a binary changeset description delta
- a binary manifest delta
- a binary file delta
Because we've only got a changeset delta, we need its parent to
reconstruct the changeset. If, for example, the parent had a very
similar file list, author, and description, there might be very little
data in the delta at all.
If we look at the file delta, we've got a similar problem. If we don't
have the delta's base, we've simply got a list of chunks of data of the
form 'replace bytes x to y with "foo"'. In patch terms, we have no
context. Worse, the deleted bits aren't even transmitted.
Now we could probably make a tool to extract the following from a
bundle:
- changeset id and parent for each changeset
- file names for each associated file delta
And we could even dump the "foo" bits from the deltas, though that'd be
extremely confusing and of pretty limited used.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list