Mercurial > hg
diff setup.py @ 49972:1bd33932713d
branching: merge with stable
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 31 Jan 2023 11:41:59 +0100 |
parents | ff4df0954742 ac93876ea2df |
children | 0f0880c8a7e5 |
line wrap: on
line diff
--- a/setup.py Thu Apr 29 22:01:04 2021 +0200 +++ b/setup.py Tue Jan 31 11:41:59 2023 +0100 @@ -217,9 +217,10 @@ cmd = self.cmd + args returncode, out, err = runcmd(cmd, self.env) err = filterhgerr(err) - if err or returncode != 0: + if err: print("stderr from '%s':" % (' '.join(cmd)), file=sys.stderr) print(err, file=sys.stderr) + if returncode != 0: return b'' return out @@ -333,8 +334,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')