##// END OF EJS Templates
i18n: mark strings for translation in convert extension
Martin Geisler -
r6956:12472a24 default
parent child Browse files
Show More
@@ -228,7 +228,7 b' class commandline(object):'
228 228
229 229 def _run(self, cmd, *args, **kwargs):
230 230 cmdline = self._cmdline(cmd, *args, **kwargs)
231 self.ui.debug('running: %s\n' % (cmdline,))
231 self.ui.debug(_('running: %s\n') % (cmdline,))
232 232 self.prerun()
233 233 try:
234 234 return util.popen(cmdline)
@@ -184,7 +184,7 b' class converter(object):'
184 184 def writeauthormap(self):
185 185 authorfile = self.authorfile
186 186 if authorfile:
187 self.ui.status('Writing author map file %s\n' % authorfile)
187 self.ui.status(_('Writing author map file %s\n') % authorfile)
188 188 ofile = open(authorfile, 'w+')
189 189 for author in self.authors:
190 190 ofile.write("%s=%s\n" % (author, self.authors[author]))
@@ -201,15 +201,15 b' class converter(object):'
201 201 dstauthor = dstauthor.strip()
202 202 if srcauthor in self.authors and dstauthor != self.authors[srcauthor]:
203 203 self.ui.status(
204 'Overriding mapping for author %s, was %s, will be %s\n'
204 _('Overriding mapping for author %s, was %s, will be %s\n')
205 205 % (srcauthor, self.authors[srcauthor], dstauthor))
206 206 else:
207 self.ui.debug('Mapping author %s to %s\n'
207 self.ui.debug(_('Mapping author %s to %s\n')
208 208 % (srcauthor, dstauthor))
209 209 self.authors[srcauthor] = dstauthor
210 210 except IndexError:
211 211 self.ui.warn(
212 'Ignoring bad line in author map file %s: %s\n'
212 _('Ignoring bad line in author map file %s: %s\n')
213 213 % (authorfile, line.rstrip()))
214 214 afile.close()
215 215
@@ -241,7 +241,7 b' class converter(object):'
241 241 self.dest.setbranch(commit.branch, pbranches)
242 242 try:
243 243 parents = self.splicemap[rev].replace(',', ' ').split()
244 self.ui.status('spliced in %s as parents of %s\n' %
244 self.ui.status(_('spliced in %s as parents of %s\n') %
245 245 (parents, rev))
246 246 parents = [self.map.get(p, p) for p in parents]
247 247 except KeyError:
@@ -256,15 +256,15 b' class converter(object):'
256 256 self.source.before()
257 257 self.dest.before()
258 258 self.source.setrevmap(self.map)
259 self.ui.status("scanning source...\n")
259 self.ui.status(_("scanning source...\n"))
260 260 heads = self.source.getheads()
261 261 parents = self.walktree(heads)
262 self.ui.status("sorting...\n")
262 self.ui.status(_("sorting...\n"))
263 263 t = self.toposort(parents)
264 264 num = len(t)
265 265 c = None
266 266
267 self.ui.status("converting...\n")
267 self.ui.status(_("converting...\n"))
268 268 for c in t:
269 269 num -= 1
270 270 desc = self.commitcache[c].desc
@@ -309,7 +309,7 b' def convert(ui, src, dest=None, revmapfi'
309 309
310 310 if not dest:
311 311 dest = hg.defaultdest(src) + "-hg"
312 ui.status("assuming destination %s\n" % dest)
312 ui.status(_("assuming destination %s\n") % dest)
313 313
314 314 destc = convertsink(ui, dest, opts.get('dest_type'))
315 315
@@ -54,7 +54,7 b' class convert_cvs(converter_source):'
54 54 util.parsedate(self.rev, ['%Y/%m/%d %H:%M:%S'])
55 55 cmd = '%s -d "1970/01/01 00:00:01" -d "%s"' % (cmd, self.rev)
56 56 except util.Abort:
57 raise util.Abort('revision %s is not a patchset number or date' % self.rev)
57 raise util.Abort(_('revision %s is not a patchset number or date') % self.rev)
58 58
59 59 d = os.getcwd()
60 60 try:
@@ -181,7 +181,7 b' class convert_cvs(converter_source):'
181 181 user, host = None, None
182 182 cmd = ['cvs', 'server']
183 183
184 self.ui.status("connecting to %s\n" % root)
184 self.ui.status(_("connecting to %s\n") % root)
185 185
186 186 if root.startswith(":pserver:"):
187 187 root = root[9:]
@@ -221,7 +221,7 b' class convert_cvs(converter_source):'
221 221 sck.send("\n".join(["BEGIN AUTH REQUEST", root, user, passw,
222 222 "END AUTH REQUEST", ""]))
223 223 if sck.recv(128) != "I LOVE YOU\n":
224 raise util.Abort("CVS pserver authentication failed")
224 raise util.Abort(_("CVS pserver authentication failed"))
225 225
226 226 self.writep = self.readp = sck.makefile('r+')
227 227
@@ -264,7 +264,7 b' class convert_cvs(converter_source):'
264 264 self.writep.flush()
265 265 r = self.readp.readline()
266 266 if not r.startswith("Valid-requests"):
267 raise util.Abort("server sucks")
267 raise util.Abort(_("server sucks"))
268 268 if "UseUnchanged" in r:
269 269 self.writep.write("UseUnchanged\n")
270 270 self.writep.flush()
@@ -283,7 +283,7 b' class convert_cvs(converter_source):'
283 283 while count > 0:
284 284 data = fp.read(min(count, chunksize))
285 285 if not data:
286 raise util.Abort("%d bytes missing from remote file" % count)
286 raise util.Abort(_("%d bytes missing from remote file") % count)
287 287 count -= len(data)
288 288 output.write(data)
289 289 return output.getvalue()
@@ -318,14 +318,14 b' class convert_cvs(converter_source):'
318 318 if line == "ok\n":
319 319 return (data, "x" in mode and "x" or "")
320 320 elif line.startswith("E "):
321 self.ui.warn("cvs server: %s\n" % line[2:])
321 self.ui.warn(_("cvs server: %s\n") % line[2:])
322 322 elif line.startswith("Remove"):
323 323 l = self.readp.readline()
324 324 l = self.readp.readline()
325 325 if l != "ok\n":
326 raise util.Abort("unknown CVS response: %s" % l)
326 raise util.Abort(_("unknown CVS response: %s") % l)
327 327 else:
328 raise util.Abort("unknown CVS response: %s" % line)
328 raise util.Abort(_("unknown CVS response: %s") % line)
329 329
330 330 def getfile(self, file, rev):
331 331 data, mode = self._getfile(file, rev)
@@ -150,8 +150,8 b' def createlog(ui, directory=None, root="'
150 150 store = False # set when a new record can be appended
151 151
152 152 cmd = [util.shellquote(arg) for arg in cmd]
153 ui.note("running %s\n" % (' '.join(cmd)))
154 ui.debug("prefix=%r directory=%r root=%r\n" % (prefix, directory, root))
153 ui.note(_("running %s\n") % (' '.join(cmd)))
154 ui.debug(_("prefix=%r directory=%r root=%r\n") % (prefix, directory, root))
155 155
156 156 for line in util.popen(' '.join(cmd)):
157 157 if line.endswith('\n'):
@@ -66,7 +66,7 b' class darcs_source(converter_source, com'
66 66 self.parents[child] = []
67 67
68 68 def after(self):
69 self.ui.debug('cleaning up %s\n' % self.tmppath)
69 self.ui.debug(_('cleaning up %s\n') % self.tmppath)
70 70 shutil.rmtree(self.tmppath, ignore_errors=True)
71 71
72 72 def xml(self, cmd, **kwargs):
@@ -177,7 +177,7 b' class mercurial_sink(converter_sink):'
177 177 def getfilectx(repo, memctx, f):
178 178 return context.memfilectx(f, data, False, False, None)
179 179
180 self.ui.status("updating tags\n")
180 self.ui.status(_("updating tags\n"))
181 181 date = "%s 0" % int(time.mktime(time.gmtime()))
182 182 extra = {'branch': self.tagsbranch}
183 183 ctx = context.memctx(self.repo, (tagparent, None), "update tags",
@@ -189,7 +189,7 b' class svn_source(converter_source):'
189 189 try:
190 190 latest = int(rev)
191 191 except ValueError:
192 raise util.Abort('svn: revision %s is not an integer' % rev)
192 raise util.Abort(_('svn: revision %s is not an integer') % rev)
193 193
194 194 self.startrev = self.ui.config('convert', 'svn.startrev', default=0)
195 195 try:
@@ -290,7 +290,7 b' class svn_source(converter_source):'
290 290 self.ui.note(_('ignoring empty branch %s\n') %
291 291 branch.encode(self.encoding))
292 292 continue
293 self.ui.note('found branch %s at %d\n' %
293 self.ui.note(_('found branch %s at %d\n') %
294 294 (branch, self.revnum(brevid)))
295 295 self.heads.append(brevid)
296 296
@@ -420,7 +420,7 b' class svn_source(converter_source):'
420 420 tagspath = srctagspath
421 421
422 422 except SubversionException, (inst, num):
423 self.ui.note('no tags found at revision %d\n' % start)
423 self.ui.note(_('no tags found at revision %d\n') % start)
424 424 return tags
425 425
426 426 def converted(self, rev, destrev):
@@ -473,7 +473,7 b' class svn_source(converter_source):'
473 473 except SubversionException:
474 474 dirent = None
475 475 if not dirent:
476 raise util.Abort('%s not found up to revision %d' % (path, stop))
476 raise util.Abort(_('%s not found up to revision %d') % (path, stop))
477 477
478 478 # stat() gives us the previous revision on this line of development, but
479 479 # it might be in *another module*. Fetch the log and detect renames down
@@ -489,7 +489,7 b' class svn_source(converter_source):'
489 489 if not path.startswith(p) or not paths[p].copyfrom_path:
490 490 continue
491 491 newpath = paths[p].copyfrom_path + path[len(p):]
492 self.ui.debug("branch renamed from %s to %s at %d\n" %
492 self.ui.debug(_("branch renamed from %s to %s at %d\n") %
493 493 (path, newpath, revnum))
494 494 path = newpath
495 495 break
@@ -528,7 +528,7 b' class svn_source(converter_source):'
528 528 prevmodule = self.prevmodule
529 529 if prevmodule is None:
530 530 prevmodule = ''
531 self.ui.debug("reparent to %s\n" % svn_url)
531 self.ui.debug(_("reparent to %s\n") % svn_url)
532 532 svn.ra.reparent(self.ra, svn_url)
533 533 self.prevmodule = module
534 534 return prevmodule
@@ -560,11 +560,11 b' class svn_source(converter_source):'
560 560 copyfrom_path = self.getrelpath(ent.copyfrom_path, pmodule)
561 561 if not copyfrom_path:
562 562 continue
563 self.ui.debug("copied to %s from %s@%s\n" %
563 self.ui.debug(_("copied to %s from %s@%s\n") %
564 564 (entrypath, copyfrom_path, ent.copyfrom_rev))
565 565 copies[self.recode(entry)] = self.recode(copyfrom_path)
566 566 elif kind == 0: # gone, but had better be a deleted *file*
567 self.ui.debug("gone from %s\n" % ent.copyfrom_rev)
567 self.ui.debug(_("gone from %s\n") % ent.copyfrom_rev)
568 568
569 569 # if a branch is created but entries are removed in the same
570 570 # changeset, get the right fromrev
@@ -582,22 +582,22 b' class svn_source(converter_source):'
582 582 part = "/".join(parts[:i])
583 583 info = part, copyfrom.get(part, None)
584 584 if info[1] is not None:
585 self.ui.debug("Found parent directory %s\n" % info[1])
585 self.ui.debug(_("Found parent directory %s\n") % info[1])
586 586 rc = info
587 587 return rc
588 588
589 self.ui.debug("base, entry %s %s\n" % (basepath, entrypath))
589 self.ui.debug(_("base, entry %s %s\n") % (basepath, entrypath))
590 590
591 591 frompath, froment = lookup_parts(entrypath) or (None, revnum - 1)
592 592
593 593 # need to remove fragment from lookup_parts and replace with copyfrom_path
594 594 if frompath is not None:
595 self.ui.debug("munge-o-matic\n")
595 self.ui.debug(_("munge-o-matic\n"))
596 596 self.ui.debug(entrypath + '\n')
597 597 self.ui.debug(entrypath[len(frompath):] + '\n')
598 598 entrypath = froment.copyfrom_path + entrypath[len(frompath):]
599 599 fromrev = froment.copyfrom_rev
600 self.ui.debug("Info: %s %s %s %s\n" % (frompath, froment, ent, entrypath))
600 self.ui.debug(_("Info: %s %s %s %s\n") % (frompath, froment, ent, entrypath))
601 601
602 602 # We can avoid the reparent calls if the module has not changed
603 603 # but it probably does not worth the pain.
@@ -638,7 +638,7 b' class svn_source(converter_source):'
638 638 else:
639 639 entries.append(entry)
640 640 else:
641 self.ui.debug('unknown path in revision %d: %s\n' % \
641 self.ui.debug(_('unknown path in revision %d: %s\n') % \
642 642 (revnum, path))
643 643 elif kind == svn.core.svn_node_dir:
644 644 # Should probably synthesize normal file entries
@@ -684,7 +684,7 b' class svn_source(converter_source):'
684 684 if not copyfrompath:
685 685 continue
686 686 copyfrom[path] = ent
687 self.ui.debug("mark %s came from %s:%d\n"
687 self.ui.debug(_("mark %s came from %s:%d\n")
688 688 % (path, copyfrompath, ent.copyfrom_rev))
689 689 children = self._find_children(ent.copyfrom_path, ent.copyfrom_rev)
690 690 children.sort()
@@ -715,7 +715,7 b' class svn_source(converter_source):'
715 715 """Return the parsed commit object or None, and True if
716 716 the revision is a branch root.
717 717 """
718 self.ui.debug("parsing revision %d (%d changes)\n" %
718 self.ui.debug(_("parsing revision %d (%d changes)\n") %
719 719 (revnum, len(orig_paths)))
720 720
721 721 branched = False
@@ -752,10 +752,10 b' class svn_source(converter_source):'
752 752 prevmodule, prevnum = self.revsplit(previd)[1:]
753 753 if prevnum >= self.startrev:
754 754 parents = [previd]
755 self.ui.note('found parent of branch %s at %d: %s\n' %
755 self.ui.note(_('found parent of branch %s at %d: %s\n') %
756 756 (self.module, prevnum, prevmodule))
757 757 else:
758 self.ui.debug("No copyfrom path, don't know what to do.\n")
758 self.ui.debug(_("No copyfrom path, don't know what to do.\n"))
759 759
760 760 paths = []
761 761 # filter out unrelated paths
@@ -794,7 +794,7 b' class svn_source(converter_source):'
794 794 self.child_cset = cset
795 795 return cset, branched
796 796
797 self.ui.note('fetching revision log for "%s" from %d to %d\n' %
797 self.ui.note(_('fetching revision log for "%s" from %d to %d\n') %
798 798 (self.module, from_revnum, to_revnum))
799 799
800 800 try:
@@ -808,11 +808,11 b' class svn_source(converter_source):'
808 808 lastonbranch = True
809 809 break
810 810 if self.is_blacklisted(revnum):
811 self.ui.note('skipping blacklisted revision %d\n'
811 self.ui.note(_('skipping blacklisted revision %d\n')
812 812 % revnum)
813 813 continue
814 814 if paths is None:
815 self.ui.debug('revision %d has no entries\n' % revnum)
815 self.ui.debug(_('revision %d has no entries\n') % revnum)
816 816 continue
817 817 cset, lastonbranch = parselogentry(paths, revnum, author,
818 818 date, message)
@@ -837,7 +837,7 b' class svn_source(converter_source):'
837 837 pass
838 838 except SubversionException, (inst, num):
839 839 if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION:
840 raise util.Abort('svn: branch has no revision %s' % to_revnum)
840 raise util.Abort(_('svn: branch has no revision %s') % to_revnum)
841 841 raise
842 842
843 843 def _getfile(self, file, rev):
@@ -890,7 +890,7 b' class svn_source(converter_source):'
890 890 return relative
891 891
892 892 # The path is outside our tracked tree...
893 self.ui.debug('%r is not under %r, ignoring\n' % (path, module))
893 self.ui.debug(_('%r is not under %r, ignoring\n') % (path, module))
894 894 return None
895 895
896 896 def _checkpath(self, path, revnum):
General Comments 0
You need to be logged in to leave comments. Login now