newby question: styling the hg status command

Ted Pavlic ted at tedpavlic.com
Wed May 7 07:59:25 CDT 2008


I know the rest of this thread discusses how difficult it would be to 
parse the output of "hg status," but I don't quite understand that.

For example, it's easy to pipe the output of "hg status" to sed and 
xargs to get expansion and on-disk modification dates.

For example...

hg status | sed -e 's@^I at Ignored -@'

In a script, you could add additional -e's to do additional replacements 
for all of the other cases. You could also get more exotic:

hg status | perl -ne '/I\s+(.*)/ && print "Ignored - ", `ls -l $1`;'

That's a primitive example... but my point is... Is it that difficult to 
wire something up? Certainly an XML frontend isn't needed (and if it is, 
it should be implemented as an extension that accesses the database 
through its software API; the CLI interface is fine as is).

A good "status parser" could be added to the contrib directory with the 
distribution.

--Ted


Lance Perry wrote:
> Can the 'hg status' command be styled like the 'hg log' command?
> 
> I'd like to be able to change the default M, ?, !, etc. to be more 
> verbose and also it would
> be nice to see the files modification date.
> 
> --lance perry
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial

-- 
Ted Pavlic <ted at tedpavlic.com>


More information about the Mercurial mailing list