Patchwork [2,of,3,RFC,V2] setup: use changessincelatesttag from archive if present

login
register
mail settings
Submitter Siddharth Agarwal
Date Dec. 13, 2014, 1:02 a.m.
Message ID <71df59b4066e7df2b38c.1418432549@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/7070/
State Accepted
Commit 9641643fac7177ec960121e2c87408b3f45a1271
Delegated to: Matt Mackall
Headers show

Comments

Siddharth Agarwal - Dec. 13, 2014, 1:02 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@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.

Patch

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]