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: Daniel Carosone
Subject: Re: [Monotone-devel] How to determine if a file is version controlled?
Date: Thu, 13 Apr 2006 08:07:36 +1000
User-agent: Mutt/1.4.2.1i

On Wed, Apr 12, 2006 at 11:24:55PM +0200, Wim Oudshoorn 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.

look for it in "list known" or "auto get_manifest_of".  

The former will include files that have been added but not yet
committed, the latter will tell you about files that were in the BASE
revision, excluding uncommitted additions.

> 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.

This is slower because it's spending extra time finding information
you're not using; in particular doing a lot of seeking to check file
content.

> Other idea 1
> ------------
> 
> Use 
> 
>    monotone status filename
> 
> this will fail because monotone status does not 
> distinguish between unchanged files and ignored files.

Yeah. As a counterpoint in a similar vein though, you could look at
"mtn diff filename", which will tell you either that something or
nothing changed, or that the filename is unknown.

As an aside, 'status' is something I think we should eventually change
- in its present form, status gives a basic_io representation of the
revision you might be about to commit.  This is useful and interesting
in some cases, but probably should be called something other than
status.  I'd like to see 'status' change to something more like a
human-friendly combination of several of the 'list' commands or the
inventory form:

changed foo/bar
added   foo/baz
missing bar/bonk
unknown .mysterious.dot.file

This is very similar to status --brief (perhaps the revision form
becomes status --long?), with two vital differences: 

  It's important (though there are concerns it may be slow) that the
  'unknown' is in there, because it's an all-too-common user error to
  commit something but to forget to have added important files.

  Unknown doesn't become a fatal scary error, but just something else
  to report.

Anyway, this kind of UI cleanup is on the cards for upcoming work, now
that 0.26 is out.  For tool-writers, you should be looking for
something in the automate interface to accomplish your needs (and
raising issues if that interface doesn't meet your needs).  This is
because that interface is expected to stay more format-stable, and
because it can be used with a long-running monotone co-process via
"automate stdio".

> 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?  

Probably, it reaches back above the workspace.

Hope this helps..

--
Dan.

Attachment: pgpO0sBLQ7BFz.pgp
Description: PGP signature


reply via email to

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