# HG changeset patch # User Martin Geisler # Date 1243365201 -7200 # Node ID 4dd06ab9217c8db0c10b1b6e73c23c1501e0a62e # Parent 4c5b46f736f17d21a356c37216213b09a9449064 setup: handle trust warnings when determining version diff -r 4c5b46f736f1 -r 4dd06ab9217c setup.py --- a/setup.py Tue May 26 21:07:41 2009 +0200 +++ b/setup.py Tue May 26 21:13:21 2009 +0200 @@ -112,9 +112,15 @@ stderr=subprocess.PIPE).communicate() os.environ['PYTHONPATH'] = pypath + # If root is executing setup.py, but the repository is owned by + # another user (as in "sudo python setup.py install") we will get + # trust warnings since the .hg/hgrc file is untrusted. That is + # fine, we don't want to load it anyway. + err = [e for e in err.splitlines() + if not e.startswith('Not trusting file')] if err: sys.stderr.write('warning: could not establish Mercurial ' - 'version:\n%s\n' % err) + 'version:\n%s\n' % '\n'.join(err)) else: l = out.split() while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags