##// END OF EJS Templates
scmutil: introduce filterrequirements() to split reqs into wc and store ones...
Pulkit Goyal -
r46054:9a99ab82 default
parent child Browse files
Show More
@@ -38,6 +38,7 b' from . import ('
38 38 phases,
39 39 policy,
40 40 pycompat,
41 requirements as requirementsmod,
41 42 revsetlang,
42 43 similar,
43 44 smartset,
@@ -1470,11 +1471,34 b' def movedirstate(repo, newctx, match=Non'
1470 1471 repo._quick_access_changeid_invalidate()
1471 1472
1472 1473
1474 def filterrequirements(requirements):
1475 """ filters the requirements into two sets:
1476
1477 wcreq: requirements which should be written in .hg/requires
1478 storereq: which should be written in .hg/store/requires
1479
1480 Returns (wcreq, storereq)
1481 """
1482 if False:
1483 wc, store = set(), set()
1484 for r in requirements:
1485 if r in requirementsmod.WORKING_DIR_REQUIREMENTS:
1486 wc.add(r)
1487 else:
1488 store.add(r)
1489 return wc, store
1490 return requirements, None
1491
1492
1473 1493 def writereporequirements(repo, requirements=None):
1474 1494 """ writes requirements for the repo to .hg/requires """
1475 1495 if requirements:
1476 1496 repo.requirements = requirements
1477 writerequires(repo.vfs, repo.requirements)
1497 wcreq, storereq = filterrequirements(repo.requirements)
1498 if wcreq is not None:
1499 writerequires(repo.vfs, wcreq)
1500 if storereq is not None:
1501 writerequires(repo.svfs, storereq)
1478 1502
1479 1503
1480 1504 def writerequires(opener, requirements):
General Comments 0
You need to be logged in to leave comments. Login now