Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit b33a4cd

Browse files
committed
Merge pull request #86 from matrix-org/v0.7.1-r2
V0.7.1 r2
2 parents 2b45ca1 + a87c56c commit b33a4cd

File tree

2 files changed

+57
-54
lines changed

2 files changed

+57
-54
lines changed

synapse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
""" This is a reference implementation of a Matrix home server.
1717
"""
1818

19-
__version__ = "0.7.1-r1"
19+
__version__ = "0.7.1-r2"

synapse/app/homeserver.py

Lines changed: 56 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -210,61 +210,64 @@ def start_listening(self, secure_port, unsecure_port):
210210

211211

212212
def get_version_string():
213-
null = open(os.devnull, 'w')
214-
cwd = os.path.dirname(os.path.abspath(__file__))
215213
try:
216-
git_branch = subprocess.check_output(
217-
['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
218-
stderr=null,
219-
cwd=cwd,
220-
).strip()
221-
git_branch = "b=" + git_branch
222-
except subprocess.CalledProcessError:
223-
git_branch = ""
224-
225-
try:
226-
git_tag = subprocess.check_output(
227-
['git', 'describe', '--exact-match'],
228-
stderr=null,
229-
cwd=cwd,
230-
).strip()
231-
git_tag = "t=" + git_tag
232-
except subprocess.CalledProcessError:
233-
git_tag = ""
234-
235-
try:
236-
git_commit = subprocess.check_output(
237-
['git', 'rev-parse', '--short', 'HEAD'],
238-
stderr=null,
239-
cwd=cwd,
240-
).strip()
241-
except subprocess.CalledProcessError:
242-
git_commit = ""
243-
244-
try:
245-
dirty_string = "-this_is_a_dirty_checkout"
246-
is_dirty = subprocess.check_output(
247-
['git', 'describe', '--dirty=' + dirty_string],
248-
stderr=null,
249-
cwd=cwd,
250-
).strip().endswith(dirty_string)
251-
252-
git_dirty = "dirty" if is_dirty else ""
253-
except subprocess.CalledProcessError:
254-
git_dirty = ""
255-
256-
if git_branch or git_tag or git_commit or git_dirty:
257-
git_version = ",".join(
258-
s for s in
259-
(git_branch, git_tag, git_commit, git_dirty,)
260-
if s
261-
)
262-
263-
return (
264-
"Synapse/%s (%s)" % (
265-
synapse.__version__, git_version,
214+
null = open(os.devnull, 'w')
215+
cwd = os.path.dirname(os.path.abspath(__file__))
216+
try:
217+
git_branch = subprocess.check_output(
218+
['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
219+
stderr=null,
220+
cwd=cwd,
221+
).strip()
222+
git_branch = "b=" + git_branch
223+
except subprocess.CalledProcessError:
224+
git_branch = ""
225+
226+
try:
227+
git_tag = subprocess.check_output(
228+
['git', 'describe', '--exact-match'],
229+
stderr=null,
230+
cwd=cwd,
231+
).strip()
232+
git_tag = "t=" + git_tag
233+
except subprocess.CalledProcessError:
234+
git_tag = ""
235+
236+
try:
237+
git_commit = subprocess.check_output(
238+
['git', 'rev-parse', '--short', 'HEAD'],
239+
stderr=null,
240+
cwd=cwd,
241+
).strip()
242+
except subprocess.CalledProcessError:
243+
git_commit = ""
244+
245+
try:
246+
dirty_string = "-this_is_a_dirty_checkout"
247+
is_dirty = subprocess.check_output(
248+
['git', 'describe', '--dirty=' + dirty_string],
249+
stderr=null,
250+
cwd=cwd,
251+
).strip().endswith(dirty_string)
252+
253+
git_dirty = "dirty" if is_dirty else ""
254+
except subprocess.CalledProcessError:
255+
git_dirty = ""
256+
257+
if git_branch or git_tag or git_commit or git_dirty:
258+
git_version = ",".join(
259+
s for s in
260+
(git_branch, git_tag, git_commit, git_dirty,)
261+
if s
266262
)
267-
).encode("ascii")
263+
264+
return (
265+
"Synapse/%s (%s)" % (
266+
synapse.__version__, git_version,
267+
)
268+
).encode("ascii")
269+
except Exception as e:
270+
logger.warn("Failed to check for git repository: %s", e)
268271

269272
return ("Synapse/%s" % (synapse.__version__,)).encode("ascii")
270273

0 commit comments

Comments
 (0)