computing the resulting inventory from the merge changeset
Robert Collins
robertc at robertcollins.net
Thu Dec 15 08:17:28 GMT 2005
On Tue, 2005-12-13 at 23:09 +0100, duchier at ps.uni-sb.de wrote:
>
>
>
>
> differences
> between files
> attachment
> (merge.patch),
> "patch for
> computing the
> inventory from
> the merge
> changeset"
What is this used for ? I mean, I see where its used in the code, but
whats the win ?
Some feedback on the code below.
Cheers,
Rob
> === modified file 'bzrlib/changeset.py'
> --- bzrlib/changeset.py
> +++ bzrlib/changeset.py
> @@ -1184,6 +1187,79 @@
> def finalize(self):
> pass
>
> +from sys import stderr
> +
> +def print_entry(e):
> + print >>stderr
> + print >>stderr, "---------------"
> + print >>stderr, "id :", e.id
> + print >>stderr, "path :", e.path
> + print >>stderr, "newpath :", e.new_path
> + print >>stderr, "parent :", e.parent
> + print >>stderr, "new_parent :", e.new_parent
> + print >>stderr, "contents_change:", e.contents_change
> + print >>stderr, "metadata_change:", e.metadata_change
You would probably find the bzrlib.trace routines useful for this. They
are better because they work with guis etc.
> === modified file 'bzrlib/inventory.py'
> --- bzrlib/inventory.py
> +++ bzrlib/inventory.py
> @@ -407,6 +407,44 @@
> # first requested, or preload them if they're already known
> pass # nothing to do by default
>
> + def check_eq(self, other):
> + if self.kind <> other.kind:
> + raise BzrError ("DENYS: %s (kind) %s -> %s" %
> (self.file_id,self.kind,other.kind))
> + if self.name <> other.name:
> + raise BzrError ("DENYS: %s (name) %s -> %s" %
> (self.file_id,self.name,other.name))
> + if self.parent_id <> other.parent_id:
> + raise BzrError ("DENYS: %s (parent_id) %s -> %s" %
> (self.file_id,self.parent_id,other.parent_id))
> + #if self.revision <> other.revision:
> + # raise BzrError ("DENYS: %s (revision) %s -> %s" %
> (self.file_id,self.revision,other.revision))
equality checking should always be done via __eq__.
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051215/029ec5e9/attachment.pgp
More information about the bazaar
mailing list