Re: is git-p4 compatible with p4/linux?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 18, 2013 at 5:09 PM, Pete Wyckoff <pw@xxxxxxxx> wrote:
>> First issue
>> -----------
>>
>> git-p4 assumes the output of 'p4 print' adds a newline to the
>> target.  To work around this, git-p4.py strips the last char from
>> symlinks as shown in the following snippet:
>>
>>     if type_base == "symlink":
>>         git_mode = "120000"
>>         # p4 print on a symlink contains "target\n"; remove the newline
>>         data = ''.join(contents)
>>         contents = [data[:-1]]

This line could be made more robust by changing it to:

    contents = [data.rstrip('\n')]

That way it only strips off newlines if they exist, which essentially
papers over these rogue depot files.
Alternatively, it could use rstrip() with no arguments to cast a wider
net and catch all whitespace.
-- 
David
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]