Envoie des patches dans le bon ordre.
darcs-hash:20071218010257-af139-af262846e89de38130649587704b0bb9c08bb070.gz
This commit is contained in:
parent
072d2a9609
commit
34377b4e70
1 changed files with 9 additions and 7 deletions
|
@ -206,7 +206,7 @@ def select(patches):
|
|||
'''Sélection interactive de patches'''
|
||||
decided = []
|
||||
while patches:
|
||||
(status, changelog) = darcs("changes --match='hash %s'" % patches[-1])
|
||||
(status, changelog) = darcs("changes --match='hash %s'" % patches[0])
|
||||
if status == 0:
|
||||
print
|
||||
print changelog
|
||||
|
@ -219,20 +219,20 @@ def select(patches):
|
|||
("v", "voir le patch"),
|
||||
Exit])
|
||||
if c == "y":
|
||||
decided.append((True, patches.pop()))
|
||||
decided.append((True, patches.pop(0)))
|
||||
elif c == "n":
|
||||
decided.append((False, patches.pop()))
|
||||
decided.append((False, patches.pop(0)))
|
||||
elif c == "p":
|
||||
if decided:
|
||||
patches.append(decided.pop()[1])
|
||||
patches.insert(0, decided.pop()[1])
|
||||
else:
|
||||
cprint("Déjà au début de la liste!", "rouge")
|
||||
elif c == "e":
|
||||
while patches:
|
||||
decided.append((True, patches.pop()))
|
||||
decided.append((True, patches.pop(0)))
|
||||
elif c == "i":
|
||||
while patches:
|
||||
decided.append((False, patches.pop()))
|
||||
decided.append((False, patches.pop(0)))
|
||||
|
||||
count = [x[0] for x in decided].count(True)
|
||||
if count:
|
||||
|
@ -275,7 +275,6 @@ if __name__ == "__main__":
|
|||
if not lastdate.isdigit or len(lastdate) >= 14:
|
||||
__usage("date invalide")
|
||||
lastdate += (14 - len(lastdate)) * "0"
|
||||
print lastdate
|
||||
else:
|
||||
__usage("option inconnue « %s »'" % opt)
|
||||
recipient = arg
|
||||
|
@ -308,7 +307,10 @@ if __name__ == "__main__":
|
|||
else:
|
||||
open(DATE_FILE, "w").write("19700101000000")
|
||||
elif c == "select":
|
||||
# On commence par les plus récent
|
||||
patches.reverse()
|
||||
patches = select(patches)
|
||||
patches.reverse()
|
||||
except OSError, e:
|
||||
if e.errno == 11:
|
||||
# Quand c'est darcs qui lance la commande on ne pas lire
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue