Show More
@@ -63,32 +63,59 b' class gnuarch_source(converter_source, c' | |||
|
63 | 63 | output = self.run0('tree-version', '-d', self.path) |
|
64 | 64 | self.treeversion = output.strip() |
|
65 | 65 | |
|
66 | self.ui.status(_('analyzing tree version %s...\n') % self.treeversion) | |
|
67 | ||
|
68 | 66 | # Get name of temporary directory |
|
69 | 67 | version = self.treeversion.split('/') |
|
70 | 68 | self.tmppath = os.path.join(tempfile.gettempdir(), |
|
71 | 69 | 'hg-%s' % version[1]) |
|
72 | 70 | |
|
73 | 71 | # Generate parents dictionary |
|
74 | child = [] | |
|
75 |
|
|
|
76 | self.checkexit(status, 'archive registered?') | |
|
77 | for l in output: | |
|
78 | rev = l.strip() | |
|
79 | self.changes[rev] = self.gnuarch_rev(rev) | |
|
72 | self.parents[None] = [] | |
|
73 | treeversion = self.treeversion | |
|
74 | child = None | |
|
75 | while treeversion: | |
|
76 | self.ui.status(_('analyzing tree version %s...\n') % treeversion) | |
|
77 | ||
|
78 | archive = treeversion.split('/')[0] | |
|
79 | if archive not in self.archives: | |
|
80 | self.ui.status(_('tree analysis stopped because it points to an unregistered archive %s...\n') % archive) | |
|
81 | break | |
|
82 | ||
|
83 | # Get the complete list of revisions for that tree version | |
|
84 | output, status = self.runlines('revisions', '-r', '-f', treeversion) | |
|
85 | self.checkexit(status, 'failed retrieveing revisions for %s' % treeversion) | |
|
86 | ||
|
87 | # No new iteration unless a revision has a continuation-of header | |
|
88 | treeversion = None | |
|
89 | ||
|
90 | for l in output: | |
|
91 | rev = l.strip() | |
|
92 | self.changes[rev] = self.gnuarch_rev(rev) | |
|
93 | self.parents[rev] = [] | |
|
80 | 94 | |
|
81 | # Read author, date and summary | |
|
82 | catlog, status = self.run('cat-log', '-d', self.path, rev) | |
|
83 | if status: | |
|
84 | catlog = self.run0('cat-archive-log', rev) | |
|
85 | self._parsecatlog(catlog, rev) | |
|
95 | # Read author, date and summary | |
|
96 | catlog, status = self.run('cat-log', '-d', self.path, rev) | |
|
97 | if status: | |
|
98 | catlog = self.run0('cat-archive-log', rev) | |
|
99 | self._parsecatlog(catlog, rev) | |
|
100 | ||
|
101 | # Populate the parents map | |
|
102 | self.parents[child].append(rev) | |
|
86 | 103 | |
|
87 | self.parents[rev] = child | |
|
88 | child = [rev] | |
|
89 | if rev == self.rev: | |
|
90 | break | |
|
91 | self.parents[None] = child | |
|
104 | # Keep track of the current revision as the child of the next | |
|
105 | # revision scanned | |
|
106 | child = rev | |
|
107 | ||
|
108 | # Check if we have to follow the usual incremental history | |
|
109 | # or if we have to 'jump' to a different treeversion given | |
|
110 | # by the continuation-of header. | |
|
111 | if self.changes[rev].continuationof: | |
|
112 | treeversion = '--'.join(self.changes[rev].continuationof.split('--')[:-1]) | |
|
113 | break | |
|
114 | ||
|
115 | # If we reached a base-0 revision w/o any continuation-of | |
|
116 | # header, it means the tree history ends here. | |
|
117 | if rev[-6:] == 'base-0': | |
|
118 | break | |
|
92 | 119 | |
|
93 | 120 | def after(self): |
|
94 | 121 | self.ui.debug(_('cleaning up %s\n') % self.tmppath) |
@@ -162,23 +189,19 b' class gnuarch_source(converter_source, c' | |||
|
162 | 189 | return os.system(cmdline) |
|
163 | 190 | |
|
164 | 191 | def _update(self, rev): |
|
165 | if rev[-6:] == 'base-0': | |
|
166 | # Initialise 'base-0' revision | |
|
192 | self.ui.debug(_('applying revision %s...\n') % rev) | |
|
193 | changeset, status = self.runlines('replay', '-d', self.tmppath, | |
|
194 | rev) | |
|
195 | if status: | |
|
196 | # Something went wrong while merging (baz or tla | |
|
197 | # issue?), get latest revision and try from there | |
|
198 | shutil.rmtree(self.tmppath, ignore_errors=True) | |
|
167 | 199 | self._obtainrevision(rev) |
|
168 | 200 | else: |
|
169 | self.ui.debug(_('applying revision %s...\n') % rev) | |
|
170 | changeset, status = self.runlines('replay', '-d', self.tmppath, | |
|
171 |
|
|
|
172 | if status: | |
|
173 | # Something went wrong while merging (baz or tla | |
|
174 | # issue?), get latest revision and try from there | |
|
175 | shutil.rmtree(self.tmppath, ignore_errors=True) | |
|
176 | self._obtainrevision(rev) | |
|
177 | else: | |
|
178 | old_rev = self.parents[rev][0] | |
|
179 | self.ui.debug(_('computing changeset between %s and %s...\n') | |
|
180 | % (old_rev, rev)) | |
|
181 | self._parsechangeset(changeset, rev) | |
|
201 | old_rev = self.parents[rev][0] | |
|
202 | self.ui.debug(_('computing changeset between %s and %s...\n') | |
|
203 | % (old_rev, rev)) | |
|
204 | self._parsechangeset(changeset, rev) | |
|
182 | 205 | |
|
183 | 206 | def _getfile(self, name, rev): |
|
184 | 207 | mode = os.lstat(os.path.join(self.tmppath, name)).st_mode |
General Comments 0
You need to be logged in to leave comments.
Login now