Mercurial > hg
comparison hgext/convert/gnuarch.py @ 6913:580d5e6bfc1f
move % out of translatable strings
The translators need to see the raw format string, not the result of
using the format string.
author | Martin Geisler <mg@daimi.au.dk> |
---|---|
date | Sat, 16 Aug 2008 14:46:56 +0200 |
parents | f67d1468ac50 |
children | 0946294d1f32 bd96fcb696d8 |
comparison
equal
deleted
inserted
replaced
6912:b92baef99ebf | 6913:580d5e6bfc1f |
---|---|
21 | 21 |
22 def __init__(self, ui, path, rev=None): | 22 def __init__(self, ui, path, rev=None): |
23 super(gnuarch_source, self).__init__(ui, path, rev=rev) | 23 super(gnuarch_source, self).__init__(ui, path, rev=rev) |
24 | 24 |
25 if not os.path.exists(os.path.join(path, '{arch}')): | 25 if not os.path.exists(os.path.join(path, '{arch}')): |
26 raise NoRepo(_("%s does not look like a GNU Arch repo" % path)) | 26 raise NoRepo(_("%s does not look like a GNU Arch repo") % path) |
27 | 27 |
28 # Could use checktool, but we want to check for baz or tla. | 28 # Could use checktool, but we want to check for baz or tla. |
29 self.execmd = None | 29 self.execmd = None |
30 if util.find_exe('baz'): | 30 if util.find_exe('baz'): |
31 self.execmd = 'baz' | 31 self.execmd = 'baz' |
52 output = self.run0('tree-version', self.path) | 52 output = self.run0('tree-version', self.path) |
53 else: | 53 else: |
54 output = self.run0('tree-version', '-d', self.path) | 54 output = self.run0('tree-version', '-d', self.path) |
55 self.treeversion = output.strip() | 55 self.treeversion = output.strip() |
56 | 56 |
57 self.ui.status(_('analyzing tree version %s...\n' % self.treeversion)) | 57 self.ui.status(_('analyzing tree version %s...\n') % self.treeversion) |
58 | 58 |
59 # Get name of temporary directory | 59 # Get name of temporary directory |
60 version = self.treeversion.split('/') | 60 version = self.treeversion.split('/') |
61 self.tmppath = os.path.join(tempfile.gettempdir(), | 61 self.tmppath = os.path.join(tempfile.gettempdir(), |
62 'hg-%s' % version[1]) | 62 'hg-%s' % version[1]) |
78 if rev == self.rev: | 78 if rev == self.rev: |
79 break | 79 break |
80 self.parents[None] = child | 80 self.parents[None] = child |
81 | 81 |
82 def after(self): | 82 def after(self): |
83 self.ui.debug(_('cleaning up %s\n' % self.tmppath)) | 83 self.ui.debug(_('cleaning up %s\n') % self.tmppath) |
84 shutil.rmtree(self.tmppath, ignore_errors=True) | 84 shutil.rmtree(self.tmppath, ignore_errors=True) |
85 | 85 |
86 def getheads(self): | 86 def getheads(self): |
87 return self.parents[None] | 87 return self.parents[None] |
88 | 88 |
153 def _update(self, rev): | 153 def _update(self, rev): |
154 if rev == 'base-0': | 154 if rev == 'base-0': |
155 # Initialise 'base-0' revision | 155 # Initialise 'base-0' revision |
156 self._obtainrevision(rev) | 156 self._obtainrevision(rev) |
157 else: | 157 else: |
158 self.ui.debug(_('applying revision %s...\n' % rev)) | 158 self.ui.debug(_('applying revision %s...\n') % rev) |
159 revision = '%s--%s' % (self.treeversion, rev) | 159 revision = '%s--%s' % (self.treeversion, rev) |
160 changeset, status = self.runlines('replay', '-d', self.tmppath, | 160 changeset, status = self.runlines('replay', '-d', self.tmppath, |
161 revision) | 161 revision) |
162 if status: | 162 if status: |
163 # Something went wrong while merging (baz or tla | 163 # Something went wrong while merging (baz or tla |
164 # issue?), get latest revision and try from there | 164 # issue?), get latest revision and try from there |
165 shutil.rmtree(self.tmppath, ignore_errors=True) | 165 shutil.rmtree(self.tmppath, ignore_errors=True) |
166 self._obtainrevision(rev) | 166 self._obtainrevision(rev) |
167 else: | 167 else: |
168 old_rev = self.parents[rev][0] | 168 old_rev = self.parents[rev][0] |
169 self.ui.debug(_('computing changeset between %s and %s...\n' \ | 169 self.ui.debug(_('computing changeset between %s and %s...\n') |
170 % (old_rev, rev))) | 170 % (old_rev, rev)) |
171 rev_a = '%s--%s' % (self.treeversion, old_rev) | 171 rev_a = '%s--%s' % (self.treeversion, old_rev) |
172 rev_b = '%s--%s' % (self.treeversion, rev) | 172 rev_b = '%s--%s' % (self.treeversion, rev) |
173 self._parsechangeset(changeset, rev) | 173 self._parsechangeset(changeset, rev) |
174 | 174 |
175 def _getfile(self, name, rev): | 175 def _getfile(self, name, rev): |
215 changes.append(d) | 215 changes.append(d) |
216 copies[s] = d | 216 copies[s] = d |
217 return changes, copies | 217 return changes, copies |
218 | 218 |
219 def _obtainrevision(self, rev): | 219 def _obtainrevision(self, rev): |
220 self.ui.debug(_('obtaining revision %s...\n' % rev)) | 220 self.ui.debug(_('obtaining revision %s...\n') % rev) |
221 revision = '%s--%s' % (self.treeversion, rev) | 221 revision = '%s--%s' % (self.treeversion, rev) |
222 output = self._execute('get', revision, self.tmppath) | 222 output = self._execute('get', revision, self.tmppath) |
223 self.checkexit(output) | 223 self.checkexit(output) |
224 self.ui.debug(_('analysing revision %s...\n' % rev)) | 224 self.ui.debug(_('analysing revision %s...\n') % rev) |
225 files = self._readcontents(self.tmppath) | 225 files = self._readcontents(self.tmppath) |
226 self.changes[rev].add_files += files | 226 self.changes[rev].add_files += files |
227 | 227 |
228 def _stripbasepath(self, path): | 228 def _stripbasepath(self, path): |
229 if path.startswith('./'): | 229 if path.startswith('./'): |