Re: [BUG] git p4 clone fails when p4 sizes does not return 'fileSize' key

2018-04-18 Thread Thandesha VK
laces are already doing key check in the hash. Looks like this line was missed out. On Wed, Apr 18, 2018 at 4:08 AM, Luke Diamand <l...@diamand.org> wrote: > On 17 April 2018 at 20:12, Thandesha VK <tha...@gmail.com> wrote: >> I have few cases where even p4 -G sizes (or p4 sizes

Re: [PATCH 1/1] git-p4: fix `sync --verbose` traceback due to 'fileSize'

2018-04-17 Thread Thandesha VK
> returns "fileSize". > So, it's definitely not a reason to abort. > > Thank you, > Andrey > > From: Thandesha VK <tha...@gmail.com> >> My fix is for the case where p4 -G sizes not returning the key and >> value for fileSize. This can happen in some cases.

Re: [PATCH 1/1] git-p4: fix `sync --verbose` traceback due to 'fileSize'

2018-04-17 Thread Thandesha VK
= self.stripRepoPath(file['depotFile'], >>> self.branchPrefixes) >>> relPath = self.encodeWithUTF8(relPath) >>> if verbose: >>> -size = int(self.stream_file['fileSize']) >>> -sys.stdout.write('\r%s --> %s (%i MB)\n' % (file['depotFile'], >>> relPath, size/1024/1024)) >>> +size = file.get('fileSize', None) >>> +if size is None: >>> +sizeStr = '' >>> +else: >>> +sizeStr = ' (%i MB)' % (int(size)/1024/1024) >>> +sys.stdout.write('\r%s --> %s%s\n' % (file['depotFile'], >>> relPath, sizeStr)) >>> sys.stdout.flush() >>> >>> (type_base, type_mods) = split_p4_type(file["type"]) >>> -- >>> 2.16.1 >>> >> Thanks, that looks like a good fix to me. Ack. -- Thanks & Regards Thandesha VK | Cellphone +1 (703) 459-5386

Re: [BUG] git p4 clone fails when p4 sizes does not return 'fileSize' key

2018-04-17 Thread Thandesha VK
o one step further and use `p4 -G sizes` to obtain the > "fileSize" when it's not returned by `p4 -G print`? > Or is it an overkill for a simple verbose print out? > > Also, please, find one comment inline below. > > Thank you, > Andrey > > From: Thandesha VK

Re: [BUG] git p4 clone fails when p4 sizes does not return 'fileSize' key

2018-04-17 Thread Thandesha VK
change existing behavior; > * if "fileSize" is not known: > ** your patch makes streamOneP4File() not print anything; > ** my patch makes streamOneP4File() print "%s --> %s". > > Hope, I'm clearer this time. > > Thank you, > Andrey > > From: Thande

Re: [BUG] git p4 clone fails when p4 sizes does not return 'fileSize' key

2018-04-17 Thread Thandesha VK
> "--verbose" option. > > Andrey Mazo (1): > git-p4: fix `sync --verbose` traceback due to 'fileSize' > > git-p4.py | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > > base-commit: 468165c1d8a442994a825f3684528361727cd8c0 > -- > 2.16.1 > -- Thanks & Regards Thandesha VK | Cellphone +1 (703) 459-5386

[BUG] git p4 clone fails when p4 sizes does not return 'fileSize' key

2018-04-16 Thread Thandesha VK
git p4 clone fails when p4 sizes does not return 'fileSize' key. There are few cases when p4 sizes returens 0 size and with marshaled output, it doesn’t return the fileSize attribute. Here is the demonstration and potential fix $ cd /tmp/git/ $ git remote -v origin