comparison mercurial/dirstate.py @ 49822:1d8721be2428

dirstate: add narrow support to `verify` This will be called later in the series by the `verify` command.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 02 May 2022 17:39:01 +0200
parents 8f200511cdc7
children 2715c8549f4b
comparison
equal deleted inserted replaced
49821:8f200511cdc7 49822:1d8721be2428
1538 o.unlink(backupname) 1538 o.unlink(backupname)
1539 1539
1540 if data_backup is not None: 1540 if data_backup is not None:
1541 o.unlink(data_backup[0]) 1541 o.unlink(data_backup[0])
1542 1542
1543 def verify(self, m1, m2): 1543 def verify(self, m1, m2, narrow_matcher=None):
1544 """check the dirstate content again the parent manifest and yield errors""" 1544 """check the dirstate content again the parent manifest and yield errors"""
1545 missing_from_p1 = b"%s in state %s, but not in manifest1\n" 1545 missing_from_p1 = b"%s in state %s, but not in manifest1\n"
1546 unexpected_in_p1 = b"%s in state %s, but also in manifest1\n" 1546 unexpected_in_p1 = b"%s in state %s, but also in manifest1\n"
1547 missing_from_ps = b"%s in state %s, but not in either manifest\n" 1547 missing_from_ps = b"%s in state %s, but not in either manifest\n"
1548 missing_from_ds = b"%s in manifest1, but listed as state %s\n" 1548 missing_from_ds = b"%s in manifest1, but listed as state %s\n"
1554 elif f not in m1: 1554 elif f not in m1:
1555 yield (missing_from_p1, f, state) 1555 yield (missing_from_p1, f, state)
1556 if entry.added and f in m1: 1556 if entry.added and f in m1:
1557 yield (unexpected_in_p1, f, state) 1557 yield (unexpected_in_p1, f, state)
1558 for f in m1: 1558 for f in m1:
1559 if narrow_matcher is not None and not narrow_matcher(f):
1560 continue
1559 entry = self.get_entry(f) 1561 entry = self.get_entry(f)
1560 if not entry.p1_tracked: 1562 if not entry.p1_tracked:
1561 yield (missing_from_ds, f, entry.state) 1563 yield (missing_from_ds, f, entry.state)