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?  


Question
--------

Is there an efficient way to find this out?


Wim Oudshoorn.





_______________________________________________
Monotone-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to