comparison mercurial/merge.py @ 4354:8aee687f0214

merge: fix quadratic behavior in find-copies
author Matt Mackall <mpm@selenic.com>
date Mon, 16 Apr 2007 12:24:52 -0500
parents 4787e2b0dd03
children 10edaed7f909 c04c96504a12
comparison
equal deleted inserted replaced
4348:b633f470944e 4354:8aee687f0214
103 """ 103 """
104 104
105 def findold(fctx): 105 def findold(fctx):
106 "find files that path was copied from, back to linkrev limit" 106 "find files that path was copied from, back to linkrev limit"
107 old = {} 107 old = {}
108 seen = {}
108 orig = fctx.path() 109 orig = fctx.path()
109 visit = [fctx] 110 visit = [fctx]
110 while visit: 111 while visit:
111 fc = visit.pop() 112 fc = visit.pop()
113 s = str(fc)
114 if s in seen:
115 continue
116 seen[s] = 1
112 if fc.path() != orig and fc.path() not in old: 117 if fc.path() != orig and fc.path() not in old:
113 old[fc.path()] = 1 118 old[fc.path()] = 1
114 if fc.rev() < limit: 119 if fc.rev() < limit:
115 continue 120 continue
116 visit += fc.parents() 121 visit += fc.parents()