]> scripts.mit.edu Git - wizard.git/commitdiff
Don't discard our changes! Also, better debugging info.
authorEdward Z. Yang <ezyang@mit.edu>
Sat, 23 Jul 2011 09:47:49 +0000 (05:47 -0400)
committerEdward Z. Yang <ezyang@mit.edu>
Sat, 23 Jul 2011 09:47:49 +0000 (05:47 -0400)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
wizard/merge.py

index b4d8b35bd3f14754a2fd616e07fac2131af66949..1b99a7a664baa284faa8c55abac3600a01b30cf6 100644 (file)
@@ -161,6 +161,7 @@ def merge(common_id, theirs_id,
             nl = "\n"
         theirs_newlines[file] = nl
 
+    shell.call("git", "reset", "--hard", ours_id)
     theirs_tree = shell.eval("git", "rev-parse", "%s^{tree}" % theirs_id)
     for file in ours_theirs_diff:
         try:
@@ -174,9 +175,9 @@ def merge(common_id, theirs_id,
             continue
         if theirs_nl != ours_nl:
             if ours_nl is None:
-                logging.debug("File had no newlines, ignoring newline style")
+                logging.debug("Our file %s had no newlines, ignoring newline style", file)
             else:
-                logging.info("Converting our file (3) from %s to %s newlines", repr(ours_nl), repr(theirs_nl))
+                logging.info("Converting our file %s (3) from %s to %s newlines", file, repr(ours_nl), repr(theirs_nl))
                 convert_newline(file, theirs_nl)
                 shell.eval("git", "add", file) # XXX batch this
     prepare_config() # for Wizard, this usually genericizes config files
@@ -198,9 +199,9 @@ def merge(common_id, theirs_id,
             continue
         if theirs_nl != common_nl:
             if common_nl is None:
-                logging.debug("File had no newlines, ignoring newline style")
+                logging.debug("Common file %s had no newlines, ignoring newline style", file)
             else:
-                logging.info("Converting common file (1) from %s to %s newlines", repr(common_nl), repr(theirs_nl))
+                logging.info("Converting common file %s (1) from %s to %s newlines", file, repr(common_nl), repr(theirs_nl))
                 convert_newline(file, theirs_nl)
                 shell.eval("git", "add", file) # XXX batch
     common_tree = shell.eval("git", "write-tree")