summaryrefslogtreecommitdiffstats
path: root/core/utils.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2024-12-29 15:49:07 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2024-12-29 15:49:07 +0000
commitace23257731c9a35c48bb56ff59c24cfccdc7029 (patch)
treefe5c642f8cc4937d11df63acc84aaeac72f92e8c /core/utils.py
parent6d2484376a5816387fedfb03eb83c42bcb81d6a1 (diff)
downloadtroggle-ace23257731c9a35c48bb56ff59c24cfccdc7029.tar.gz
troggle-ace23257731c9a35c48bb56ff59c24cfccdc7029.tar.bz2
troggle-ace23257731c9a35c48bb56ff59c24cfccdc7029.zip
Add commit msg when on a devserver
Diffstat (limited to 'core/utils.py')
-rw-r--r--core/utils.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/utils.py b/core/utils.py
index 673dcee..8647d44 100644
--- a/core/utils.py
+++ b/core/utils.py
@@ -5,6 +5,7 @@ import os
import random
import re
import resource
+import socket
import string
import subprocess
from datetime import datetime, timezone
@@ -45,6 +46,8 @@ sha = hashlib.new('sha256')
COOKIE_MAX_AGE = 12*60*60 # seconds
throw = 35.0
+EXPOSERVER = "expo" # hostname of the server at expo.survex.com
+
DEV_OK = """On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
@@ -260,7 +263,12 @@ def git_commit(cwd, message, editor, commands=[]):
"""
git = settings.GIT
print(f"git commit in {cwd}")
- print(f"Committing:\n{message=}\n{editor=}")
+
+ if socket.gethostname() != EXPOSERVER:
+ message += f" on dev machine '{socket.gethostname()}'"
+ elif settings.DEVSERVER:
+ message += " on a dev machine using 'runserver'"
+ print(f"..{message=}\n..{editor=}")
cmd_commit = [git, "commit", "-m", message, "--author", f"{editor}"]
commands.append(cmd_commit)