mercurial/copies.py
branchstable
changeset 10874 4f11978ae45d
parent 10463 5ddde896a19d
child 12683 ada47c38f4e5
equal deleted inserted replaced
10872:9606edb8777e 10874:4f11978ae45d
   115     copy = {}
   115     copy = {}
   116     fullcopy = {}
   116     fullcopy = {}
   117     diverge = {}
   117     diverge = {}
   118 
   118 
   119     def related(f1, f2, limit):
   119     def related(f1, f2, limit):
       
   120         # Walk back to common ancestor to see if the two files originate
       
   121         # from the same file. Since workingfilectx's rev() is None it messes
       
   122         # up the integer comparison logic, hence the pre-step check for
       
   123         # None (f1 and f2 can only be workingfilectx's initially).
       
   124 
       
   125         if f1 == f2:
       
   126             return f1 # a match
       
   127 
   120         g1, g2 = f1.ancestors(), f2.ancestors()
   128         g1, g2 = f1.ancestors(), f2.ancestors()
   121         try:
   129         try:
       
   130             f1r, f2r = f1.rev(), f2.rev()
       
   131 
       
   132             if f1r is None:
       
   133                 f1 = g1.next()
       
   134             if f2r is None:
       
   135                 f2 = g2.next()
       
   136 
   122             while 1:
   137             while 1:
   123                 f1r, f2r = f1.rev(), f2.rev()
   138                 f1r, f2r = f1.rev(), f2.rev()
   124                 if f1r > f2r:
   139                 if f1r > f2r:
   125                     f1 = g1.next()
   140                     f1 = g1.next()
   126                 elif f2r > f1r:
   141                 elif f2r > f1r: