|
From: | Wim Oudshoorn |
Subject: | [Monotone-devel] How to determine if a file is version controlled? |
Date: | Wed, 12 Apr 2006 23:24:55 +0200 |
User-agent: | Gnus/5.1002 (Gnus v5.10.2) Emacs/22.0.50 (darwin) |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |