Diff and merge of archives - proposal
Martin Pool
mbp at canonical.com
Wed Oct 13 02:46:02 BST 2010
On 13 October 2010 09:23, jbowtie at amathaine.com <jbowtie at amathaine.com> wrote:
> Again, looking for feedback on obvious design issues before I start my
> implementation.
>
> I propose adding the handling of archives to the core diff and merge
> algorithms via a DiffArchive class. There will be a new flag
> --treat-archives-as-binaries which can be used to avoid the
> performance hit of compressing and decompressing archives.
>
> If an archive has changed, the contents will be decompressed and
> diffed (note that the contained files and folders will not have their
> own file-ids, so renames will not be detected!).
>
> For merging, there will be an ArchiveMerger that attempts to merge its
> contents and compress the resulting archive. If the archive format
> supports it we prefer incremental updating the BASE version as opposed
> to creating a new archive.
> If there is a conflict, the archive itself will be flagged as
> conflicted and we will output some information about which contained
> files conflict. For qbzr we can resolve the conflict interactively.
Just a few questions:
Does any of this specifically need to be about 'archives' rather than
just general file-type-specific diff and merge? If so, what's
different, and how much can we unify them?
Are the contents going to be decompressed into the working tree, or elsewhere?
Rather than a command line option, we should have a config option.
This seems a lot like a kind of content filtering with two variations:
* files can expand out to any number of files in the convenient form
* you may want to have both the archive and the expanded form on disk
(which is related to the previous point)
> And yes of course all this could be provided by plugin in the first
> implementation, I just happen to think that archives are so prevalent
> that they should ultimately be handled by the core.
I would like to see the implementation done as hooks, registries and
other extension points; that lets us easily have it either in core or
not, and it will let people add similar things as plugins.
hth, please post more as you go along.
--
Martin
More information about the bazaar
mailing list