diff --git a/gestion/darcs_send_changes.py b/gestion/darcs_send_changes.py index 61d81a32..0e632d75 100755 --- a/gestion/darcs_send_changes.py +++ b/gestion/darcs_send_changes.py @@ -91,7 +91,9 @@ def get_patch_properties(hash): if os.path.exists(ID_FILE): id = file(ID_FILE).read().strip() else: - id = shortrepo + # Ne devrait jamais être appelé + import socket + id = "%s:%s" % (socket.gethostname(), shortrepo) return { 'author': prop.attrib['author'], 'hostname': hostname, 'id': id, @@ -290,6 +292,18 @@ if __name__ == "__main__": cprint("Pas de dépôt darcs trouvé") sys.exit(1) + + if not os.path.exists(CONF_PATH): + partial_path = '' + for rep in CONF_PATH.split('/'): + partial_path += rep+'/' + if not os.path.exists(partial_path): + os.mkdir(os.path.realpath(partial_path)) + + if not os.path.exists(ID_FILE): + import socket + open(ID_FILE, "w" ).write("%s:%s" % (socket.gethostname(), os.path.basename(os.getcwd()))) + if not os.path.exists(DATE_FILE): try: # Sélection du patch façon darcs @@ -302,8 +316,6 @@ if __name__ == "__main__": patches = getnew(lastdate) if c == "none": if patches: - if not os.path.exists(CONF_PATH): - os.mkdir(CONF_PATH) open(DATE_FILE, "w").write(patches[-1].split("-", 1)[0]) patches = [] else: