monotone-devel
[Top][All Lists]
Advanced

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

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


From: Justin Patrin
Subject: Re: [Monotone-devel] How to determine if a file is version controlled?
Date: Wed, 12 Apr 2006 14:50:32 -0700

On 4/12/06, Wim Oudshoorn <address@hidden> wrote:
> I was trying to extend my emacs mode for monotone
> and for this I wanted to know if a certain file
> is tracked by monotone.
> To my surprise, I couldn't easily figure out an efficient way
> to do this.
>
>
> Problem:
> -------
> Write a function
>
> is_tracked_by_mtn (string filename)
>
> that returns TRUE if the the file indicated
> by filename is tracked by monotone and
> FALSE otherwise.
>
> Slow solution.
> -------------
> Use
>
>    monotone automate inventory
>
> and do some path manipulation on the input
> filename and resulting output to see
> if the file is tracked by monotone.
>
> Other idea 1
> ------------
>
> Use
>
>    monotone status filename
>
> this will fail because monotone status does not
> distinguish between unchanged files and ignored files.
>
> Other idea 2
> ------------
>
> Use
>
>    monotone log --brief --last=1 filename
>
> and use the following logic:
>
> * If result code == 0
> AND
> * output contains one line
>
> the file is tracked by monotone.
>
> However this fails because for example
>
>    monotone log --brief --last=1   /Users/woudshoo/.elisp/e-monotone/TODO
>
> gives the following error:
>
>    monotone: misuse: absolute path '/Users/woudshoo/.elisp/e-monotone/TODO' 
> is invalid
>
> Huh??? wat is wrong with my absolute path?

Your path should be relative to the root of the checkout, not absolute
from / (unless / is your checkout...).

>
>
> Question
> --------
>
> Is there an efficient way to find this out?
>

"monotone ls unknown path/to/dir" and look for the file?

"monotone automate cat revision CURRENTREV" (or similar, don't use
these too much) and look for the file?

--
Justin Patrin




reply via email to

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