Bug? how to obtain diff between current file content and some revision?
John A Meinel
john at arbash-meinel.com
Sun Nov 27 14:51:35 GMT 2005
Alexander Belchenko wrote:
> Is this exist simple way to obtain diff between current file content
> (not last revision) and some past revision?
>
> When I do `bzr diff FILENAME` I get diff between last revision and
> current state.
>
> When I do `bzr diff -rN.. FILENAME` I get diff between specified
> revision and NULL, i.e. with state when this file was not exist. Is this
> intended behaviour?
Well, you can do just:
bzr diff -rN FILENAME
And it will do the diff against the working tree, versus the specified
revision.
It is a little undefined what you are looking for when you don't specify
a revision to a ranged diff.
For "bzr log", since we know you want a range of revisions, we (used to)
assume that an empty opening meant from the beginning, and an empty
ending meant to the end. (I say used to, because it seems in the latest
code, it causes an exception to be raised).
In my head, an open ended range like you've specified could either mean
diff against the last revision, or diff against the working tree. I
agree that it doesn't make a lot of sense for it to be the NULL
revision. Though "bzr diff" does take "-r0" to indicate the null
revision, and you can always reverse a diff, so you can do "bzr diff
-r50..0".
What would you like to see it do? Because you are specifying -r, my
feeling is it should assume an empty entry is the last committed revision.
John
=:->
>
> Here example:
>
> E:\work\Python\bzr\test\diff>bzr init
> E:\work\Python\bzr\test\diff>bzr add
> added spam.txt
>
> E:\work\Python\bzr\test\diff>bzr ci -m "test"
>
> <hack hack>
>
> E:\work\Python\bzr\test\diff>bzr diff
> === modified file 'spam.txt'
> --- spam.txt
> +++ spam.txt
> @@ -1,2 +1,3 @@
> +-----
> 12345
> 67890
>
> E:\work\Python\bzr\test\diff>bzr diff -r1..
> === removed file 'spam.txt'
> --- spam.txt
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -12345
> -67890
>
>
> -------------------------------------------------
>
> Alexander
>
>
-------------- 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/20051127/a62b7037/attachment.pgp
More information about the bazaar
mailing list