# HG changeset patch # User Gregory Szorc # Date 1431633097 25200 # Thu May 14 12:51:37 2015 -0700 # Node ID d153586c28f8e639b17a049ab599917ec8a87331 # Parent 286555803dae49c302e9e37b468ae94d1dd58962 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. diff --git a/hggit/git_handler.py b/hggit/git_handler.py --- 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,