setup: use changessincelatesttag from archive if present
authorSiddharth Agarwal <sid0@fb.com>
Fri, 12 Dec 2014 15:29:39 -0800
changeset 23646 9641643fac71
parent 23645 242d11819c6c
child 23647 eb55e09202c8
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.
setup.py
--- a/setup.py	Fri Dec 12 15:27:13 2014 -0800
+++ b/setup.py	Fri Dec 12 15:29:39 2014 -0800
@@ -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]