diff mercurial/store.py @ 45494:d252f51ab032

share: introduce config option to store requires in .hg/store This introduces a config option which enabled stores the requirements on a repository in store instead. When enabled, `.hg/requires` will contain the `share-safe` requirement which marks that the requirements are present in the store. This is done so that repository requirements can be shared with shares made using `hg share` command. After this patch, `hg share` checks whether the source repository has share-safe requirement, if yes, it does not copy the requirements. Test for the new functionality is added and a test case in exitsing share tests is also added. Differential Revision: https://phab.mercurial-scm.org/D8633
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 14 Apr 2020 21:07:09 +0530
parents 909dafff6a78
children 89a2afe31e82
line wrap: on
line diff
--- a/mercurial/store.py	Fri Aug 07 16:11:19 2020 +0530
+++ b/mercurial/store.py	Tue Apr 14 21:07:09 2020 +0530
@@ -384,6 +384,7 @@
     b'00changelog.i',
     b'phaseroots',
     b'obsstore',
+    b'requires',
 ]
 
 
@@ -455,7 +456,7 @@
             yield x
 
     def copylist(self):
-        return [b'requires'] + _data
+        return _data
 
     def write(self, tr):
         pass
@@ -704,6 +705,7 @@
             b'00manifest.i',
             b'00changelog.d',
             b'00changelog.i',
+            b'requires',
         )
         return [b'requires', b'00changelog.i'] + [b'store/' + f for f in d]