[darcs_send_changes.py] initialise correctement le repo darcs lorsque celui-ci ne l'est pas
darcs-hash:20081218010143-bd074-097df06a0e7d7a21a6d0b537a586af692d58e25f.gz
This commit is contained in:
parent
9982f1286e
commit
d8b4c7de91
1 changed files with 15 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue