summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-03-06 14:23:41 +0000
committerErik Johnston <erik@matrix.org>2015-03-06 14:23:41 +0000
commitc54773473f26ff2c56b4f8ac3e428077757a9724 (patch)
tree1df40ba03f5b996ad44a3710ba7efa991747a642
parentMerge pull request #96 from matrix-org/pushrules2 (diff)
parentMerge pull request #98 from matrix-org/hotfixes-v0.7.1-r4 (diff)
downloadsynapse-c54773473f26ff2c56b4f8ac3e428077757a9724.tar.xz
Merge branch 'master' of github.com:matrix-org/synapse into develop
-rw-r--r--README.rst2
-rw-r--r--synapse/__init__.py2
-rwxr-xr-xsynapse/app/homeserver.py109
3 files changed, 59 insertions, 54 deletions
diff --git a/README.rst b/README.rst
index d3778b9f2e..c2af7c9332 100644
--- a/README.rst
+++ b/README.rst
@@ -118,6 +118,7 @@ environment under ``~/.synapse``.
 
 To set up your homeserver, run (in your virtualenv, as before)::
 
+    $ cd ~/.synapse
     $ python -m synapse.app.homeserver \
         --server-name machine.my.domain.name \
         --config-path homeserver.yaml \
@@ -179,6 +180,7 @@ installing under virtualenv)::
     
 During setup of homeserver you need to call python2.7 directly again::
 
+    $ cd ~/.synapse
     $ python2.7 -m synapse.app.homeserver \
       --server-name machine.my.domain.name \
       --config-path homeserver.yaml \
diff --git a/synapse/__init__.py b/synapse/__init__.py
index f8ec4b0459..74c5584a1a 100644
--- a/synapse/__init__.py
+++ b/synapse/__init__.py
@@ -16,4 +16,4 @@
 """ This is a reference implementation of a Matrix home server.
 """
 
-__version__ = "0.7.1-r1"
+__version__ = "0.7.1-r4"
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index b3ba7dfddc..f96535a978 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -219,61 +219,64 @@ class SynapseHomeServer(HomeServer):
 
 
 def get_version_string():
-    null = open(os.devnull, 'w')
-    cwd = os.path.dirname(os.path.abspath(__file__))
     try:
-        git_branch = subprocess.check_output(
-            ['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
-            stderr=null,
-            cwd=cwd,
-        ).strip()
-        git_branch = "b=" + git_branch
-    except subprocess.CalledProcessError:
-        git_branch = ""
-
-    try:
-        git_tag = subprocess.check_output(
-            ['git', 'describe', '--exact-match'],
-            stderr=null,
-            cwd=cwd,
-        ).strip()
-        git_tag = "t=" + git_tag
-    except subprocess.CalledProcessError:
-        git_tag = ""
-
-    try:
-        git_commit = subprocess.check_output(
-            ['git', 'rev-parse', '--short', 'HEAD'],
-            stderr=null,
-            cwd=cwd,
-        ).strip()
-    except subprocess.CalledProcessError:
-        git_commit = ""
-
-    try:
-        dirty_string = "-this_is_a_dirty_checkout"
-        is_dirty = subprocess.check_output(
-            ['git', 'describe', '--dirty=' + dirty_string],
-            stderr=null,
-            cwd=cwd,
-        ).strip().endswith(dirty_string)
-
-        git_dirty = "dirty" if is_dirty else ""
-    except subprocess.CalledProcessError:
-        git_dirty = ""
-
-    if git_branch or git_tag or git_commit or git_dirty:
-        git_version = ",".join(
-            s for s in
-            (git_branch, git_tag, git_commit, git_dirty,)
-            if s
-        )
-
-        return (
-            "Synapse/%s (%s)" % (
-                synapse.__version__, git_version,
+        null = open(os.devnull, 'w')
+        cwd = os.path.dirname(os.path.abspath(__file__))
+        try:
+            git_branch = subprocess.check_output(
+                ['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
+                stderr=null,
+                cwd=cwd,
+            ).strip()
+            git_branch = "b=" + git_branch
+        except subprocess.CalledProcessError:
+            git_branch = ""
+
+        try:
+            git_tag = subprocess.check_output(
+                ['git', 'describe', '--exact-match'],
+                stderr=null,
+                cwd=cwd,
+            ).strip()
+            git_tag = "t=" + git_tag
+        except subprocess.CalledProcessError:
+            git_tag = ""
+
+        try:
+            git_commit = subprocess.check_output(
+                ['git', 'rev-parse', '--short', 'HEAD'],
+                stderr=null,
+                cwd=cwd,
+            ).strip()
+        except subprocess.CalledProcessError:
+            git_commit = ""
+
+        try:
+            dirty_string = "-this_is_a_dirty_checkout"
+            is_dirty = subprocess.check_output(
+                ['git', 'describe', '--dirty=' + dirty_string],
+                stderr=null,
+                cwd=cwd,
+            ).strip().endswith(dirty_string)
+
+            git_dirty = "dirty" if is_dirty else ""
+        except subprocess.CalledProcessError:
+            git_dirty = ""
+
+        if git_branch or git_tag or git_commit or git_dirty:
+            git_version = ",".join(
+                s for s in
+                (git_branch, git_tag, git_commit, git_dirty,)
+                if s
             )
-        ).encode("ascii")
+
+            return (
+                "Synapse/%s (%s)" % (
+                    synapse.__version__, git_version,
+                )
+            ).encode("ascii")
+    except Exception as e:
+        logger.warn("Failed to check for git repository: %s", e)
 
     return ("Synapse/%s" % (synapse.__version__,)).encode("ascii")