Full files in changesets?

John A Meinel john at arbash-meinel.com
Mon May 23 18:31:03 BST 2005


Aaron Bentley wrote:
> Hi Martin,
> 
> I'm looking at implementing this, but I want to make sure I understand
> your intent properly.  How hard should we try to to be patch-compatible?
> 
> I'm thinking, in particular, about renames.  We could represent them as
> a non-patch change, but 'patch' would ignore it, and produce the wrong
> output.  Or we could include a patch to delete the file under its
> original name and recreate it under a new name.  This would play nice
> with 'patch', but make it hard to see the changes that were actually
> made to the file.

I think we could probably have an option, but default to having a rename
show up as a rename, and have the 'renames:' section be incompatible
with patch so that applying it with patch fails.

I would also do the same thing for delete.

I think a regular add is okay to show up as a whole bunch of lines. Do
we want to be aware of "resurrection" where a file was deleted and then
re-added with exactly the same contents. This may not be worth anything,
but it does give a more accurate portrayal of the changes.

> 
> There's no way of escaping the fact that we need to be able to produce
> 'patch'-incompatible changesets, e.g. for binaries.  So it might make
> sense to introduce a patch 'syntax error' into patch-incompatible
> changesets.  (and change the wording to 'you can apply this patch with
> "bzr receive", but NOT "patch"')

As mentioned, I like the idea.

Also, for binary changes, are you thinking to base-64 encode them?

John
=:->

> 
> Aaron
> 
> Martin Pool wrote:
> 
>>>## bzr annotated diff
>>>## you can apply this patch with "bzr receive" or "patch"
>>>##
>>>## revision-id: mbp at foo-2005010101055555-sajhdakjsdhkjahsdkja
>>>## predecessor: john at bar-kasjdlkajsdlkjaskld-asdjhasdkjhasdhahd
>>>## comments:
>>>##   Here is my nice patch.
>>>## date: 2005-04-01 12:34:23
>>>## ....
>>>##
>>>## modified file
>>>## file-id: hello.c-21983710231232-123123123189239789
>>>## previous-sha1: 8098a09s8098a09809a8098098098
>>>## sha1: 9218309182039102381093720372137
>>>## directory: 2178389071238972139712978323
>>>## path: src/hello.c
>>>## ...
>>>+++ src/hello.c
>>>--- src/hello.c
>>>0,0 at 1,1
>>> int main()
>>> {
>>>+   hello();
>>> }
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050523/94951685/attachment.pgp 


More information about the bazaar mailing list