##// END OF EJS Templates
build: fake PEP440 versions...
Joerg Sonnenberger -
r47262:866eb4d6 default
parent child Browse files
Show More
@@ -419,9 +419,9 b" if os.path.isdir('.hg'):"
419 419 ltag = sysstr(hg.run(ltagcmd))
420 420 changessincecmd = ['log', '-T', 'x\n', '-r', "only(.,'%s')" % ltag]
421 421 changessince = len(hg.run(changessincecmd).splitlines())
422 version = '%s+%s-%s' % (ltag, changessince, hgid)
422 version = '%s+hg%s.%s' % (ltag, changessince, hgid)
423 423 if version.endswith('+'):
424 version += time.strftime('%Y%m%d')
424 version = version[:-1] + 'local' + time.strftime('%Y%m%d')
425 425 elif os.path.exists('.hg_archival.txt'):
426 426 kw = dict(
427 427 [[t.strip() for t in l.split(':', 1)] for l in open('.hg_archival.txt')]
@@ -430,11 +430,13 b" elif os.path.exists('.hg_archival.txt'):"
430 430 version = kw['tag']
431 431 elif 'latesttag' in kw:
432 432 if 'changessincelatesttag' in kw:
433 version = '%(latesttag)s+%(changessincelatesttag)s-%(node).12s' % kw
433 version = (
434 '%(latesttag)s+.%(changessincelatesttag)s.%(node).12s' % kw
435 )
434 436 else:
435 version = '%(latesttag)s+%(latesttagdistance)s-%(node).12s' % kw
437 version = '%(latesttag)s+.%(latesttagdistance)s.%(node).12s' % kw
436 438 else:
437 version = kw.get('node', '')[:12]
439 version = '0+' + kw.get('node', '')[:12]
438 440
439 441 if version:
440 442 versionb = version
@@ -451,20 +453,6 b' if version:'
451 453 ),
452 454 )
453 455
454 try:
455 oldpolicy = os.environ.get('HGMODULEPOLICY', None)
456 os.environ['HGMODULEPOLICY'] = 'py'
457 from mercurial import __version__
458
459 version = __version__.version
460 except ImportError:
461 version = b'unknown'
462 finally:
463 if oldpolicy is None:
464 del os.environ['HGMODULEPOLICY']
465 else:
466 os.environ['HGMODULEPOLICY'] = oldpolicy
467
468 456
469 457 class hgbuild(build):
470 458 # Insert hgbuildmo first so that files in mercurial/locale/ are found
@@ -1683,8 +1671,8 b' datafiles = []'
1683 1671 # unicode on Python 2 still works because it won't contain any
1684 1672 # non-ascii bytes and will be implicitly converted back to bytes
1685 1673 # when operated on.
1686 assert isinstance(version, bytes)
1687 setupversion = version.decode('ascii')
1674 assert isinstance(version, str)
1675 setupversion = version
1688 1676
1689 1677 extra = {}
1690 1678
General Comments 0
You need to be logged in to leave comments. Login now