##// END OF EJS Templates
i18n: mark strings for translation in mq extension
Martin Geisler -
r6960:46da38ee default
parent child Browse files
Show More
@@ -144,7 +144,7 b' class queue:'
144 144 if bad:
145 145 raise util.Abort(bad)
146 146 guards = util.sort(util.unique(guards))
147 self.ui.debug('active guards: %s\n' % ' '.join(guards))
147 self.ui.debug(_('active guards: %s\n') % ' '.join(guards))
148 148 self.active_guards = guards
149 149 self.guards_dirty = True
150 150
@@ -317,7 +317,7 b' class queue:'
317 317 try:
318 318 os.unlink(undo)
319 319 except OSError, inst:
320 self.ui.warn('error removing undo: %s\n' % str(inst))
320 self.ui.warn(_('error removing undo: %s\n') % str(inst))
321 321
322 322 def printdiff(self, repo, node1, node2=None, files=None,
323 323 fp=None, changes=None, opts={}):
@@ -335,7 +335,7 b' class queue:'
335 335 if n is None:
336 336 raise util.Abort(_("apply failed for patch %s") % patch)
337 337
338 self.ui.warn("patch didn't work out, merging %s\n" % patch)
338 self.ui.warn(_("patch didn't work out, merging %s\n") % patch)
339 339
340 340 # apply failed, strip away that rev and merge.
341 341 hg.clean(repo, head)
@@ -400,7 +400,7 b' class queue:'
400 400 for patch in series:
401 401 patch = mergeq.lookup(patch, strict=True)
402 402 if not patch:
403 self.ui.warn("patch %s does not exist\n" % patch)
403 self.ui.warn(_("patch %s does not exist\n") % patch)
404 404 return (1, None)
405 405 pushable, reason = self.pushable(patch)
406 406 if not pushable:
@@ -408,7 +408,7 b' class queue:'
408 408 continue
409 409 info = mergeq.isapplied(patch)
410 410 if not info:
411 self.ui.warn("patch %s is not applied\n" % patch)
411 self.ui.warn(_("patch %s is not applied\n") % patch)
412 412 return (1, None)
413 413 rev = revlog.bin(info[1])
414 414 (err, head) = self.mergeone(repo, mergeq, head, patch, rev)
@@ -430,7 +430,7 b' class queue:'
430 430 except Exception, inst:
431 431 self.ui.note(str(inst) + '\n')
432 432 if not self.ui.verbose:
433 self.ui.warn("patch failed, unable to continue (try -v)\n")
433 self.ui.warn(_("patch failed, unable to continue (try -v)\n"))
434 434 return (False, files, False)
435 435
436 436 return (True, files, fuzz)
@@ -471,21 +471,21 b' class queue:'
471 471 if not pushable:
472 472 self.explain_pushable(patchname, all_patches=True)
473 473 continue
474 self.ui.warn("applying %s\n" % patchname)
474 self.ui.warn(_("applying %s\n") % patchname)
475 475 pf = os.path.join(patchdir, patchname)
476 476
477 477 try:
478 478 message, comments, user, date, patchfound = self.readheaders(patchname)
479 479 except:
480 self.ui.warn("Unable to read %s\n" % patchname)
480 self.ui.warn(_("Unable to read %s\n") % patchname)
481 481 err = 1
482 482 break
483 483
484 484 if not message:
485 message = "imported patch %s\n" % patchname
485 message = _("imported patch %s\n") % patchname
486 486 else:
487 487 if list:
488 message.append("\nimported patch %s" % patchname)
488 message.append(_("\nimported patch %s") % patchname)
489 489 message = '\n'.join(message)
490 490
491 491 (patcherr, files, fuzz) = self.patch(repo, pf)
@@ -521,15 +521,15 b' class queue:'
521 521
522 522 if patcherr:
523 523 if not patchfound:
524 self.ui.warn("patch %s is empty\n" % patchname)
524 self.ui.warn(_("patch %s is empty\n") % patchname)
525 525 err = 0
526 526 else:
527 self.ui.warn("patch failed, rejects left in working dir\n")
527 self.ui.warn(_("patch failed, rejects left in working dir\n"))
528 528 err = 1
529 529 break
530 530
531 531 if fuzz and strict:
532 self.ui.warn("fuzz found when applying patch, stopping\n")
532 self.ui.warn(_("fuzz found when applying patch, stopping\n"))
533 533 err = 1
534 534 break
535 535 return (err, n)
@@ -895,7 +895,7 b' class queue:'
895 895 rr = [ revlog.bin(x.rev) for x in self.applied ]
896 896 for p in parents:
897 897 if p in rr:
898 self.ui.warn("qpop: forcing dirstate update\n")
898 self.ui.warn(_("qpop: forcing dirstate update\n"))
899 899 update = True
900 900
901 901 if not force and update:
@@ -911,7 +911,7 b' class queue:'
911 911 else:
912 912 popi = info[0] + 1
913 913 if popi >= end:
914 self.ui.warn("qpop: %s is already at the top\n" % patch)
914 self.ui.warn(_("qpop: %s is already at the top\n") % patch)
915 915 return
916 916 info = [ popi ] + [self.applied[popi].rev, self.applied[popi].name]
917 917
@@ -922,8 +922,8 b' class queue:'
922 922 top = self.check_toppatch(repo)
923 923
924 924 if repo.changelog.heads(rev) != [revlog.bin(self.applied[-1].rev)]:
925 raise util.Abort("popping would remove a revision not "
926 "managed by this patch queue")
925 raise util.Abort(_("popping would remove a revision not "
926 "managed by this patch queue"))
927 927
928 928 # we know there are no local changes, so we can make a simplified
929 929 # form of hg.update.
@@ -933,7 +933,7 b' class queue:'
933 933 mmap = repo.manifest.read(changes[0])
934 934 m, a, r, d = repo.status(qp, top)[:4]
935 935 if d:
936 raise util.Abort("deletions found between repo revs")
936 raise util.Abort(_("deletions found between repo revs"))
937 937 for f in m:
938 938 getfile(f, mmap[f], mmap.flags(f))
939 939 for f in r:
@@ -953,16 +953,16 b' class queue:'
953 953 del self.applied[start:end]
954 954 self.strip(repo, rev, update=False, backup='strip')
955 955 if len(self.applied):
956 self.ui.write("Now at: %s\n" % self.applied[-1].name)
956 self.ui.write(_("Now at: %s\n") % self.applied[-1].name)
957 957 else:
958 self.ui.write("Patch queue now empty\n")
958 self.ui.write(_("Patch queue now empty\n"))
959 959 finally:
960 960 del wlock
961 961
962 962 def diff(self, repo, pats, opts):
963 963 top = self.check_toppatch(repo)
964 964 if not top:
965 self.ui.write("No patches applied\n")
965 self.ui.write(_("No patches applied\n"))
966 966 return
967 967 qp = self.qparents(repo, top)
968 968 self._diffopts = patch.diffopts(self.ui, opts)
@@ -970,7 +970,7 b' class queue:'
970 970
971 971 def refresh(self, repo, pats=None, **opts):
972 972 if len(self.applied) == 0:
973 self.ui.write("No patches applied\n")
973 self.ui.write(_("No patches applied\n"))
974 974 return 1
975 975 newdate = opts.get('date')
976 976 if newdate:
@@ -981,7 +981,7 b' class queue:'
981 981 (top, patchfn) = (self.applied[-1].rev, self.applied[-1].name)
982 982 top = revlog.bin(top)
983 983 if repo.changelog.heads(top) != [top]:
984 raise util.Abort("cannot refresh a revision with children")
984 raise util.Abort(_("cannot refresh a revision with children"))
985 985 cparents = repo.changelog.parents(top)
986 986 patchparent = self.qparents(repo, top)
987 987 message, comments, user, date, patchfound = self.readheaders(patchfn)
@@ -1296,9 +1296,9 b' class queue:'
1296 1296 else:
1297 1297 series.append(file_)
1298 1298 if datastart == None:
1299 self.ui.warn("No saved patch data found\n")
1299 self.ui.warn(_("No saved patch data found\n"))
1300 1300 return 1
1301 self.ui.warn("restoring status: %s\n" % lines[0])
1301 self.ui.warn(_("restoring status: %s\n") % lines[0])
1302 1302 self.full_series = series
1303 1303 self.applied = applied
1304 1304 self.parse_series()
@@ -1307,9 +1307,9 b' class queue:'
1307 1307 heads = repo.changelog.heads()
1308 1308 if delete:
1309 1309 if rev not in heads:
1310 self.ui.warn("save entry has children, leaving it alone\n")
1310 self.ui.warn(_("save entry has children, leaving it alone\n"))
1311 1311 else:
1312 self.ui.warn("removing save entry %s\n" % short(rev))
1312 self.ui.warn(_("removing save entry %s\n") % short(rev))
1313 1313 pp = repo.dirstate.parents()
1314 1314 if rev in pp:
1315 1315 update = True
@@ -1317,27 +1317,27 b' class queue:'
1317 1317 update = False
1318 1318 self.strip(repo, rev, update=update, backup='strip')
1319 1319 if qpp:
1320 self.ui.warn("saved queue repository parents: %s %s\n" %
1320 self.ui.warn(_("saved queue repository parents: %s %s\n") %
1321 1321 (short(qpp[0]), short(qpp[1])))
1322 1322 if qupdate:
1323 1323 self.ui.status(_("queue directory updating\n"))
1324 1324 r = self.qrepo()
1325 1325 if not r:
1326 self.ui.warn("Unable to load queue repository\n")
1326 self.ui.warn(_("Unable to load queue repository\n"))
1327 1327 return 1
1328 1328 hg.clean(r, qpp[0])
1329 1329
1330 1330 def save(self, repo, msg=None):
1331 1331 if len(self.applied) == 0:
1332 self.ui.warn("save: no patches applied, exiting\n")
1332 self.ui.warn(_("save: no patches applied, exiting\n"))
1333 1333 return 1
1334 1334 if self.issaveline(self.applied[-1]):
1335 self.ui.warn("status is already saved\n")
1335 self.ui.warn(_("status is already saved\n"))
1336 1336 return 1
1337 1337
1338 1338 ar = [ ':' + x for x in self.full_series ]
1339 1339 if not msg:
1340 msg = "hg patches saved state"
1340 msg = _("hg patches saved state")
1341 1341 else:
1342 1342 msg = "hg patches: " + msg.rstrip('\r\n')
1343 1343 r = self.qrepo()
@@ -1349,7 +1349,7 b' class queue:'
1349 1349 "\n".join(ar) + '\n' or "")
1350 1350 n = repo.commit(None, text, user=None, force=1)
1351 1351 if not n:
1352 self.ui.warn("repo commit failed\n")
1352 self.ui.warn(_("repo commit failed\n"))
1353 1353 return 1
1354 1354 self.applied.append(statusentry(revlog.hex(n),'.hg.patches.save.line'))
1355 1355 self.applied_dirty = 1
@@ -1959,10 +1959,10 b' def push(ui, repo, patch=None, **opts):'
1959 1959 else:
1960 1960 newpath, i = lastsavename(q.path)
1961 1961 if not newpath:
1962 ui.warn("no saved queues found, please use -n\n")
1962 ui.warn(_("no saved queues found, please use -n\n"))
1963 1963 return 1
1964 1964 mergeq = queue(ui, repo.join(""), newpath)
1965 ui.warn("merging with queue at: %s\n" % mergeq.path)
1965 ui.warn(_("merging with queue at: %s\n") % mergeq.path)
1966 1966 ret = q.push(repo, patch, force=opts['force'], list=opts['list'],
1967 1967 mergeq=mergeq)
1968 1968 return ret
@@ -1976,7 +1976,7 b' def pop(ui, repo, patch=None, **opts):'
1976 1976 localupdate = True
1977 1977 if opts['name']:
1978 1978 q = queue(ui, repo.join(""), repo.join(opts['name']))
1979 ui.warn('using patch queue: %s\n' % q.path)
1979 ui.warn(_('using patch queue: %s\n') % q.path)
1980 1980 localupdate = False
1981 1981 else:
1982 1982 q = repo.mq
@@ -2075,7 +2075,7 b' def save(ui, repo, **opts):'
2075 2075 'use -f to force') % newpath)
2076 2076 else:
2077 2077 newpath = savename(path)
2078 ui.warn("copy %s to %s\n" % (path, newpath))
2078 ui.warn(_("copy %s to %s\n") % (path, newpath))
2079 2079 util.copyfiles(path, newpath)
2080 2080 if opts['empty']:
2081 2081 try:
@@ -2278,7 +2278,7 b' def reposetup(ui, repo):'
2278 2278 mqtags = [(revlog.bin(patch.rev), patch.name) for patch in q.applied]
2279 2279
2280 2280 if mqtags[-1][0] not in self.changelog.nodemap:
2281 self.ui.warn('mq status file refers to unknown node %s\n'
2281 self.ui.warn(_('mq status file refers to unknown node %s\n')
2282 2282 % revlog.short(mqtags[-1][0]))
2283 2283 return tagscache
2284 2284
@@ -2287,7 +2287,8 b' def reposetup(ui, repo):'
2287 2287 mqtags.append((self.changelog.parents(mqtags[0][0])[0], 'qparent'))
2288 2288 for patch in mqtags:
2289 2289 if patch[1] in tagscache:
2290 self.ui.warn('Tag %s overrides mq patch of the same name\n' % patch[1])
2290 self.ui.warn(_('Tag %s overrides mq patch of the same name\n')
2291 % patch[1])
2291 2292 else:
2292 2293 tagscache[patch[1]] = patch[0]
2293 2294
@@ -2301,7 +2302,7 b' def reposetup(ui, repo):'
2301 2302 cl = self.changelog
2302 2303 qbasenode = revlog.bin(q.applied[0].rev)
2303 2304 if qbasenode not in cl.nodemap:
2304 self.ui.warn('mq status file refers to unknown node %s\n'
2305 self.ui.warn(_('mq status file refers to unknown node %s\n')
2305 2306 % revlog.short(qbasenode))
2306 2307 return super(mqrepo, self)._branchtags(partial, lrev)
2307 2308
General Comments 0
You need to be logged in to leave comments. Login now