How to get the diff between two arbitrary remote revisions?

John Arbash Meinel john at arbash-meinel.com
Sat Nov 5 06:06:34 GMT 2005


Jan Hudec wrote:
> On Fri, Nov 04, 2005 at 09:58:17 +0100, Matthieu Moy wrote:
>> Hi,
>>
>> I can't find a way to get the diff between two arbitrary revisions if
>> they are remote.
>>
>> I've tried
>>
>>   bzr diff -r branch:$HOME/path/to/branch/,revno=2..branch:$HOME/path/to/branch/,revno=5
>>
>> (I remember a discussion about using ,revno=N but I don't remember
>> what the final decision was)

There was no final decisions. At one point we used to specify
	bzr merge ../a/@10

But that mode was decided against.
It was discussed that you could use URL "params" to specify it. Which is
either a semi-colon or comma, followed by arguments. Though when I just
read the sftp spec, it seemed to be a semicolon, with arguments
separated by commas.
For example:

	http://host/path/to/something.html;param1=1,param2=2
Is legal, where you are passing 2 parameters , but this was not:
	http://host/path/to/something.html,param1=1,param2=2

I might be misinterpreting the spec.

>>
>> but the ,revno= part seems to be simply ignored.

It was never implemented, only discussed.

>>
>> There should IMO be a way to designate a particular revision in
>> revision specs. The syntax I tried above makes sense to me.
>>
>>   bzr diff --branch $HOME/path/to/branch/ -r 2..5

This would tend to say "give me the diff of the revisions in branch
$HOME/path/to/branch (naming one 2 and one 5".
This would not do the diff of the local tree against the other tree.

>>
>> would also make sense, but it doesn't handle the case
>>
>>   bzr diff -r branch:/path/to/a/branch/,revno=1..branch:/path/to/another/branch/,revno=1
> 
> Personally I think that it would make even more sense to allow this:
> 
> bzr diff /path/to/a/branch/,revno=1 /path/to/another/branch/,revno=1

The problem is in general, diff says "diff these files against the last
committed revision". So passing multiple locations is just saying,
compare multiple files versus the last committed revision.

So "bzr diff *.py" gives you the differences in all of your python files
in the current working directory. Which is more what we want to support,
than having 2 arguments mean diff A vs B.

> 
> I would be nice to have this generally - anything that accepts -r could
> accept ,revno addition to the location argument.


I'm hesitant to support putting commas in paths, because people who come
from arch are *very* likely to have files which start with commas.
I'm more likely to change how the "branch:" namespace works.
Right now you can do:

bzr diff -r branch:/path/to/a
And it will give you the difference of the working tree versus the last
commit in the other tree. Or you can do:

bzr diff -r branch:/path/to/a..-1
Which says diff the last commit versus the other branch's last commit.

I think it might make sense to have some way to specify a revision in
the other branch, but we'll have to think about it.

I'll try and make sure that it gets brought up while a few of us are
together at UBZ.

John
=:->


> 
> --
> 						 Jan 'Bulb' Hudec <bulb at ucw.cz>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051105/7e8273a1/attachment.pgp 


More information about the bazaar mailing list