Look into a bundle file

John Mulligan phlogistonjohn at asynchrono.us
Sat Mar 22 14:03:49 CDT 2008


On Friday 21 March 2008, Alpár Jüttner wrote:
> Hi,
>
> I tried this:
>
>         $ hg init empty
>         $ cd empty
>         $ hg in ../random_seeding.bundle
>         comparing with ../random_seeding.bundle
>         abort: unknown parent 70f3967ca6eb!
>         $ hg pull -r 70f3967ca6eb ../main
>         ...
>         $ hg in ../random_seeding.bundle
>         comparing with ../random_seeding.bundle
>         searching for changes
>         changeset:   102:81563e019fa4
>         tag:         tip
>         user:        Balazs Dezso <xyz at xyz>
>         date:        Thu Mar 20 17:15:35 2008 +0100
>         summary:     Seeding random sequence
>
> This is quite tedious, but it is at least something. However, I also
> tried it to a bundle file having more than one parents (actually, for a
> merge commit),and I got this:
>
>         $ hg init empty
>         $ cd empty
>         $ hg in ../merge.hg
>         comparing with ../merge.hg
>         abort: unknown parent cdbba181b786!
>         $ hg pull -r cdbba181b786 ../main
>         pulling from ../main
>         requesting all changes
>         adding changesets
>         adding manifests
>         adding file changes
>         added 104 changesets with 235 changes to 86 files
>         (run 'hg update' to get a working copy)
>         $ hg in ../merge.hg
>         comparing with ../merge.hg
>         abort: unknown parent cdbba181b786!
>
> What to do then? Is it a bug?

Normally, the bundle repositories skip over changesets that are already a part 
of the base repository and never records what was part of the bundle 
(AFAICT). Since I had been looking at the bundle repository module lately I 
thought this would be an interesting problem to tackle. I created a very 
hacky extension that will list the contents of the bundle regardless of its 
status as part of the base repo.

I've attached the extension to this message. I've not tested it on a repo with 
a changeset with two parents so please let me know if that breaks it for you.

Load the extension as usual, and from your main repository run: 
  hg bundlecontents /path/to/bundle.hg

I don't plan on trying to get any of the changes I made merged, so please 
excuse the hackery. :-)

>
> Best regards,
> Alpar
>
> On Fri, 2008-03-21 at 20:31 +0000, Alpár Jüttner wrote:
> > Dear All,
> >
> > Could you tell me how to look into a bundle file?
> > I know this:
> >
> > hg in bundle.hg
> >
> > but what to do if the changesets are already in my repo?
> >
> > For example, someone send me a bundle file in an e-mail, and a couple of
> > months later I would like find out which changeset we are discussing in
> > that e-mail thread.
> >
> > Is there an easy way to extract at least the changeset ids from a bundle
> > file?
> >
> > Best regards,
> > Alpar
> >
> >
> > _______________________________________________
> > Mercurial mailing list
> > Mercurial at selenic.com
> > http://selenic.com/mailman/listinfo/mercurial
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial


-------------- next part --------------
A non-text attachment was scrubbed...
Name: bundlecontents.py
Type: application/x-python
Size: 3069 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial/attachments/20080322/d52428fd/attachment.bin 


More information about the Mercurial mailing list