get rev number of current working version?

Dustin Sallings dustin at spy.net
Wed Nov 28 19:48:37 UTC 2007


On Nov 28, 2007, at 9:59, Neal Becker wrote:

> OK, then what is a "good" way for my program to get a revision  
> number?  I
> think ideally the revision number should match what the working  
> directory
> revision is (regardless of how it got that way)?


	identify does that.  It's currently telling you 020ca3a96b03+ because  
your tree is on revision 020ca3a96b03, but you've made some changes to  
it that you've not committed.

	The fact that those changes make the tree look exactly like an older  
revision is not so much mercurial's concern.  Remember that you can't  
change history and this all makes more sense.  A revert of committed  
code is making reverse patches to apply to the current tree so that a  
future revision looks like an old one.  The revisions between them are  
still available.

	The only reason mercurial would tell you that your tree revision *is*  
297 is if you set the tree revision to 297 by updating to it.

	hg up -C 297

-- 
Dustin Sallings




More information about the Mercurial mailing list