Changes in tools/config.py [476ac3b:0a0b3d8] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/config.py

    r476ac3b r0a0b3d8  
    460460       
    461461        try:
    462                 version = subprocess.Popen(['bzr', 'version-info', '--custom', '--template={clean}:{revno}:{revision_id}'], stdout = subprocess.PIPE).communicate()[0].decode().split(':')
     462                version = subprocess.Popen(['git', 'log', '-1', '--pretty=%h'], stdout = subprocess.PIPE).communicate()[0].decode().strip()
    463463                sys.stderr.write("ok\n")
    464464        except:
    465                 version = [1, "unknown", "unknown"]
     465                version = None
    466466                sys.stderr.write("failed\n")
    467467       
    468         if (not strip_rev_info) and (len(version) == 3):
    469                 revision = version[1]
    470                 if version[0] != 1:
    471                         revision += 'M'
    472                 revision += ' (%s)' % version[2]
     468        if (not strip_rev_info) and (version is not None):
     469                revision = version
    473470        else:
    474471                revision = None
Note: See TracChangeset for help on using the changeset viewer.