Show More
@@ -2054,25 +2054,6 b' class localrepository(repo.repository):' | |||||
2054 | return self.stream_in(remote) |
|
2054 | return self.stream_in(remote) | |
2055 | return self.pull(remote, heads) |
|
2055 | return self.pull(remote, heads) | |
2056 |
|
2056 | |||
2057 | def storefiles(self): |
|
|||
2058 | '''get all *.i and *.d files in the store |
|
|||
2059 |
|
||||
2060 | Returns (list of (filename, size), total_bytes)''' |
|
|||
2061 |
|
||||
2062 | lock = None |
|
|||
2063 | try: |
|
|||
2064 | self.ui.debug('scanning\n') |
|
|||
2065 | entries = [] |
|
|||
2066 | total_bytes = 0 |
|
|||
2067 | # get consistent snapshot of repo, lock during scan |
|
|||
2068 | lock = self.lock() |
|
|||
2069 | for name, ename, size in self.store.walk(): |
|
|||
2070 | entries.append((name, size)) |
|
|||
2071 | total_bytes += size |
|
|||
2072 | return entries, total_bytes |
|
|||
2073 | finally: |
|
|||
2074 | del lock |
|
|||
2075 |
|
||||
2076 | # used to avoid circular references so destructors work |
|
2057 | # used to avoid circular references so destructors work | |
2077 | def aftertrans(files): |
|
2058 | def aftertrans(files): | |
2078 | renamefiles = [tuple(t) for t in files] |
|
2059 | renamefiles = [tuple(t) for t in files] |
@@ -31,8 +31,19 b' def stream_out(repo, fileobj, untrusted=' | |||||
31 | fileobj.write('1\n') |
|
31 | fileobj.write('1\n') | |
32 | return |
|
32 | return | |
33 |
|
33 | |||
|
34 | entries = [] | |||
|
35 | total_bytes = 0 | |||
34 | try: |
|
36 | try: | |
35 | entries, total_bytes = repo.storefiles() |
|
37 | l = None | |
|
38 | try: | |||
|
39 | repo.ui.debug('scanning\n') | |||
|
40 | # get consistent snapshot of repo, lock during scan | |||
|
41 | l = repo.lock() | |||
|
42 | for name, ename, size in repo.store.walk(): | |||
|
43 | entries.append((name, size)) | |||
|
44 | total_bytes += size | |||
|
45 | finally: | |||
|
46 | del l | |||
36 | except (lock.LockHeld, lock.LockUnavailable), inst: |
|
47 | except (lock.LockHeld, lock.LockUnavailable), inst: | |
37 | repo.ui.warn('locking the repository failed: %s\n' % (inst,)) |
|
48 | repo.ui.warn('locking the repository failed: %s\n' % (inst,)) | |
38 | fileobj.write('2\n') |
|
49 | fileobj.write('2\n') |
General Comments 0
You need to be logged in to leave comments.
Login now