Extra revisions in a branch

Matthieu Moy Matthieu.Moy at imag.fr
Thu Nov 17 08:47:15 GMT 2005


Martin Pool <mbp at sourcefrog.net> writes:

> On 16 Nov 2005, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
>> Matthieu Moy wrote:
>> > diff -r branch:XXX
>> > 
>> > Also fetches the revisions.
>> 
>> Yes.  Since this discussion started off with the assertion that we
>> should stop supporting branch:XXX, I thought it would be circular logic
>> to use that example.
>
> diff inserts history into the local branch?

It does. In revisionspec.py:

class RevisionSpec_branch(RevisionSpec):

[...]

    def _match_on(self, branch, revs):
        from branch import Branch
        from fetch import greedy_fetch
        other_branch = Branch.open_containing(self.spec)[0]
        revision_b = other_branch.last_revision()
        if revision_b is None:
            raise NoCommits(other_branch)
        # pull in the remote revisions so we can diff
        greedy_fetch(branch, other_branch, revision=revision_b)

And you can see it if you just

$ mkdir newproj
$ cd newproj
$ bzr init
$ bzr diff -r branch:../path/to/other/branch > /dev/null
$ du -sh

> I think keeping the data after an aborted merge or uncommit is
> reasonable, but I'm surprised that diff would do this. 

In 90%+ of the cases, it makes sense. If you diff with a revision, it
means you're interested in this revision, and you'll probably merge it
one day, or you may run diff again soon.

I'm just worried about the 10%- other cases ...

-- 
Matthieu




More information about the bazaar mailing list