Jump to content


swarm diff issue

swarm

  • Please log in to reply
8 replies to this topic

#1 wanqiang

wanqiang

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 26 June 2013 - 03:28 AM

Hello
I have a question on swarm, below are two revision content:
#//streams_testground/child23/tst/A.py#7
import sys
import re

def P4_GetClients(basedate,p4port):
retcode = 0
p4 = None
try:
  
#//streams_testground/child23/tst/A.py#8
import sys
import re

def P4_GetClients(basedate,p4port):
retcode = 0
print "hello"
p4 = None
#review test
try:
diff part

#swarm diff result
a.png

When I click on the ‘Ignore Whitespace’, it’s like below:
b.png

My question is why the diff result in the first picture shows up?
When I create new p4 file B.py and copy content from A.py#7, and then update B.py with same content as A.py#8, the swarm diff result of B.py is OK.

B.py is in the same folder as A.py.

I think the swarm diff error is due to the file ‘A.py’ property, if new p4 file is copied/merged from it, also the swarm diff has error. Click ‘Ignore WhiteSpace’ then will get a better diff result as shown in the second picture.
If create new file, and copy content from A.py, then the diff result is OK.
Anyone can help me why the issue happen and how to solve that?

Thanks! :)

#2 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 28 June 2013 - 07:56 PM

Looks like a bug to me. I'll check with the dev team and file an issue for you.

#3 wanqiang

wanqiang

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 01 July 2013 - 01:58 AM

Thank you P4Matt! :)

#4 P4Geoff

P4Geoff

    Advanced Member

  • Members
  • PipPipPip
  • 217 posts

Posted 03 July 2013 - 08:51 PM

I'm wondering if there are some odd non-printable characters present in one of the files or something else going on.

To ease attempting to reproduce and repair your issue could you kindly download A.py#7 and A.py#8 and email me a copy?
Swarm links to do the download should be:
http://sf-rel-ops-04...3/tst/A.py?v=#7
http://sf-rel-ops-04...3/tst/A.py?v=#8

Though getting them via p4, p4v, etc. should be fine too. I have messaged you my email address.

Thanks for any assistance on tracking down this issue and apologies for the difficulty.

#5 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 03 July 2013 - 09:06 PM

Additionally can you send us the 'A.py,v' file from your server? It should be located in your depot root at 'streams_testground/child23/tst'. That way we will have precisely the same content for our server as you have.

#6 wanqiang

wanqiang

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 04 July 2013 - 03:58 AM

Thanks P4Geoff and P4Matt, I sent out the files you required, help check.

#7 P4Geoff

P4Geoff

    Advanced Member

  • Members
  • PipPipPip
  • 217 posts

Posted 04 July 2013 - 07:01 PM

Thanks very much for emailing the file contents, it was very helpful!

I can replicate your issue in Swarm. Also, if you use p4 describe/diff2 on the command line or p4 merge with "Recognize Line Endings" you will also find these files cause strange output.

The files are using a CR (0x0D) line ending which appear to be causing the issues.

As an interm fix, if you click 'ignore whitespace' in Swarm the files diff nicely. When running p4 describe/diff2 passing -dw will have the same improving effect.


We've filled a job for this issue and have some ideas on how we can improve our handling of these files longer term.

Thanks very much for bringing this issue to our attention and helping us reproduce the issue.

#8 wanqiang

wanqiang

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 05 July 2013 - 07:03 AM

Thanks P4Geoff to figure out the root cause.

#9 P4Geoff

P4Geoff

    Advanced Member

  • Members
  • PipPipPip
  • 217 posts

Posted 05 July 2013 - 04:26 PM

View Postwanqiang, on 05 July 2013 - 07:03 AM, said:

Thanks P4Geoff to figure out the root cause.

Happy to help; sorry I can't offer you a patch right away to fix the behaviour, it looks fixable but tricky enough its going to take a bit.


If you have this sort of issue popping up regularly you could discuss the 'LineEnd' feature in the client specification with our support group:
http://www.perforce....ref/client.html

I suspect setting your LineEnd to 'Share' would cause the files line endings to be normalized on submit.
This would mean that you lose the original line endings on sync though which may well not be a viable option for you.



Also tagged with one or more of these keywords: swarm

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users