summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJustin Patrin <papercrane@gmail.com>2006-11-15 20:43:20 +0000
committerJustin Patrin <papercrane@gmail.com>2006-11-15 20:43:20 +0000
commit1679b2104cef6e0c93fb3fdcf38e734ce8d597af (patch)
treeb880a91d9195fd52eaf868469dbb85b749434708 /contrib
parent06dd6d5b88377488dae176a0b3a18237d0ab9780 (diff)
mtnpatch: update for newer monotone versions, move patch command to end to allow for rename or add and patch
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/mtnpatch.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/mtnpatch.py b/contrib/mtnpatch.py
index 73143dba69..f7abb6393d 100755
--- a/contrib/mtnpatch.py
+++ b/contrib/mtnpatch.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
import sys, os, string, getopt, re
-mtncmd = "monotone"
+mtncmd = "mtn"
def main(argv = None):
if argv is None:
@@ -18,10 +18,6 @@ def main(argv = None):
input = open(list[0], 'r')
renameFrom = ""
cmd = ""
- if reverse:
- print "patch -R -p0 < %s" % list[0]
- else:
- print "patch -p0 < %s" % list[0]
for line in input:
if len(line) > 0:
if line[0] == '#':
@@ -29,17 +25,17 @@ def main(argv = None):
if matches is not None:
cmd = matches.group(1)
fileName = matches.group(2)
- if cmd == "delete_file":
+ if cmd == "delete":
if reverse:
print "%s add %s" % (mtncmd, fileName)
else:
print "%s drop -e %s" % (mtncmd, fileName)
- elif cmd == "add_file":
+ elif cmd == "add":
if reverse:
print "%s drop -e %s" % (mtncmd, fileName)
else:
print "%s add %s" % (mtncmd, fileName)
- elif cmd == "rename_file":
+ elif cmd == "rename":
renameFrom = fileName
elif cmd == "to" and renameFrom != "":
if reverse:
@@ -49,6 +45,10 @@ def main(argv = None):
renameFrom = ""
else:
cmd = ""
+ if reverse:
+ print "patch -R -p0 < %s" % list[0]
+ else:
+ print "patch -p0 < %s" % list[0]
if __name__ == "__main__":
sys.exit(main())