Show More
@@ -48,7 +48,7 b' def relink(ui, repo, origin=None, **opts' | |||
|
48 | 48 | try: |
|
49 | 49 | remotelock = src.lock() |
|
50 | 50 | try: |
|
51 |
candidates = sorted(collect(src |
|
|
51 | candidates = sorted(collect(src, ui)) | |
|
52 | 52 | targets = prune(candidates, src.store.path, repo.store.path, ui) |
|
53 | 53 | do_relink(src.store.path, repo.store.path, targets, ui) |
|
54 | 54 | finally: |
@@ -59,6 +59,18 b' def relink(ui, repo, origin=None, **opts' | |||
|
59 | 59 | def collect(src, ui): |
|
60 | 60 | seplen = len(os.path.sep) |
|
61 | 61 | candidates = [] |
|
62 | live = len(src['tip'].manifest()) | |
|
63 | # Your average repository has some files which were deleted before | |
|
64 | # the tip revision. We account for that by assuming that there are | |
|
65 | # 3 tracked files for every 2 live files as of the tip version of | |
|
66 | # the repository. | |
|
67 | # | |
|
68 | # mozilla-central as of 2010-06-10 had a ratio of just over 7:5. | |
|
69 | total = live * 3 // 2 | |
|
70 | src = src.store.path | |
|
71 | pos = 0 | |
|
72 | ui.status(_("tip has %d files, estimated total number of files: %s\n") | |
|
73 | % (live, total)) | |
|
62 | 74 | for dirpath, dirnames, filenames in os.walk(src): |
|
63 | 75 | relpath = dirpath[len(src) + seplen:] |
|
64 | 76 | for filename in filenames: |
@@ -67,8 +79,11 b' def collect(src, ui):' | |||
|
67 | 79 | st = os.stat(os.path.join(dirpath, filename)) |
|
68 | 80 | if not stat.S_ISREG(st.st_mode): |
|
69 | 81 | continue |
|
82 | pos += 1 | |
|
70 | 83 | candidates.append((os.path.join(relpath, filename), st)) |
|
84 | ui.progress(_('collecting'), pos, filename, _('files'), total) | |
|
71 | 85 | |
|
86 | ui.progress(_('collecting'), None) | |
|
72 | 87 | ui.status(_('collected %d candidate storage files\n') % len(candidates)) |
|
73 | 88 | return candidates |
|
74 | 89 |
@@ -12,6 +12,12 b' 2 files updated, 0 files merged, 0 files' | |||
|
12 | 12 | created new head |
|
13 | 13 | % relink |
|
14 | 14 | relinking .hg/store |
|
15 | tip has 2 files, estimated total number of files: 3 | |
|
16 | collecting: 00changelog.i 1/3 files (33.33%) | |
|
17 | collecting: 00manifest.i 2/3 files (66.67%) | |
|
18 | collecting: dummy.i 3/3 files (100.00%) | |
|
19 | collecting: b.i 4/3 files (133.33%) | |
|
20 | collecting: a.i 5/3 files (166.67%) | |
|
15 | 21 | collected 5 candidate storage files |
|
16 | 22 | not linkable: 00changelog.i |
|
17 | 23 | not linkable: 00manifest.i |
General Comments 0
You need to be logged in to leave comments.
Login now