durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8265

AFFECTED FILES
  hgext/git/__init__.py

CHANGE DETAILS

diff --git a/hgext/git/__init__.py b/hgext/git/__init__.py
--- a/hgext/git/__init__.py
+++ b/hgext/git/__init__.py
@@ -96,9 +96,12 @@
 
 
 def _makestore(orig, requirements, storebasepath, vfstype):
-    if os.path.exists(
-        os.path.join(storebasepath, b'this-is-git')
-    ) and os.path.exists(os.path.join(storebasepath, b'..', b'.git')):
+    reqsf = os.path.join(storebasepath, b'requirements')
+    reqs = set()
+    if os.path.exists(reqsf):
+        with open(reqsf, 'rb') as f:
+            reqs = {l.strip() for l in f}
+    if b'git' in reqs and os.path.exists(os.path.join(storebasepath, b'..', 
b'.git')):
         return gitstore(storebasepath, vfstype)
     return orig(requirements, storebasepath, vfstype)
 
@@ -128,8 +131,6 @@
             os.path.join(path, b'.git', b'info', b'exclude'), 'ab'
         ) as exclude:
             exclude.write(b'\n.hg\n')
-    with open(os.path.join(dothg, b'this-is-git'), 'wb') as f:
-        pass
     with open(os.path.join(dothg, b'requirements'), 'wb') as f:
         f.write(b'git\n')
 



To: durin42, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to