[PATCH 2 of 3 RFC] setup: use changessincelatesttag from archive if present

Siddharth Agarwal sid0 at fb.com
Fri Dec 12 17:48:19 CST 2014


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1418426979 28800
#      Fri Dec 12 15:29:39 2014 -0800
# Node ID 71df59b4066e7df2b38c81376fb4152c5735e311
# Parent  503a63fab1bbd3623463fdbb4d3e030503f3f706
setup: use changessincelatesttag from archive if present

changessincelatesttag gives one a better idea of how much the code has changed
since. Since changessincelatesttag is always greater than or equal to the
latesttagdistance (see previous patch for why), this will always produce
version numbers greater than or equal to the previous scheme.

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -207,7 +207,10 @@
     if 'tag' in kw:
         version =  kw['tag']
     elif 'latesttag' in kw:
-        version = '%(latesttag)s+%(latesttagdistance)s-%(node).12s' % kw
+        if 'changessincelatesttag' in kw:
+            version = '%(latesttag)s+%(changessincelatesttag)s-%(node).12s' % kw
+        else:
+            version = '%(latesttag)s+%(latesttagdistance)s-%(node).12s' % kw
     else:
         version = kw.get('node', '')[:12]
 


More information about the Mercurial-devel mailing list