Show More
@@ -2527,52 +2527,9 b' class overlayworkingctx(committablectx):' | |||||
2527 | def isdirty(self, path): |
|
2527 | def isdirty(self, path): | |
2528 | return path in self._cache |
|
2528 | return path in self._cache | |
2529 |
|
2529 | |||
2530 | def nofilechanges(self): |
|
|||
2531 | # We need to discard any keys that are actually clean before the empty |
|
|||
2532 | # commit check. |
|
|||
2533 | self._compact() |
|
|||
2534 | return len(self._cache) == 0 |
|
|||
2535 |
|
||||
2536 | def clean(self): |
|
2530 | def clean(self): | |
2537 | self._cache = {} |
|
2531 | self._cache = {} | |
2538 |
|
2532 | |||
2539 | def _compact(self): |
|
|||
2540 | """Removes keys from the cache that are actually clean, by comparing |
|
|||
2541 | them with the underlying context. |
|
|||
2542 |
|
||||
2543 | This can occur during the merge process, e.g. by passing --tool :local |
|
|||
2544 | to resolve a conflict. |
|
|||
2545 | """ |
|
|||
2546 | keys = [] |
|
|||
2547 | # This won't be perfect, but can help performance significantly when |
|
|||
2548 | # using things like remotefilelog. |
|
|||
2549 | scmutil.prefetchfiles( |
|
|||
2550 | self.repo(), |
|
|||
2551 | [ |
|
|||
2552 | ( |
|
|||
2553 | self.p1().rev(), |
|
|||
2554 | scmutil.matchfiles(self.repo(), self._cache.keys()), |
|
|||
2555 | ) |
|
|||
2556 | ], |
|
|||
2557 | ) |
|
|||
2558 |
|
||||
2559 | for path in self._cache.keys(): |
|
|||
2560 | cache = self._cache[path] |
|
|||
2561 | try: |
|
|||
2562 | underlying = self._wrappedctx[path] |
|
|||
2563 | if ( |
|
|||
2564 | underlying.data() == cache[b'data'] |
|
|||
2565 | and underlying.flags() == cache[b'flags'] |
|
|||
2566 | ): |
|
|||
2567 | keys.append(path) |
|
|||
2568 | except error.ManifestLookupError: |
|
|||
2569 | # Path not in the underlying manifest (created). |
|
|||
2570 | continue |
|
|||
2571 |
|
||||
2572 | for path in keys: |
|
|||
2573 | del self._cache[path] |
|
|||
2574 | return keys |
|
|||
2575 |
|
||||
2576 | def _markdirty( |
|
2533 | def _markdirty( | |
2577 | self, path, exists, data=None, date=None, flags=b'', copied=None |
|
2534 | self, path, exists, data=None, date=None, flags=b'', copied=None | |
2578 | ): |
|
2535 | ): |
General Comments 0
You need to be logged in to leave comments.
Login now