monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] m7 rises from the dead... reborn with new non-irritatin


From: Larry Hastings
Subject: [Monotone-devel] m7 rises from the dead... reborn with new non-irritating behavior!
Date: Sun, 05 Nov 2006 18:26:13 -0800
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)



Howdy folks!  Today I announce a new version of m7.  In case you forgot, m7 is a proof-of-concept Python script that adds simple "local revision numbers" to monotone.  These local revision numbers are simple monotonically increasing numbers affixed to revisions, and you can use them anywhere you specify a revision on the command-line.  To ensure it's unambiguous, you need to prefix the revision number with a colon.  So, if revision "818b9c9604efad446e5729d82a707714fea92cde" was local revision number 5, these commands are equivalent:
    mtn cat --revision=818b9c9604efad446e5729d82a707714fea92cde foo.cpp
    m7 cat --revision=:5 foo.cpp

When I announced m7 over a year ago I didn't know what to expect.  Reactions were mixed, from negative like "I would never use this, and I hope no one else does either", to positive like "I would never use this, but it's kind of neat"*.  The original objection to m7 was its use of tags to track local revision numbers.  Later I changed to custom certs, but that was little improvement.  Since these tags & certs become part of your database, they would be sync'd to external users, even though they were primarily intended for local use. Correspondents on the monotone mailing list felt these certs would clutter up their databases and network traffic.

However!  Some senior monotone fella, surely either Graydon or Nathaniel, suggested an approach that doesn't need these certs―and is both faster and less error-prone to boot.  It relies on a slightly-obscure feature of SQLite: every table has an indexed unique auto-incrementing integer column, whether or not it specifies one explicitly in its schema (see http://www.sqlite.org/autoinc.html ).  So each entry in the revision table already has a locally-unique "revision number", ready-made and just waiting to be exposed to the monotone user.  This even works, automatically, for external revisions you get from a network sync―a feature the old m7 never had, and never would!  The only downside to this approach is a descent into "mtn db execute" territory, but it's a quick trip.

I am therefore pleased to announce m7 version 0.8, which does not create extra tags or certs.  Its only overhead is three "database variables" for local configuration which do not get propogated via netsync.  You should feel free to download it and play around with it, secure in the knowledge that it will not "infect" your repositories with extraneous certs.  m7 is written in Python, and requires version 2.3 or higher.

Apart from the exposed local revision numbers, m7's other main feature is a more readable form of annotate.  I tinkered with this a little too; now by default it prints a legend of the relevant revisions at the top before the annotated source.

In case you're an existing m7 user, you can remove all the old m7 cruft by running "m7 unpopulate" from your work directory.  (And you could give me the shock of my life by letting me know you were actually using m7.)

You can read more about m7, and download a copy, here:
    http://www.midwinter.com/~lch/programming/m7/


Cheers,


larry

* This is exaggerated for comedic effect, though I do believe I have zero active users of m7.  But let it be said that the monotone developers were always supportive of my experimenting with monotone's UI.

reply via email to

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