Show More
@@ -177,6 +177,7 b' pypats = [' | |||||
177 | "always assign an opened file to a variable, and close it afterwards"), |
|
177 | "always assign an opened file to a variable, and close it afterwards"), | |
178 | (r'[\s\(](open|file)\([^)]*\)\.', |
|
178 | (r'[\s\(](open|file)\([^)]*\)\.', | |
179 | "always assign an opened file to a variable, and close it afterwards"), |
|
179 | "always assign an opened file to a variable, and close it afterwards"), | |
|
180 | (r'(?i)descendent', "the proper spelling is descendAnt"), | |||
180 | ], |
|
181 | ], | |
181 | # warnings |
|
182 | # warnings | |
182 | [ |
|
183 | [ |
@@ -1456,7 +1456,7 b' class localrepository(repo.repository):' | |||||
1456 |
|
1456 | |||
1457 | def changegroupsubset(self, bases, heads, source): |
|
1457 | def changegroupsubset(self, bases, heads, source): | |
1458 | """Compute a changegroup consisting of all the nodes that are |
|
1458 | """Compute a changegroup consisting of all the nodes that are | |
1459 |
descend |
|
1459 | descendants of any of the bases and ancestors of any of the heads. | |
1460 | Return a chunkbuffer object whose read() method will return |
|
1460 | Return a chunkbuffer object whose read() method will return | |
1461 | successive changegroup chunks. |
|
1461 | successive changegroup chunks. | |
1462 |
|
1462 |
@@ -491,7 +491,7 b' class revlog(object):' | |||||
491 | return nonodes |
|
491 | return nonodes | |
492 | lowestrev = min([self.rev(n) for n in roots]) |
|
492 | lowestrev = min([self.rev(n) for n in roots]) | |
493 | else: |
|
493 | else: | |
494 |
roots = [nullid] # Everybody's a descend |
|
494 | roots = [nullid] # Everybody's a descendant of nullid | |
495 | lowestrev = nullrev |
|
495 | lowestrev = nullrev | |
496 | if (lowestrev == nullrev) and (heads is None): |
|
496 | if (lowestrev == nullrev) and (heads is None): | |
497 | # We want _all_ the nodes! |
|
497 | # We want _all_ the nodes! | |
@@ -528,7 +528,7 b' class revlog(object):' | |||||
528 | r = self.rev(n) |
|
528 | r = self.rev(n) | |
529 | if r >= lowestrev: |
|
529 | if r >= lowestrev: | |
530 | if n not in ancestors: |
|
530 | if n not in ancestors: | |
531 |
# If we are possibly a descend |
|
531 | # If we are possibly a descendant of one of the roots | |
532 | # and we haven't already been marked as an ancestor |
|
532 | # and we haven't already been marked as an ancestor | |
533 | ancestors.add(n) # Mark as ancestor |
|
533 | ancestors.add(n) # Mark as ancestor | |
534 | # Add non-nullid parents to list of nodes to tag. |
|
534 | # Add non-nullid parents to list of nodes to tag. | |
@@ -562,41 +562,41 b' class revlog(object):' | |||||
562 | lowestrev = nullrev |
|
562 | lowestrev = nullrev | |
563 | roots = [nullid] |
|
563 | roots = [nullid] | |
564 | # Transform our roots list into a set. |
|
564 | # Transform our roots list into a set. | |
565 |
descend |
|
565 | descendants = set(roots) | |
566 | # Also, keep the original roots so we can filter out roots that aren't |
|
566 | # Also, keep the original roots so we can filter out roots that aren't | |
567 | # 'real' roots (i.e. are descended from other roots). |
|
567 | # 'real' roots (i.e. are descended from other roots). | |
568 |
roots = descend |
|
568 | roots = descendants.copy() | |
569 | # Our topologically sorted list of output nodes. |
|
569 | # Our topologically sorted list of output nodes. | |
570 | orderedout = [] |
|
570 | orderedout = [] | |
571 | # Don't start at nullid since we don't want nullid in our output list, |
|
571 | # Don't start at nullid since we don't want nullid in our output list, | |
572 | # and if nullid shows up in descedents, empty parents will look like |
|
572 | # and if nullid shows up in descedents, empty parents will look like | |
573 |
# they're descend |
|
573 | # they're descendants. | |
574 | for r in xrange(max(lowestrev, 0), highestrev + 1): |
|
574 | for r in xrange(max(lowestrev, 0), highestrev + 1): | |
575 | n = self.node(r) |
|
575 | n = self.node(r) | |
576 |
isdescend |
|
576 | isdescendant = False | |
577 |
if lowestrev == nullrev: # Everybody is a descend |
|
577 | if lowestrev == nullrev: # Everybody is a descendant of nullid | |
578 |
isdescend |
|
578 | isdescendant = True | |
579 |
elif n in descend |
|
579 | elif n in descendants: | |
580 |
# n is already a descend |
|
580 | # n is already a descendant | |
581 |
isdescend |
|
581 | isdescendant = True | |
582 | # This check only needs to be done here because all the roots |
|
582 | # This check only needs to be done here because all the roots | |
583 |
# will start being marked is descend |
|
583 | # will start being marked is descendants before the loop. | |
584 | if n in roots: |
|
584 | if n in roots: | |
585 | # If n was a root, check if it's a 'real' root. |
|
585 | # If n was a root, check if it's a 'real' root. | |
586 | p = tuple(self.parents(n)) |
|
586 | p = tuple(self.parents(n)) | |
587 |
# If any of its parents are descend |
|
587 | # If any of its parents are descendants, it's not a root. | |
588 |
if (p[0] in descend |
|
588 | if (p[0] in descendants) or (p[1] in descendants): | |
589 | roots.remove(n) |
|
589 | roots.remove(n) | |
590 | else: |
|
590 | else: | |
591 | p = tuple(self.parents(n)) |
|
591 | p = tuple(self.parents(n)) | |
592 |
# A node is a descend |
|
592 | # A node is a descendant if either of its parents are | |
593 |
# descend |
|
593 | # descendants. (We seeded the dependents list with the roots | |
594 | # up there, remember?) |
|
594 | # up there, remember?) | |
595 |
if (p[0] in descend |
|
595 | if (p[0] in descendants) or (p[1] in descendants): | |
596 |
descend |
|
596 | descendants.add(n) | |
597 |
isdescend |
|
597 | isdescendant = True | |
598 |
if isdescend |
|
598 | if isdescendant and ((ancestors is None) or (n in ancestors)): | |
599 |
# Only include nodes that are both descend |
|
599 | # Only include nodes that are both descendants and ancestors. | |
600 | orderedout.append(n) |
|
600 | orderedout.append(n) | |
601 | if (ancestors is not None) and (n in heads): |
|
601 | if (ancestors is not None) and (n in heads): | |
602 | # We're trying to figure out which heads are reachable |
|
602 | # We're trying to figure out which heads are reachable |
@@ -211,7 +211,7 b' class Merge3Text(object):' | |||||
211 | Method is as follows: |
|
211 | Method is as follows: | |
212 |
|
212 | |||
213 | The two sequences align only on regions which match the base |
|
213 | The two sequences align only on regions which match the base | |
214 |
and both descend |
|
214 | and both descendants. These are found by doing a two-way diff | |
215 | of each one against the base, and then finding the |
|
215 | of each one against the base, and then finding the | |
216 | intersections between those regions. These "sync regions" |
|
216 | intersections between those regions. These "sync regions" | |
217 | are by definition unchanged in both and easily dealt with. |
|
217 | are by definition unchanged in both and easily dealt with. | |
@@ -315,7 +315,7 b' class Merge3Text(object):' | |||||
315 | mismatch_region = staticmethod(mismatch_region) |
|
315 | mismatch_region = staticmethod(mismatch_region) | |
316 |
|
316 | |||
317 | def find_sync_regions(self): |
|
317 | def find_sync_regions(self): | |
318 |
"""Return a list of sync regions, where both descend |
|
318 | """Return a list of sync regions, where both descendants match the base. | |
319 |
|
319 | |||
320 | Generates a list of (base1, base2, a1, a2, b1, b2). There is |
|
320 | Generates a list of (base1, base2, a1, a2, b1, b2). There is | |
321 | always a zero-length sync region at the end of all the files. |
|
321 | always a zero-length sync region at the end of all the files. |
General Comments 0
You need to be logged in to leave comments.
Login now