On 4/12/06, Wim Oudshoorn <[EMAIL PROTECTED]> 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 _______________________________________________ Monotone-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/monotone-devel
