monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Extensions to automation, again


From: Timothy Brownawell
Subject: Re: [Monotone-devel] Extensions to automation, again
Date: Wed, 18 Oct 2006 12:33:47 -0500

On Wed, 2006-10-18 at 18:53 +0200, Thomas Keller wrote:
> Hi all!
> 
> So I was struggeling around today what I could do with guitone as the
> whole graph creating thing is stucked a bit and thought some kind of
> diff dialog would be cool to build in. Then I thought about the
> prerequisites of such a thing and immediately found that it can't be
> done (easily) with the current automation interface, basically for those
> reasons:
> 
> a) there is no automate diff command

"Patches accepted", I'm sure.

> b) if there would be a), then its still hard to get the contents of a
> file, because one needs to read the complete manifest to get an ID

But won't you already have that, from when you got the list of files
that the user just picked one from to get a diff of?

> c) if one finally would gather the file's ID, one would still not have
> information about the file itself (binary/non-binary, filesize), which
> would be needed to determine if one is able to display a diff dialog at
> all or not and also to prepare the user that f.e. displaying the diff of
> a 9MB text file could take some time (and therefor ask him if he really
> wants to do so, etc.)

binary/non-binary is IIRC an attribute (there's also a hook, but I think
that's only used for setting the attribute?), and so would be visible in
the manifest.

filesize would require a schema change to be an improvement. Monotone
itself doesn't record how big the files are, it can only find this out
by reconstructing them.

> So I thought it would be cool to have the following (additional)
> automate commands:
> 
> automate get_file_by_path PATH [REVISION]
>  -> returns the complete file given in path in a certain revision,
>     if the revision is omitted, this basically returns the current
>     contents of the file in the current workspace revision
> 
> automate get_file_type PATH [REVISION]
>  -> returns the file type binary/non-binary, again for the current
>     or any other revision

These would just be subsets of what get_manifest_of does. And I'd expect
that most applications that would be calling these would already have
results from get_manifest_of laying around.

> automate get_file_size PATH [REVISION]
>  -> returns the size in Bytes of the file in that version in history

Might be slightly useful, but only if we change the database schema to
support it.

-- 
Timothy

Free (experimental) public monotone hosting: http://mtn-host.prjek.net





reply via email to

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