versioning in vendor distributions

Danek Duvall danek.duvall at sun.com
Wed Apr 2 22:09:59 UTC 2008


On Wed, Apr 02, 2008 at 04:04:36PM -0500, Matt Mackall wrote:

> Seems ok. We'll probably ship a 1.0.1 pretty soon.

Okay.  I'll take 1.0.1 if it comes in this week or early next, but I've got
our own build boundaries to contend with.

Here's a simple patch for printing out a patchlist.  Let me know how
horrible you think it is.  :)

Thanks,
Danek

# HG changeset patch
# User Danek Duvall <danek.duvall at sun.com>
# Date 1207173988 25200
# Node ID eb5ffd30c30519ae6620a29aa6bffd0aa1d01763
# Parent  101526031d06d184559ae797687e50661b96156e
Add support for patch list in version output.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2829,6 +2829,11 @@
         "There is NO\nwarranty; "
         "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
     ))
+    patches = version.get_patches()
+    if patches:
+            ui.status(_("\nLocally applied patches:\n"))
+            for patch in patches:
+                    ui.status("    " + patch + "\n")
 
 # Command options and aliases are listed here, alphabetically
 
diff --git a/mercurial/version.py b/mercurial/version.py
--- a/mercurial/version.py
+++ b/mercurial/version.py
@@ -75,3 +75,11 @@
     if remembered_version:
         write_version(unknown_version)
 
+def get_patches():
+    """Return patch information if available."""
+    try:
+        import mercurial.__version__
+        patches = mercurial.__version__.patches
+    except (ImportError, AttributeError):
+        patches = []
+    return patches



More information about the Mercurial mailing list