[oe-commits] org.oe.dev mtnpatch: update for newer monotone versions, move patch command to end to allow for rename or add and patch

justinp commit openembedded-commits at lists.openembedded.org
Wed Nov 15 20:44:36 UTC 2006


mtnpatch: update for newer monotone versions, move patch command to end to allow for rename or add and patch

Author: justinp at openembedded.org
Branch: org.openembedded.dev
Revision: 5030fa4fd12eecce406862803a77d7b278ac71d7
ViewMTN: http://monotone.openembedded.org/revision.psp?id=5030fa4fd12eecce406862803a77d7b278ac71d7
Files:
1
contrib/mtnpatch.py
Diffs:

#
# mt diff -r7d8e0f1f71d0135c70452e20f8b14f880c079a87 -r5030fa4fd12eecce406862803a77d7b278ac71d7
#
# 
# 
# patch "contrib/mtnpatch.py"
#  from [ac24174963d8b986599a91a0e9c36648d8b0c120]
#    to [548eb57f429903903e7cf28f99fc5bb8213dbf3a]
# 
============================================================
--- contrib/mtnpatch.py	ac24174963d8b986599a91a0e9c36648d8b0c120
+++ contrib/mtnpatch.py	548eb57f429903903e7cf28f99fc5bb8213dbf3a
@@ -1,7 +1,7 @@ import sys, os, string, getopt, re
 #!/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())






More information about the Openembedded-commits mailing list