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