[PATCH] shrink-revlog: help/doc tweaks

Greg Ward greg-hg at gerg.ca
Thu Jan 7 09:45:40 CST 2010


# HG changeset patch
# User Greg Ward <greg-hg at gerg.ca>
# Date 1262879002 18000
# Node ID ec13a353b694eb69caeca63fc023561587cef34b
# Parent  843f6ee6d14bf7ce2004cf3583ca67c75308f4bc
shrink-revlog: help/doc tweaks.

- make it look right in 'hg help extensions'
- clarify --revlog option
- add a main program to tell users this is no longer a standalone script

diff --git a/contrib/shrink-revlog.py b/contrib/shrink-revlog.py
--- a/contrib/shrink-revlog.py
+++ b/contrib/shrink-revlog.py
@@ -1,10 +1,11 @@
 #!/usr/bin/env python
 
 """\
-Reorder a revlog (by default the manifest file in the current repository) to
-save space. Specifically, this topologically sorts the revisions in the revlog
-so that revisions on the same branch are adjacent as much as possible. This is
-a workaround for the fact that Mercurial computes deltas relative to the
+reorder a revlog (the manifest by default) to save space
+
+Specifically, this topologically sorts the revisions in the revlog so that
+revisions on the same branch are adjacent as much as possible. This is a
+workaround for the fact that Mercurial computes deltas relative to the
 previous revision rather than relative to a parent revision.
 
 This is *not* safe to run on a changelog.
@@ -205,6 +206,13 @@
 
 cmdtable = {
     'shrink': (shrink,
-               [('', 'revlog', '', 'shrink file')],
+               [('', 'revlog', '', 'index (.i) file of the revlog to shrink')],
                'hg shrink [--revlog PATH]')
 }
+
+if __name__ == "__main__":
+    print """\
+shrink-revlog is now an extension, not a standalone script.
+You can enable it by adding this config value to [extensions]:
+  shrink = %s
+Then run 'hg shrink'.""" % os.path.abspath(sys.argv[0])


More information about the Mercurial-devel mailing list