monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] mtn cat vs. mtn automate get_file


From: Thomas Keller
Subject: [Monotone-devel] mtn cat vs. mtn automate get_file
Date: Sat, 18 Nov 2006 14:59:52 +0100
User-agent: Thunderbird 1.5.0.8 (Macintosh/20061025)

Hi all!

I'm currently seeking my way through mtn's automate to implement a diff view for guitone. For that purpose, several things need to be done beforehand:

a) 'mtn automate inventory' returns file paths and their states, patched (P) files can be diffed

b) 'mtn automate get_base_revision_id' returns the parent ID of the workspace

c) 'mtn cat -r <base> <filename>' returns the original file content or nothing if the file was unknown in this revision, that is the file is new (FIXME: I have no information if the content is binary at this point, I need to trust on the mtn:manual_merge attribute on the file which can easily be removed by hand - so actually I don't like to trust on that one too much)

d) 'mtn automate content_diff <filename>' returns the diff of the file against the parent rev

In the end all these information should be nicely put together in a view which shows the complete file and the changed lines with red and green background (maybe even a split view with synchronized scrolling, but this is a long way down the road...).

Anyways, it should be obvious that I need to break with my work in c), because mtn cat is not yet available via automate. There is mtn automate get_file, but this needs a file ID. Where to get this file ID? Either from the manifest of the parent or by calling get_revision. But yes, I currently do not use this at all, and I'd need to retrieve the complete manifest or revision just to get a single fileid... not the best way IMHO.

So there are several possibilities which could work for me (and others in the same situation):

a) make mtn cat available over mtn automate, maybe rename it and remove get_file; expand the "automate cat" command to also accept fileid's with one of these nice new options available there.

b) make inventory (actually the new basic_io format version residing in some unmerged branch currently) spit out fileid's (old/new)

c) create a new automate command which translates a single file path into a file id for a certain revision (again, if the file is available in this revision)

d) ...more?

There are reasons for and against certain ways, e.g. backwards compatibility, no likage to create the all-in-one command suitable for every purpose, aso. but I'd like to know the most unobstrusive from you, or at least the one you favorit.

Thomas.

--
ICQ: 85945241 | SIP: 1-747-027-0392 | http://www.thomaskeller.biz
> Guitone, a frontend for monotone: http://guitone.berlios.de
> Music lyrics and more: http://musicmademe.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]