[Pkg-haskell-commits] darcs: tools: Make mass-change amend patches on second run
Joachim Breitner
mail at joachim-breitner.de
Fri May 24 22:26:25 UTC 2013
Fri May 24 22:26:06 UTC 2013 Joachim Breitner <mail at joachim-breitner.de>
* Make mass-change amend patches on second run
Ignore-this: 456cb71290b672bc862d950b1ec3aef
M ./mass-change.sh -4 +25
Fri May 24 22:26:06 UTC 2013 Joachim Breitner <mail at joachim-breitner.de>
* Make mass-change amend patches on second run
Ignore-this: 456cb71290b672bc862d950b1ec3aef
diff -rN -u old-tools//mass-change.sh new-tools//mass-change.sh
--- old-tools//mass-change.sh 2013-05-24 22:26:24.893563181 +0000
+++ new-tools//mass-change.sh 2013-05-24 22:26:24.925544991 +0000
@@ -1,5 +1,11 @@
#!/bin/bash
+if [ "$1" = "-n" ]
+then
+ dry_run=1
+ shift
+fi
+
message=$1
shift
action=$1
@@ -52,9 +58,24 @@
popd
continue
fi
- echo "About to commit the following change:"
- darcs diff|colordiff
- debchange --changelog=changelog "$message"
- debcommit
+ if [ -z "$dry_run" ]
+ then
+ echo "About to commit the following change:"
+ darcs diff|colordiff
+
+ lastchange="$(darcs changes --last 1 --xml-output|xpath -e 'changelog/patch/name/text()' -q)"
+ if [ "$lastchange" = "$message" ]
+ then
+ echo "Previous commit message was the same, amending the patch"
+ yes | darcs amend --all
+ else
+ debchange --changelog=changelog "$message"
+ debcommit
+ fi
+ else
+ echo "Would have commited the following change:"
+ darcs diff|colordiff
+ darcs revert --all
+ fi
popd
done
More information about the Pkg-haskell-commits
mailing list