|
From: | Daniel Carrera |
Subject: | Re: [Monotone-devel] Hooks |
Date: | Fri, 10 Oct 2008 17:27:12 +0200 |
User-agent: | Thunderbird 2.0.0.17 (Macintosh/20080914) |
Ludovic Brenta wrote:
I'm not very comfortable with lua either and my first move was to write a shell script along the lines of: #!/bin/sh head=$(mtn automate get_base_workspace_revision) parent=$(mtn automate select p:$head) sed -i -r 's,old_revision \[.*\],old_revision [$parent],' _MTN/revision but this approach fails as soon as the head has more than one parent. That's why, until now, I stuck to the manual way.
How about this?: count=$(mtn automate parents $head|wc -l|sed 's/ //g') if [ $count != "1" ]; then echo "Cannot undo. More than one parent." exit fi parents=$(mtn automate parents $head) sed -i -r 's,old_revision \[.*\],old_revision [$parent],' _MTN/revision
[Prev in Thread] | Current Thread | [Next in Thread] |