D4712: lfs: don't add extension to hgrc after clone or share (BC)
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Wed Sep 26 13:24:44 EDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbcf72d7b1524: lfs: don't add extension to hgrc after clone or share (BC) (authored by indygreg, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D4712?vs=11320&id=11384
REVISION DETAIL
https://phab.mercurial-scm.org/D4712
AFFECTED FILES
hgext/lfs/__init__.py
hgext/lfs/wrapper.py
tests/test-lfs.t
CHANGE DETAILS
diff --git a/tests/test-lfs.t b/tests/test-lfs.t
--- a/tests/test-lfs.t
+++ b/tests/test-lfs.t
@@ -295,8 +295,6 @@
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd repo7
- $ hg config extensions --debug | grep lfs
- $TESTTMP/repo7/.hg/hgrc:*: extensions.lfs= (glob)
$ cat large
LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES
$ cat small
@@ -307,8 +305,8 @@
$ hg --config extensions.share= share repo7 sharedrepo
updating working directory
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
- $ hg -R sharedrepo config extensions --debug | grep lfs
- $TESTTMP/sharedrepo/.hg/hgrc:*: extensions.lfs= (glob)
+ $ grep lfs sharedrepo/.hg/requires
+ lfs
# Test rename and status
diff --git a/hgext/lfs/wrapper.py b/hgext/lfs/wrapper.py
--- a/hgext/lfs/wrapper.py
+++ b/hgext/lfs/wrapper.py
@@ -228,32 +228,6 @@
if util.safehasattr(othervfs, name):
setattr(self, name, getattr(othervfs, name))
-def hgclone(orig, ui, opts, *args, **kwargs):
- result = orig(ui, opts, *args, **kwargs)
-
- if result is not None:
- sourcerepo, destrepo = result
- repo = destrepo.local()
-
- # When cloning to a remote repo (like through SSH), no repo is available
- # from the peer. Therefore the hgrc can't be updated.
- if not repo:
- return result
-
- # If lfs is required for this repo, permanently enable it locally
- if 'lfs' in repo.requirements:
- repo.vfs.append('hgrc',
- util.tonativeeol('\n[extensions]\nlfs=\n'))
-
- return result
-
-def hgpostshare(orig, sourcerepo, destrepo, defaultpath=None):
- orig(sourcerepo, destrepo, defaultpath=defaultpath)
-
- # If lfs is required for this repo, permanently enable it locally
- if 'lfs' in destrepo.requirements:
- destrepo.vfs.append('hgrc', util.tonativeeol('\n[extensions]\nlfs=\n'))
-
def _prefetchfiles(repo, revs, match):
"""Ensure that required LFS blobs are present, fetching them as a group if
needed."""
diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py
--- a/hgext/lfs/__init__.py
+++ b/hgext/lfs/__init__.py
@@ -344,9 +344,6 @@
),
)
- wrapfunction(hg, 'clone', wrapper.hgclone)
- wrapfunction(hg, 'postshare', wrapper.hgpostshare)
-
scmutil.fileprefetchhooks.add('lfs', wrapper._prefetchfiles)
# Make bundle choose changegroup3 instead of changegroup2. This affects
To: indygreg, #hg-reviewers, mharbison72
Cc: mharbison72, mercurial-devel
More information about the Mercurial-devel
mailing list