bzr revert

Aaron Bentley aaron.bentley at utoronto.ca
Fri Jul 22 14:10:59 BST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> On 22 Jul 2005, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> 
>>I was planning on teaching merge-revert to save modified files to a
>>changeset, and teaching it to handle individual files, but I was keeping
>>the plans on hold until changesets entered the mainline.
> 
> 
> Is there anything i need to merge first to allow you to do that?

I think changesets are all that's needed, though I'm not sure whether
they're ready for inclusion yet.  Looks like John's fixed the test
cases, so maybe they are.

One slight disconnect is that changesets are designed to represent
revisions, not trees, but I'd like to use them to save the current
working tree state.

I could also try to just save files, as revert does.  That looks icky
for handling the revert-whole-tree case, but we could just create a
BackupBeforeChange class:

class BackupBeforeChange(object):
    def __init__(self, base_file, other_file):
        self.diff3 = Diff3Merge(base_file, other_file)

    def apply(self, filename, conflict_handler):
        backup_file(filename)
        self.diff3.apply(filename, conflict_handler)

Actually, come to think of it, we'd need it to work with deletions, so
it might have to work with any kind of contents change.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC4PBj0F+nu1YWqI0RApbYAJ4hFaTMomosdLaJMETLRnaQ1JNZFgCdHwTc
HP97nzAaVVCI1sqO0hWEpkE=
=HiZ5
-----END PGP SIGNATURE-----




More information about the bazaar mailing list