[PATCH] convert: Make P4 conversion cope with keywords, binary files and symbolic links
Frank A. Kingswood
frank at kingswood-consulting.co.uk
Mon Apr 13 10:02:01 CDT 2009
Patrick Mézard wrote:
> I have attached the log for test-convert-p4-filetypes on MacOSX. Here is the annotated inline diff:
>
>> -add //depot/test-mercurial-import/file_text+S#1
>> -add //depot/test-mercurial-import/file_text+S2#1
>> +add //depot/test-mercurial-import/file_text+S#1
>> +add //depot/test-mercurial-import/file_text+S2#1
>>
> They come from FS case-insensitivity and can be fixed by appending a $T2 instead of $T where
>
> T2=`echo $T | tr [:upper:] [:lower:]`
>
>
Easier fixed by making TYPES in the script all lower case.
> file_resource and file_uresource are missing on macosx, I don't know why
>
I guess this is where it P4 does something quite different. Can you try
running with this patch and report what it says?
diff -r d1f850860f4d hgext/convert/p4.py
--- a/hgext/convert/p4.py Sat Apr 04 11:54:51 2009 +0100
+++ b/hgext/convert/p4.py Mon Apr 13 15:59:06 2009 +0100
@@ -158,6 +158,7 @@
raise IOError(d["generic"], data)
elif code == "stat":
+ print repr(d)
p4type = self.re_type.match(d["type"])
if p4type:
mode = ""
@@ -172,6 +173,7 @@
keywords = self.re_keywords
elif code == "text" or code == "binary":
+ print repr(d)
contents += data
if mode is None:
> I think grep -H is a GNU extension, can we avoid it ?
>
I think it can be removed without problem
>> % revision 0
>> 36 files updated, 0 files merged, 0 files removed, 0 files unresolved
>> ==> dst/file_binary <==
>> -this is binary
>> +-n this is binary
>> +
>>
> I cannot explain this.
>
Hmm, looks like OSX does not have echo -n.
We can remove the -n without problem.
Frank
--
------------------------------------------------------------------------
Frank A. Kingswood frank at kingswood-consulting.co.uk
Cambridge, United Kingdom +44-870-095 0000
More information about the Mercurial-devel
mailing list