setup.py
branchstable
changeset 49970 8d390a13474d
parent 49830 bc59c1e5dd01
child 49971 ac93876ea2df
--- a/setup.py	Mon Jan 30 18:25:11 2023 -0500
+++ b/setup.py	Mon Jan 30 18:41:59 2023 +0100
@@ -337,8 +337,12 @@
     else:  # no tag found
         ltagcmd = ['parents', '--template', '{latesttag}']
         ltag = sysstr(hg.run(ltagcmd))
+        if not ltag:
+            ltag = 'null'
         changessincecmd = ['log', '-T', 'x\n', '-r', "only(.,'%s')" % ltag]
         changessince = len(hg.run(changessincecmd).splitlines())
+        if ltag == 'null':
+            ltag = '0.0'
         version = '%s+hg%s.%s' % (ltag, changessince, hgid)
     if version.endswith('+'):
         version = version[:-1] + 'local' + time.strftime('%Y%m%d')