mercurial/copies.py
changeset 24010 a63c2b159df4
parent 23982 751d1138ce35
child 24011 d7d08337b3f6
equal deleted inserted replaced
24009:00d331763442 24010:a63c2b159df4
   206         return _forwardcopies(x, y)
   206         return _forwardcopies(x, y)
   207     if a == y:
   207     if a == y:
   208         return _backwardrenames(x, y)
   208         return _backwardrenames(x, y)
   209     return _chain(x, y, _backwardrenames(x, a), _forwardcopies(a, y))
   209     return _chain(x, y, _backwardrenames(x, a), _forwardcopies(a, y))
   210 
   210 
       
   211 def _computenonoverlap(repo, m1, m2, ma):
       
   212     """Computes the files exclusive to m1 and m2.
       
   213     This is its own function so extensions can easily wrap this call to see what
       
   214     files mergecopies is about to process.
       
   215     """
       
   216     u1 = _nonoverlap(m1, m2, ma)
       
   217     u2 = _nonoverlap(m2, m1, ma)
       
   218 
       
   219     if u1:
       
   220         repo.ui.debug("  unmatched files in local:\n   %s\n"
       
   221                       % "\n   ".join(u1))
       
   222     if u2:
       
   223         repo.ui.debug("  unmatched files in other:\n   %s\n"
       
   224                       % "\n   ".join(u2))
       
   225     return u1, u2
       
   226 
   211 def mergecopies(repo, c1, c2, ca):
   227 def mergecopies(repo, c1, c2, ca):
   212     """
   228     """
   213     Find moves and copies between context c1 and c2 that are relevant
   229     Find moves and copies between context c1 and c2 that are relevant
   214     for merging.
   230     for merging.
   215 
   231 
   259     fullcopy = {}
   275     fullcopy = {}
   260     diverge = {}
   276     diverge = {}
   261 
   277 
   262     repo.ui.debug("  searching for copies back to rev %d\n" % limit)
   278     repo.ui.debug("  searching for copies back to rev %d\n" % limit)
   263 
   279 
   264     u1 = _nonoverlap(m1, m2, ma)
   280     u1, u2 = _computenonoverlap(repo, m1, m2, ma)
   265     u2 = _nonoverlap(m2, m1, ma)
       
   266 
       
   267     if u1:
       
   268         repo.ui.debug("  unmatched files in local:\n   %s\n"
       
   269                       % "\n   ".join(u1))
       
   270     if u2:
       
   271         repo.ui.debug("  unmatched files in other:\n   %s\n"
       
   272                       % "\n   ".join(u2))
       
   273 
   281 
   274     for f in u1:
   282     for f in u1:
   275         checkcopies(ctx, f, m1, m2, ca, limit, diverge, copy, fullcopy)
   283         checkcopies(ctx, f, m1, m2, ca, limit, diverge, copy, fullcopy)
   276 
   284 
   277     for f in u2:
   285     for f in u2: