pull/init from bzr merge directive

Bastian B bastian.dev at googlemail.com
Wed Oct 31 11:23:28 UTC 2012


Hey Brian,

thank you for your time. It works! I was confused by the "empty" repo
and thought that was the one containing the revisions. The workflow
you described is not very intuitive (for me) but works. It's kinda
strange to use an empty SUBMIT_BRANCH (/tmp/empty in your example). I
was expecting to be able to use -r 0.. or so.

Here a more verbose version of your workflow.

# sample repo with revisions
cd /tmp
bzr init realbranch
cd realbranch
echo foo > foo
bzr add
bzr ci -m "bla"
# create a bundle
bzr init /tmp/empty
bzr send --no-patch -o /tmp/backup.bundle /tmp/empty

# restore from bundle
bzr init /tmp/copybranch
cd /tmp/copybranch
bzr pull /tmp/backup.bundle

Thank you again

Bastian

On Wed, Oct 31, 2012 at 12:06 PM, Brian de Alwis <briandealwis at gmail.com> wrote:
> Bastian,
>
> Look again — that recipe stores all the revisions in that single file.
>  It does exactly what you're looking for!
>
> The file produced by "bzr send" is called a merge directive. The term
> "bundle" refers to some kind of metadata within the merge directive.
>
> The first "bzr init" is to create an empty branch as the comparator —
> "bzr send" uses that branch to determine which revisions should be
> considered as already known / available to the receiver. By using an
> empty branch, we ensure that "bzr send" includes all the revisions of
> the branch.
>
> Brian.
>
> On 2012-10-31, at 6:51 AM, Bastian B <bastian.dev at gmail.com> wrote:
>
>> Hi Brian,
>>
>> I don't want to create a merge directive. I want to store a whole
>> repository (or at least a whole branch) with all its revisions in a
>> single file. I also want to be able to restore the complete repo (or
>> at least the branch) from that file.
>>
>> I thought I could use a merge directive with all revisions (-r 0..)
>> but that doesn't seem to work.
>>
>> Any other ideas?
>>
>> Bastian
>>
>> On Tue, Oct 30, 2012 at 8:13 PM, Brian de Alwis <briandealwis at gmail.com> wrote:
>>> To create the merge directive:
>>>
>>> # bzr send requires a submit branch to provide info on what is known on the other side
>>> # i.e., to decide what commits need to be in the merge directive.  We want everything,
>>> # so we specify an empty branch.  Is there no location-alias for an empty branch?
>>> $ bzr init /tmp/empty
>>> $ bzr send --no-patch -o /tmp/backup.bundle /tmp/empty
>>>
>>> To restore the merge directive:
>>> $ cd new/root
>>> $ bzr init
>>> $ bzr pull /tmp/backup.bundle
>>>
>>> Brian.



More information about the bazaar mailing list