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


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/config.py

    r0a0b3d8 r476ac3b  
    460460       
    461461        try:
    462                 version = subprocess.Popen(['git', 'log', '-1', '--pretty=%h'], stdout = subprocess.PIPE).communicate()[0].decode().strip()
     462                version = subprocess.Popen(['bzr', 'version-info', '--custom', '--template={clean}:{revno}:{revision_id}'], stdout = subprocess.PIPE).communicate()[0].decode().split(':')
    463463                sys.stderr.write("ok\n")
    464464        except:
    465                 version = None
     465                version = [1, "unknown", "unknown"]
    466466                sys.stderr.write("failed\n")
    467467       
    468         if (not strip_rev_info) and (version is not None):
    469                 revision = version
     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]
    470473        else:
    471474                revision = None
Note: See TracChangeset for help on using the changeset viewer.