Changeset 115b452


Ignore:
Timestamp:
Mar 23, 2017, 9:47:10 PM (2 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, sampler
Children:
cc4987a
Parents:
9189c42
Message:

this_version.py: simplify git clean check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • this_version.py

    r9189c42 r115b452  
    8585        return None
    8686    # check if we have a clean tree
    87     gitcmd = ['git', '-C', aubio_dir, 'diff-index', '--quiet']
    88     gitcmd.append('HEAD')
     87    gitcmd = ['git', '-C', aubio_dir, 'status', '--porcelain']
    8988    try:
    90         output = subprocess.check_output(gitcmd)
    91     except subprocess.CalledProcessError:
    92         try:
    93             import sys
    94             sys.stdout.write('Info: current git tree is not clean\n')
    95             gitstatus = subprocess.check_output(['git', 'status'])
    96             sys.stdout.write(gitstatus.decode('utf8'))
    97         except Exception:
    98             pass
    99         gitsha += '+mods'
     89        output = subprocess.check_output(gitcmd).decode('utf8')
     90        if len(output):
     91            print('Info: current tree is not clean\n')
     92            print(output)
     93            gitsha += '+mods'
     94    except subprocess.CalledProcessError as e:
     95        print (e)
     96        pass
    10097    return gitsha
    10198
Note: See TracChangeset for help on using the changeset viewer.