changeset 907:d153586c28f8

git_handler: properly handle paths when files converge filectx.renamed() returns a 2-tuple or None. memfilectx.__init__ expects the copied argument to be either None or a string. Before, we were passing a 2-tuple, leading to the memfilectx storing the wrong type. This eventually resulted in doing a key lookup against a manifest with a 2-tuple, which made manifest.c throw an error.
author Gregory Szorc <gps@mozilla.com>
date Thu, 14 May 2015 12:51:37 -0700
parents 286555803dae
children e5b10a710036
files hggit/git_handler.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/git_handler.py
+++ b/hggit/git_handler.py
@@ -866,7 +866,10 @@
                 fc = context.filectx(self.repo, f, changeid=memctx.p1().rev())
                 data = fc.data()
                 e = fc.flags()
-                copied_path = fc.renamed()
+                copied_path = None
+                copied = fc.renamed()
+                if copied:
+                    copied_path = copied[0]
 
             try:
                 return context.memfilectx(self.repo, f, data,