monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] Re: How to determine if a file is version controlled?


From: Bruce Stephens
Subject: [Monotone-devel] Re: How to determine if a file is version controlled?
Date: Thu, 13 Apr 2006 10:14:44 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Wim Oudshoorn <address@hidden> writes:

> Bruce Stephens <address@hidden> writes:

[...]

>> "monotone ls known <file>" will either print out just <file>, or
>> print nothing (if the file exists but isn't tracked), or print an
>> error (I presume using cerr) and return an error status.  So that's
>> not very clean, but it seems OK to me.
>
> As described somewhere else that is not really ideal, and very slow.

I wonder why it's slow.  

I mean, it's inevitably going to be slower than one would like,
because monotone is a big program, and probably does a fair bit of
work regardless of what you want.  But it probably ought just to be
getting the current manifest and looking for the name in that, so that
shouldn't be *that* costly, even though it's probably building up lots
of data structures that aren't necessary for this specific operation.

For "ls known", I guess just reading inodeprints (if there is one)
would be sufficient.  Maybe monotone isn't doing that, and could be
made to?  Maybe there ought also to be a cache of the current manifest
(probably in with inodeprints).  That would make it faster to find out
modification information about a specific file.

>> I guess in automate you'd have to use "automate inventory", or
>> something, which doesn't seem ideal.  Would be OK if you did it
>> occasionally, though, say on startup or when you expected that it
>> might have changed.
>
> No not really.
> It works for my emacs monotone mode that is similar to pcl-cvs,
> there I just grab the whole project and show the information.
>
> However, now I want to add a vc-mtn backend. And this backend
> works on a file by file basis.  
> One of the things to implement is a call that given a filename
> needs to check if it is tracked by the versioning system.
> Now this call is used everytime the user opens a file
> in emacs.  So it is not acceptable to be slow and you can't
> at startup just check the whole harddrive for all the monotone project.
> Also because I do not know at all what files I am talking about
> I just have to asume I have a random absolute path to begin with.

Yes, I follow that.  Maybe a restrictions variant of "automate
inventory"?  Presumably it's also useful to know if the file has been
modified since last commit?




reply via email to

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