##// END OF EJS Templates
largefiles: set the extension as enabled locally after a clone requiring it...
Matt Harbison -
r24029:e1dbe0b2 default
parent child Browse files
Show More
@@ -821,6 +821,14 b' def hgclone(orig, ui, opts, *args, **kwa'
821 sourcerepo, destrepo = result
821 sourcerepo, destrepo = result
822 repo = destrepo.local()
822 repo = destrepo.local()
823
823
824 # If largefiles is required for this repo, permanently enable it locally
825 if 'largefiles' in repo.requirements:
826 fp = repo.vfs('hgrc', 'a', text=True)
827 try:
828 fp.write('\n[extensions]\nlargefiles=\n')
829 finally:
830 fp.close()
831
824 # Caching is implicitly limited to 'rev' option, since the dest repo was
832 # Caching is implicitly limited to 'rev' option, since the dest repo was
825 # truncated at that point. The user may expect a download count with
833 # truncated at that point. The user may expect a download count with
826 # this option, so attempt whether or not this is a largefile repo.
834 # this option, so attempt whether or not this is a largefile repo.
@@ -1183,12 +1183,12 b' rebased or not.'
1183 adding manifests
1183 adding manifests
1184 adding file changes
1184 adding file changes
1185 added 1 changesets with 2 changes to 2 files (+1 heads)
1185 added 1 changesets with 2 changes to 2 files (+1 heads)
1186 0 largefiles cached
1187 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1186 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1188 Invoking status precommit hook
1187 Invoking status precommit hook
1189 M sub/normal4
1188 M sub/normal4
1190 M sub2/large6
1189 M sub2/large6
1191 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1190 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1191 0 largefiles cached
1192 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1192 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1193 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1193 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1194 9:598410d3eb9a modify normal file largefile in repo d
1194 9:598410d3eb9a modify normal file largefile in repo d
@@ -46,12 +46,29 b' Cleaning both repositories, just as a cl'
46
46
47 Clone main
47 Clone main
48
48
49 $ hg clone main cloned
49 $ hg --config extensions.largefiles= clone main cloned
50 updating to branch default
50 updating to branch default
51 cloning subrepo sub1 from $TESTTMP/sub1
51 cloning subrepo sub1 from $TESTTMP/sub1
52 cloning subrepo sub1/sub2 from $TESTTMP/sub2 (glob)
52 cloning subrepo sub1/sub2 from $TESTTMP/sub2 (glob)
53 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
54
54
55 Largefiles is NOT enabled in the clone if the source repo doesn't require it
56 $ cat cloned/.hg/hgrc
57 # example repository config (see "hg help config" for more info)
58 [paths]
59 default = $TESTTMP/main (glob)
60
61 # path aliases to other clones of this repo in URLs or filesystem paths
62 # (see "hg help config.paths" for more info)
63 #
64 # default-push = ssh://jdoe@example.net/hg/jdoes-fork
65 # my-fork = ssh://jdoe@example.net/hg/jdoes-fork
66 # my-clone = /home/jdoe/jdoes-clone
67
68 [ui]
69 # name and email (local to this repository, optional), e.g.
70 # username = Jane Doe <jdoe@example.com>
71
55 Checking cloned repo ids
72 Checking cloned repo ids
56
73
57 $ printf "cloned " ; hg id -R cloned
74 $ printf "cloned " ; hg id -R cloned
@@ -319,6 +336,31 b' Find an exact largefile match in a large'
319 ../archive_lf/sub1/sub2/large.bin
336 ../archive_lf/sub1/sub2/large.bin
320 $ rm -rf ../archive_lf
337 $ rm -rf ../archive_lf
321
338
339 The local repo enables largefiles if a largefiles repo is cloned
340 $ hg showconfig extensions
341 abort: repository requires features unknown to this Mercurial: largefiles!
342 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
343 [255]
344 $ hg --config extensions.largefiles= clone -qU . ../lfclone
345 $ cat ../lfclone/.hg/hgrc
346 # example repository config (see "hg help config" for more info)
347 [paths]
348 default = $TESTTMP/cloned (glob)
349
350 # path aliases to other clones of this repo in URLs or filesystem paths
351 # (see "hg help config.paths" for more info)
352 #
353 # default-push = ssh://jdoe@example.net/hg/jdoes-fork
354 # my-fork = ssh://jdoe@example.net/hg/jdoes-fork
355 # my-clone = /home/jdoe/jdoes-clone
356
357 [ui]
358 # name and email (local to this repository, optional), e.g.
359 # username = Jane Doe <jdoe@example.com>
360
361 [extensions]
362 largefiles=
363
322 Find an exact match to a standin (should archive nothing)
364 Find an exact match to a standin (should archive nothing)
323 $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf
365 $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf
324 $ find ../archive_lf 2> /dev/null | sort
366 $ find ../archive_lf 2> /dev/null | sort
General Comments 0
You need to be logged in to leave comments. Login now