Show More
@@ -44,11 +44,11 class changelog(revlog): | |||
|
44 | 44 | try: |
|
45 | 45 | when, offset = map(int, date.split(' ')) |
|
46 | 46 | except ValueError: |
|
47 | raise ValueError('invalid date: %r' % date) | |
|
47 | raise ValueError(_('invalid date: %r') % date) | |
|
48 | 48 | if abs(when) > 0x7fffffff: |
|
49 | raise ValueError('date exceeds 32 bits: %d' % when) | |
|
49 | raise ValueError(_('date exceeds 32 bits: %d') % when) | |
|
50 | 50 | if abs(offset) >= 43200: |
|
51 | raise ValueError('impossible time zone offset: %d' % offset) | |
|
51 | raise ValueError(_('impossible time zone offset: %d') % offset) | |
|
52 | 52 | else: |
|
53 | 53 | date = "%d %d" % util.makedate() |
|
54 | 54 | list.sort() |
This diff has been collapsed as it changes many lines, (614 lines changed) Show them Hide them | |||
@@ -179,7 +179,7 def revrange(ui, repo, revs, revlog=None | |||
|
179 | 179 | try: |
|
180 | 180 | num = revlog.rev(revlog.lookup(val)) |
|
181 | 181 | except KeyError: |
|
182 | raise util.Abort('invalid revision identifier %s', val) | |
|
182 | raise util.Abort(_('invalid revision identifier %s'), val) | |
|
183 | 183 | return num |
|
184 | 184 | seen = {} |
|
185 | 185 | for spec in revs: |
@@ -239,7 +239,7 def make_filename(repo, r, pat, node=Non | |||
|
239 | 239 | i += 1 |
|
240 | 240 | return ''.join(newname) |
|
241 | 241 | except KeyError, inst: |
|
242 | raise util.Abort("invalid format spec '%%%s' in output file name", | |
|
242 | raise util.Abort(_("invalid format spec '%%%s' in output file name"), | |
|
243 | 243 | inst.args[0]) |
|
244 | 244 | |
|
245 | 245 | def make_file(repo, r, pat, node=None, |
@@ -333,52 +333,52 def show_changeset(ui, repo, rev=0, chan | |||
|
333 | 333 | parents = [] |
|
334 | 334 | |
|
335 | 335 | if ui.verbose: |
|
336 | ui.write("changeset: %d:%s\n" % (rev, hex(changenode))) | |
|
336 | ui.write(_("changeset: %d:%s\n") % (rev, hex(changenode))) | |
|
337 | 337 | else: |
|
338 | ui.write("changeset: %d:%s\n" % (rev, short(changenode))) | |
|
338 | ui.write(_("changeset: %d:%s\n") % (rev, short(changenode))) | |
|
339 | 339 | |
|
340 | 340 | for tag in repo.nodetags(changenode): |
|
341 | ui.status("tag: %s\n" % tag) | |
|
341 | ui.status(_("tag: %s\n") % tag) | |
|
342 | 342 | for parent in parents: |
|
343 | ui.write("parent: %d:%s\n" % parent) | |
|
343 | ui.write(_("parent: %d:%s\n") % parent) | |
|
344 | 344 | |
|
345 | 345 | if brinfo and changenode in brinfo: |
|
346 | 346 | br = brinfo[changenode] |
|
347 | ui.write("branch: %s\n" % " ".join(br)) | |
|
347 | ui.write(_("branch: %s\n") % " ".join(br)) | |
|
348 | 348 | |
|
349 | ui.debug("manifest: %d:%s\n" % (repo.manifest.rev(changes[0]), | |
|
349 | ui.debug(_("manifest: %d:%s\n") % (repo.manifest.rev(changes[0]), | |
|
350 | 350 | hex(changes[0]))) |
|
351 | ui.status("user: %s\n" % changes[1]) | |
|
352 | ui.status("date: %s\n" % date) | |
|
351 | ui.status(_("user: %s\n") % changes[1]) | |
|
352 | ui.status(_("date: %s\n") % date) | |
|
353 | 353 | |
|
354 | 354 | if ui.debugflag: |
|
355 | 355 | files = repo.changes(log.parents(changenode)[0], changenode) |
|
356 | for key, value in zip(["files:", "files+:", "files-:"], files): | |
|
356 | for key, value in zip([_("files:"), _("files+:"), _("files-:")], files): | |
|
357 | 357 | if value: |
|
358 | 358 | ui.note("%-12s %s\n" % (key, " ".join(value))) |
|
359 | 359 | else: |
|
360 | ui.note("files: %s\n" % " ".join(changes[3])) | |
|
360 | ui.note(_("files: %s\n") % " ".join(changes[3])) | |
|
361 | 361 | |
|
362 | 362 | description = changes[4].strip() |
|
363 | 363 | if description: |
|
364 | 364 | if ui.verbose: |
|
365 | ui.status("description:\n") | |
|
365 | ui.status(_("description:\n")) | |
|
366 | 366 | ui.status(description) |
|
367 | 367 | ui.status("\n\n") |
|
368 | 368 | else: |
|
369 | ui.status("summary: %s\n" % description.splitlines()[0]) | |
|
369 | ui.status(_("summary: %s\n") % description.splitlines()[0]) | |
|
370 | 370 | ui.status("\n") |
|
371 | 371 | |
|
372 | 372 | def show_version(ui): |
|
373 | 373 | """output version and copyright information""" |
|
374 | ui.write("Mercurial Distributed SCM (version %s)\n" | |
|
374 | ui.write(_("Mercurial Distributed SCM (version %s)\n") | |
|
375 | 375 | % version.get_version()) |
|
376 | ui.status( | |
|
376 | ui.status(_( | |
|
377 | 377 | "\nCopyright (C) 2005 Matt Mackall <mpm@selenic.com>\n" |
|
378 | 378 | "This is free software; see the source for copying conditions. " |
|
379 | 379 | "There is NO\nwarranty; " |
|
380 | 380 | "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" |
|
381 | ) | |
|
381 | )) | |
|
382 | 382 | |
|
383 | 383 | def help_(ui, cmd=None, with_version=False): |
|
384 | 384 | """show help for a given command or all commands""" |
@@ -401,7 +401,7 def help_(ui, cmd=None, with_version=Fal | |||
|
401 | 401 | # aliases |
|
402 | 402 | aliases = ', '.join(key.split('|')[1:]) |
|
403 | 403 | if aliases: |
|
404 | ui.write("\naliases: %s\n" % aliases) | |
|
404 | ui.write(_("\naliases: %s\n") % aliases) | |
|
405 | 405 | |
|
406 | 406 | # options |
|
407 | 407 | if i[1]: |
@@ -412,18 +412,18 def help_(ui, cmd=None, with_version=Fal | |||
|
412 | 412 | if ui.verbose or with_version: |
|
413 | 413 | show_version(ui) |
|
414 | 414 | else: |
|
415 | ui.status("Mercurial Distributed SCM\n") | |
|
415 | ui.status(_("Mercurial Distributed SCM\n")) | |
|
416 | 416 | ui.status('\n') |
|
417 | 417 | |
|
418 | 418 | # list of commands |
|
419 | 419 | if cmd == "shortlist": |
|
420 | ui.status('basic commands (use "hg help" ' | |
|
421 | 'for the full list or option "-v" for details):\n\n') | |
|
420 | ui.status(_('basic commands (use "hg help" ' | |
|
421 | 'for the full list or option "-v" for details):\n\n')) | |
|
422 | 422 | elif ui.verbose: |
|
423 | ui.status('list of commands:\n\n') | |
|
423 | ui.status(_('list of commands:\n\n')) | |
|
424 | 424 | else: |
|
425 | ui.status('list of commands (use "hg help -v" ' | |
|
426 | 'to show aliases and global options):\n\n') | |
|
425 | ui.status(_('list of commands (use "hg help -v" ' | |
|
426 | 'to show aliases and global options):\n\n')) | |
|
427 | 427 | |
|
428 | 428 | h = {} |
|
429 | 429 | cmds = {} |
@@ -462,7 +462,7 def help_(ui, cmd=None, with_version=Fal | |||
|
462 | 462 | opt_output.append(("%2s%s" % (shortopt and "-%s" % shortopt, |
|
463 | 463 | longopt and " --%s" % longopt), |
|
464 | 464 | "%s%s" % (desc, |
|
465 | default and " (default: %s)" % default | |
|
465 | default and _(" (default: %s)") % default | |
|
466 | 466 | or ""))) |
|
467 | 467 | |
|
468 | 468 | if opt_output: |
@@ -480,10 +480,10 def add(ui, repo, *pats, **opts): | |||
|
480 | 480 | names = [] |
|
481 | 481 | for src, abs, rel, exact in walk(repo, pats, opts): |
|
482 | 482 | if exact: |
|
483 | if ui.verbose: ui.status('adding %s\n' % rel) | |
|
483 | if ui.verbose: ui.status(_('adding %s\n') % rel) | |
|
484 | 484 | names.append(abs) |
|
485 | 485 | elif repo.dirstate.state(abs) == '?': |
|
486 | ui.status('adding %s\n' % rel) | |
|
486 | ui.status(_('adding %s\n') % rel) | |
|
487 | 487 | names.append(abs) |
|
488 | 488 | repo.add(names) |
|
489 | 489 | |
@@ -494,11 +494,11 def addremove(ui, repo, *pats, **opts): | |||
|
494 | 494 | if src == 'f' and repo.dirstate.state(abs) == '?': |
|
495 | 495 | add.append(abs) |
|
496 | 496 | if ui.verbose or not exact: |
|
497 |
ui.status('adding |
|
|
497 | ui.status(_('adding %s\n') % rel) | |
|
498 | 498 | if repo.dirstate.state(abs) != 'r' and not os.path.exists(rel): |
|
499 | 499 | remove.append(abs) |
|
500 | 500 | if ui.verbose or not exact: |
|
501 |
ui.status('removing |
|
|
501 | ui.status(_('removing %s\n') % rel) | |
|
502 | 502 | repo.add(add) |
|
503 | 503 | repo.remove(remove) |
|
504 | 504 | |
@@ -513,7 +513,7 def annotate(ui, repo, *pats, **opts): | |||
|
513 | 513 | return trimuser(ui, cl[1], rev, ucache) |
|
514 | 514 | |
|
515 | 515 | if not pats: |
|
516 | raise util.Abort('at least one file name or pattern required') | |
|
516 | raise util.Abort(_('at least one file name or pattern required')) | |
|
517 | 517 | |
|
518 | 518 | opmap = [['user', getname], ['number', str], ['changeset', getnode]] |
|
519 | 519 | if not opts['user'] and not opts['changeset']: |
@@ -528,12 +528,12 def annotate(ui, repo, *pats, **opts): | |||
|
528 | 528 | |
|
529 | 529 | for src, abs, rel, exact in walk(repo, pats, opts): |
|
530 | 530 | if abs not in mmap: |
|
531 | ui.warn("warning: %s is not in the repository!\n" % rel) | |
|
531 | ui.warn(_("warning: %s is not in the repository!\n") % rel) | |
|
532 | 532 | continue |
|
533 | 533 | |
|
534 | 534 | f = repo.file(abs) |
|
535 | 535 | if not opts['text'] and util.binary(f.read(mmap[abs])): |
|
536 | ui.write("%s: binary file\n" % rel) | |
|
536 | ui.write(_("%s: binary file\n") % rel) | |
|
537 | 537 | continue |
|
538 | 538 | |
|
539 | 539 | lines = f.annotate(mmap[abs]) |
@@ -586,7 +586,7 def cat(ui, repo, file1, *pats, **opts): | |||
|
586 | 586 | try: |
|
587 | 587 | n = r.lookup(rev) |
|
588 | 588 | except KeyError, inst: |
|
589 | raise util.Abort('cannot find file %s in rev %s', rel, rev) | |
|
589 | raise util.Abort(_('cannot find file %s in rev %s'), rel, rev) | |
|
590 | 590 | else: |
|
591 | 591 | n = r.tip() |
|
592 | 592 | fp = make_file(repo, r, opts['output'], node=n, pathname=abs) |
@@ -598,7 +598,7 def clone(ui, source, dest=None, **opts) | |||
|
598 | 598 | dest = os.path.basename(os.path.normpath(source)) |
|
599 | 599 | |
|
600 | 600 | if os.path.exists(dest): |
|
601 | raise util.Abort("destination '%s' already exists", dest) | |
|
601 | raise util.Abort(_("destination '%s' already exists"), dest) | |
|
602 | 602 | |
|
603 | 603 | dest = os.path.realpath(dest) |
|
604 | 604 | |
@@ -670,14 +670,14 def clone(ui, source, dest=None, **opts) | |||
|
670 | 670 | def commit(ui, repo, *pats, **opts): |
|
671 | 671 | """commit the specified files or all outstanding changes""" |
|
672 | 672 | if opts['text']: |
|
673 | ui.warn("Warning: -t and --text is deprecated," | |
|
674 | " please use -m or --message instead.\n") | |
|
673 | ui.warn(_("Warning: -t and --text is deprecated," | |
|
674 | " please use -m or --message instead.\n")) | |
|
675 | 675 | message = opts['message'] or opts['text'] |
|
676 | 676 | logfile = opts['logfile'] |
|
677 | 677 | |
|
678 | 678 | if message and logfile: |
|
679 | raise util.Abort('options --message and --logfile are mutually ' | |
|
680 | 'exclusive') | |
|
679 | raise util.Abort(_('options --message and --logfile are mutually ' | |
|
680 | 'exclusive')) | |
|
681 | 681 | if not message and logfile: |
|
682 | 682 | try: |
|
683 | 683 | if logfile == '-': |
@@ -685,7 +685,7 def commit(ui, repo, *pats, **opts): | |||
|
685 | 685 | else: |
|
686 | 686 | message = open(logfile).read() |
|
687 | 687 | except IOError, inst: |
|
688 | raise util.Abort("can't read commit message '%s': %s" % | |
|
688 | raise util.Abort(_("can't read commit message '%s': %s") % | |
|
689 | 689 | (logfile, inst.strerror)) |
|
690 | 690 | |
|
691 | 691 | if opts['addremove']: |
@@ -708,19 +708,19 def commit(ui, repo, *pats, **opts): | |||
|
708 | 708 | |
|
709 | 709 | def docopy(ui, repo, pats, opts): |
|
710 | 710 | if not pats: |
|
711 | raise util.Abort('no source or destination specified') | |
|
711 | raise util.Abort(_('no source or destination specified')) | |
|
712 | 712 | elif len(pats) == 1: |
|
713 | raise util.Abort('no destination specified') | |
|
713 | raise util.Abort(_('no destination specified')) | |
|
714 | 714 | pats = list(pats) |
|
715 | 715 | dest = pats.pop() |
|
716 | 716 | sources = [] |
|
717 | 717 | |
|
718 | 718 | def okaytocopy(abs, rel, exact): |
|
719 | reasons = {'?': 'is not managed', | |
|
720 | 'a': 'has been marked for add'} | |
|
719 | reasons = {'?': _('is not managed'), | |
|
720 | 'a': _('has been marked for add')} | |
|
721 | 721 | reason = reasons.get(repo.dirstate.state(abs)) |
|
722 | 722 | if reason: |
|
723 | if exact: ui.warn('%s: not copying - file %s\n' % (rel, reason)) | |
|
723 | if exact: ui.warn(_('%s: not copying - file %s\n') % (rel, reason)) | |
|
724 | 724 | else: |
|
725 | 725 | return True |
|
726 | 726 | |
@@ -728,7 +728,7 def docopy(ui, repo, pats, opts): | |||
|
728 | 728 | if okaytocopy(abs, rel, exact): |
|
729 | 729 | sources.append((abs, rel, exact)) |
|
730 | 730 | if not sources: |
|
731 | raise util.Abort('no files to copy') | |
|
731 | raise util.Abort(_('no files to copy')) | |
|
732 | 732 | |
|
733 | 733 | cwd = repo.getcwd() |
|
734 | 734 | absdest = util.canonpath(repo.root, cwd, dest) |
@@ -740,10 +740,10 def docopy(ui, repo, pats, opts): | |||
|
740 | 740 | |
|
741 | 741 | if destisfile: |
|
742 | 742 | if opts['parents']: |
|
743 | raise util.Abort('with --parents, destination must be a directory') | |
|
743 | raise util.Abort(_('with --parents, destination must be a directory')) | |
|
744 | 744 | elif len(sources) > 1: |
|
745 | raise util.Abort('with multiple sources, destination must be a ' | |
|
746 | 'directory') | |
|
745 | raise util.Abort(_('with multiple sources, destination must be a ' | |
|
746 | 'directory')) | |
|
747 | 747 | errs, copied = 0, [] |
|
748 | 748 | for abs, rel, exact in sources: |
|
749 | 749 | if opts['parents']: |
@@ -755,7 +755,7 def docopy(ui, repo, pats, opts): | |||
|
755 | 755 | myabsdest = util.canonpath(repo.root, cwd, mydest) |
|
756 | 756 | myreldest = util.pathto(cwd, myabsdest) |
|
757 | 757 | if not opts['force'] and repo.dirstate.state(myabsdest) not in 'a?': |
|
758 | ui.warn('%s: not overwriting - file already managed\n' % myreldest) | |
|
758 | ui.warn(_('%s: not overwriting - file already managed\n') % myreldest) | |
|
759 | 759 | continue |
|
760 | 760 | mydestdir = os.path.dirname(myreldest) or '.' |
|
761 | 761 | if not opts['after']: |
@@ -765,7 +765,7 def docopy(ui, repo, pats, opts): | |||
|
765 | 765 | except OSError, inst: |
|
766 | 766 | if inst.errno != errno.EEXIST: raise |
|
767 | 767 | if ui.verbose or not exact: |
|
768 | ui.status('copying %s to %s\n' % (rel, myreldest)) | |
|
768 | ui.status(_('copying %s to %s\n') % (rel, myreldest)) | |
|
769 | 769 | if not opts['after']: |
|
770 | 770 | try: |
|
771 | 771 | shutil.copyfile(rel, myreldest) |
@@ -774,15 +774,15 def docopy(ui, repo, pats, opts): | |||
|
774 | 774 | raise util.Abort(str(inst)) |
|
775 | 775 | except IOError, inst: |
|
776 | 776 | if inst.errno == errno.ENOENT: |
|
777 | ui.warn('%s: deleted in working copy\n' % rel) | |
|
777 | ui.warn(_('%s: deleted in working copy\n') % rel) | |
|
778 | 778 | else: |
|
779 | ui.warn('%s: cannot copy - %s\n' % (rel, inst.strerror)) | |
|
779 | ui.warn(_('%s: cannot copy - %s\n') % (rel, inst.strerror)) | |
|
780 | 780 | errs += 1 |
|
781 | 781 | continue |
|
782 | 782 | repo.copy(abs, myabsdest) |
|
783 | 783 | copied.append((abs, rel, exact)) |
|
784 | 784 | if errs: |
|
785 | ui.warn('(consider using --after)\n') | |
|
785 | ui.warn(_('(consider using --after)\n')) | |
|
786 | 786 | return errs, copied |
|
787 | 787 | |
|
788 | 788 | def copy(ui, repo, *pats, **opts): |
@@ -811,22 +811,22 def debugcheckstate(ui, repo): | |||
|
811 | 811 | for f in dc: |
|
812 | 812 | state = repo.dirstate.state(f) |
|
813 | 813 | if state in "nr" and f not in m1: |
|
814 | ui.warn("%s in state %s, but not in manifest1\n" % (f, state)) | |
|
814 | ui.warn(_("%s in state %s, but not in manifest1\n") % (f, state)) | |
|
815 | 815 | errors += 1 |
|
816 | 816 | if state in "a" and f in m1: |
|
817 | ui.warn("%s in state %s, but also in manifest1\n" % (f, state)) | |
|
817 | ui.warn(_("%s in state %s, but also in manifest1\n") % (f, state)) | |
|
818 | 818 | errors += 1 |
|
819 | 819 | if state in "m" and f not in m1 and f not in m2: |
|
820 | ui.warn("%s in state %s, but not in either manifest\n" % | |
|
820 | ui.warn(_("%s in state %s, but not in either manifest\n") % | |
|
821 | 821 | (f, state)) |
|
822 | 822 | errors += 1 |
|
823 | 823 | for f in m1: |
|
824 | 824 | state = repo.dirstate.state(f) |
|
825 | 825 | if state not in "nrm": |
|
826 | ui.warn("%s in manifest1, but listed as state %s" % (f, state)) | |
|
826 | ui.warn(_("%s in manifest1, but listed as state %s") % (f, state)) | |
|
827 | 827 | errors += 1 |
|
828 | 828 | if errors: |
|
829 | raise util.Abort(".hg/dirstate inconsistent with current parent's manifest") | |
|
829 | raise util.Abort(_(".hg/dirstate inconsistent with current parent's manifest")) | |
|
830 | 830 | |
|
831 | 831 | def debugconfig(ui): |
|
832 | 832 | """show combined config settings from all hgrc files""" |
@@ -862,7 +862,7 def debugstate(ui, repo): | |||
|
862 | 862 | time.strftime("%x %X", |
|
863 | 863 | time.localtime(dc[file_][3])), file_)) |
|
864 | 864 | for f in repo.dirstate.copies: |
|
865 | ui.write("copy: %s -> %s\n" % (repo.dirstate.copies[f], f)) | |
|
865 | ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copies[f], f)) | |
|
866 | 866 | |
|
867 | 867 | def debugdata(ui, file_, rev): |
|
868 | 868 | """dump the contents of an data file revision""" |
@@ -870,7 +870,7 def debugdata(ui, file_, rev): | |||
|
870 | 870 | try: |
|
871 | 871 | ui.write(r.revision(r.lookup(rev))) |
|
872 | 872 | except KeyError: |
|
873 | raise util.Abort('invalid revision identifier %s', rev) | |
|
873 | raise util.Abort(_('invalid revision identifier %s'), rev) | |
|
874 | 874 | |
|
875 | 875 | def debugindex(ui, file_): |
|
876 | 876 | """dump the contents of an index file""" |
@@ -910,9 +910,9 def debugrename(ui, repo, file, rev=None | |||
|
910 | 910 | n = r.tip() |
|
911 | 911 | m = r.renamed(n) |
|
912 | 912 | if m: |
|
913 | ui.write("renamed from %s:%s\n" % (m[0], hex(m[1]))) | |
|
913 | ui.write(_("renamed from %s:%s\n") % (m[0], hex(m[1]))) | |
|
914 | 914 | else: |
|
915 | ui.write("not renamed\n") | |
|
915 | ui.write(_("not renamed\n")) | |
|
916 | 916 | |
|
917 | 917 | def debugwalk(ui, repo, *pats, **opts): |
|
918 | 918 | """show how files match on given patterns""" |
@@ -936,7 +936,7 def diff(ui, repo, *pats, **opts): | |||
|
936 | 936 | if len(revs) > 1: |
|
937 | 937 | node2 = revs[1] |
|
938 | 938 | if len(revs) > 2: |
|
939 | raise util.Abort("too many revisions to diff") | |
|
939 | raise util.Abort(_("too many revisions to diff")) | |
|
940 | 940 | |
|
941 | 941 | fns, matchfn, anypats = matchpats(repo, repo.getcwd(), pats, opts) |
|
942 | 942 | |
@@ -970,12 +970,12 def doexport(ui, repo, changeset, seqno, | |||
|
970 | 970 | def export(ui, repo, *changesets, **opts): |
|
971 | 971 | """dump the header and diffs for one or more changesets""" |
|
972 | 972 | if not changesets: |
|
973 | raise util.Abort("export requires at least one changeset") | |
|
973 | raise util.Abort(_("export requires at least one changeset")) | |
|
974 | 974 | seqno = 0 |
|
975 | 975 | revs = list(revrange(ui, repo, changesets)) |
|
976 | 976 | total = len(revs) |
|
977 | 977 | revwidth = max(map(len, revs)) |
|
978 | ui.note(len(revs) > 1 and "Exporting patches:\n" or "Exporting patch:\n") | |
|
978 | ui.note(len(revs) > 1 and _("Exporting patches:\n") or _("Exporting patch:\n")) | |
|
979 | 979 | for cset in revs: |
|
980 | 980 | seqno += 1 |
|
981 | 981 | doexport(ui, repo, cset, seqno, total, revwidth, opts) |
@@ -987,7 +987,7 def forget(ui, repo, *pats, **opts): | |||
|
987 | 987 | if repo.dirstate.state(abs) == 'a': |
|
988 | 988 | forget.append(abs) |
|
989 | 989 | if ui.verbose or not exact: |
|
990 |
ui.status('forgetting |
|
|
990 | ui.status(_('forgetting %s\n') % rel) | |
|
991 | 991 | repo.forget(forget) |
|
992 | 992 | |
|
993 | 993 | def grep(ui, repo, pattern, *pats, **opts): |
@@ -1122,7 +1122,7 def identify(ui, repo): | |||
|
1122 | 1122 | """print information about the working copy""" |
|
1123 | 1123 | parents = [p for p in repo.dirstate.parents() if p != nullid] |
|
1124 | 1124 | if not parents: |
|
1125 | ui.write("unknown\n") | |
|
1125 | ui.write(_("unknown\n")) | |
|
1126 | 1126 | return |
|
1127 | 1127 | |
|
1128 | 1128 | hexfunc = ui.verbose and hex or short |
@@ -1147,7 +1147,7 def import_(ui, repo, patch1, *patches, | |||
|
1147 | 1147 | if not opts['force']: |
|
1148 | 1148 | (c, a, d, u) = repo.changes() |
|
1149 | 1149 | if c or a or d: |
|
1150 | raise util.Abort("outstanding uncommitted changes") | |
|
1150 | raise util.Abort(_("outstanding uncommitted changes")) | |
|
1151 | 1151 | |
|
1152 | 1152 | d = opts["base"] |
|
1153 | 1153 | strip = opts["strip"] |
@@ -1161,7 +1161,7 def import_(ui, repo, patch1, *patches, | |||
|
1161 | 1161 | '(---|\*\*\*)[ \t])') |
|
1162 | 1162 | |
|
1163 | 1163 | for patch in patches: |
|
1164 | ui.status("applying %s\n" % patch) | |
|
1164 | ui.status(_("applying %s\n") % patch) | |
|
1165 | 1165 | pf = os.path.join(d, patch) |
|
1166 | 1166 | |
|
1167 | 1167 | message = [] |
@@ -1172,15 +1172,15 def import_(ui, repo, patch1, *patches, | |||
|
1172 | 1172 | if (not message and not hgpatch and |
|
1173 | 1173 | mailre.match(line) and not opts['force']): |
|
1174 | 1174 | if len(line) > 35: line = line[:32] + '...' |
|
1175 | raise util.Abort('first line looks like a ' | |
|
1176 | 'mail header: ' + line) | |
|
1175 | raise util.Abort(_('first line looks like a ' | |
|
1176 | 'mail header: ') + line) | |
|
1177 | 1177 | if diffre.match(line): |
|
1178 | 1178 | break |
|
1179 | 1179 | elif hgpatch: |
|
1180 | 1180 | # parse values when importing the result of an hg export |
|
1181 | 1181 | if line.startswith("# User "): |
|
1182 | 1182 | user = line[7:] |
|
1183 | ui.debug('User: %s\n' % user) | |
|
1183 | ui.debug(_('User: %s\n') % user) | |
|
1184 | 1184 | elif not line.startswith("# ") and line: |
|
1185 | 1185 | message.append(line) |
|
1186 | 1186 | hgpatch = False |
@@ -1192,10 +1192,10 def import_(ui, repo, patch1, *patches, | |||
|
1192 | 1192 | |
|
1193 | 1193 | # make sure message isn't empty |
|
1194 | 1194 | if not message: |
|
1195 | message = "imported patch %s\n" % patch | |
|
1195 | message = _("imported patch %s\n") % patch | |
|
1196 | 1196 | else: |
|
1197 | 1197 | message = "%s\n" % '\n'.join(message) |
|
1198 | ui.debug('message:\n%s\n' % message) | |
|
1198 | ui.debug(_('message:\n%s\n') % message) | |
|
1199 | 1199 | |
|
1200 | 1200 | files = util.patch(strip, pf, ui) |
|
1201 | 1201 | |
@@ -1208,7 +1208,7 def incoming(ui, repo, source="default", | |||
|
1208 | 1208 | source = ui.expandpath(source) |
|
1209 | 1209 | other = hg.repository(ui, source) |
|
1210 | 1210 | if not other.local(): |
|
1211 | raise util.Abort("incoming doesn't work for remote repositories yet") | |
|
1211 | raise util.Abort(_("incoming doesn't work for remote repositories yet")) | |
|
1212 | 1212 | o = repo.findincoming(other) |
|
1213 | 1213 | if not o: |
|
1214 | 1214 | return |
@@ -1355,7 +1355,7 def paths(ui, search=None): | |||
|
1355 | 1355 | if name == search: |
|
1356 | 1356 | ui.write("%s\n" % path) |
|
1357 | 1357 | return |
|
1358 | ui.warn("not found!\n") | |
|
1358 | ui.warn(_("not found!\n")) | |
|
1359 | 1359 | return 1 |
|
1360 | 1360 | else: |
|
1361 | 1361 | for name, path in ui.configitems("paths"): |
@@ -1364,7 +1364,7 def paths(ui, search=None): | |||
|
1364 | 1364 | def pull(ui, repo, source="default", **opts): |
|
1365 | 1365 | """pull changes from the specified source""" |
|
1366 | 1366 | source = ui.expandpath(source) |
|
1367 | ui.status('pulling from %s\n' % (source)) | |
|
1367 | ui.status(_('pulling from %s\n') % (source)) | |
|
1368 | 1368 | |
|
1369 | 1369 | if opts['ssh']: |
|
1370 | 1370 | ui.setconfig("ui", "ssh", opts['ssh']) |
@@ -1377,7 +1377,7 def pull(ui, repo, source="default", **o | |||
|
1377 | 1377 | if opts['update']: |
|
1378 | 1378 | return update(ui, repo) |
|
1379 | 1379 | else: |
|
1380 | ui.status("(run 'hg update' to get a working copy)\n") | |
|
1380 | ui.status(_("(run 'hg update' to get a working copy)\n")) | |
|
1381 | 1381 | |
|
1382 | 1382 | return r |
|
1383 | 1383 | |
@@ -1398,8 +1398,8 def push(ui, repo, dest="default-push", | |||
|
1398 | 1398 | def rawcommit(ui, repo, *flist, **rc): |
|
1399 | 1399 | "raw commit interface" |
|
1400 | 1400 | if rc['text']: |
|
1401 | ui.warn("Warning: -t and --text is deprecated," | |
|
1402 | " please use -m or --message instead.\n") | |
|
1401 | ui.warn(_("Warning: -t and --text is deprecated," | |
|
1402 | " please use -m or --message instead.\n")) | |
|
1403 | 1403 | message = rc['message'] or rc['text'] |
|
1404 | 1404 | if not message and rc['logfile']: |
|
1405 | 1405 | try: |
@@ -1407,7 +1407,7 def rawcommit(ui, repo, *flist, **rc): | |||
|
1407 | 1407 | except IOError: |
|
1408 | 1408 | pass |
|
1409 | 1409 | if not message and not rc['logfile']: |
|
1410 | raise util.Abort("missing commit message") | |
|
1410 | raise util.Abort(_("missing commit message")) | |
|
1411 | 1411 | |
|
1412 | 1412 | files = relpath(repo, list(flist)) |
|
1413 | 1413 | if rc['files']: |
@@ -1430,16 +1430,16 def remove(ui, repo, pat, *pats, **opts) | |||
|
1430 | 1430 | def okaytoremove(abs, rel, exact): |
|
1431 | 1431 | c, a, d, u = repo.changes(files = [abs]) |
|
1432 | 1432 | reason = None |
|
1433 | if c: reason = 'is modified' | |
|
1434 | elif a: reason = 'has been marked for add' | |
|
1435 | elif u: reason = 'is not managed' | |
|
1433 | if c: reason = _('is modified') | |
|
1434 | elif a: reason = _('has been marked for add') | |
|
1435 | elif u: reason = _('is not managed') | |
|
1436 | 1436 | if reason: |
|
1437 | if exact: ui.warn('not removing %s: file %s\n' % (rel, reason)) | |
|
1437 | if exact: ui.warn(_('not removing %s: file %s\n') % (rel, reason)) | |
|
1438 | 1438 | else: |
|
1439 | 1439 | return True |
|
1440 | 1440 | for src, abs, rel, exact in walk(repo, (pat,) + pats, opts): |
|
1441 | 1441 | if okaytoremove(abs, rel, exact): |
|
1442 | if ui.verbose or not exact: ui.status('removing %s\n' % rel) | |
|
1442 | if ui.verbose or not exact: ui.status(_('removing %s\n') % rel) | |
|
1443 | 1443 | names.append(abs) |
|
1444 | 1444 | for name in names: |
|
1445 | 1445 | try: |
@@ -1453,7 +1453,7 def rename(ui, repo, *pats, **opts): | |||
|
1453 | 1453 | errs, copied = docopy(ui, repo, pats, opts) |
|
1454 | 1454 | names = [] |
|
1455 | 1455 | for abs, rel, exact in copied: |
|
1456 | if ui.verbose or not exact: ui.status('removing %s\n' % rel) | |
|
1456 | if ui.verbose or not exact: ui.status(_('removing %s\n') % rel) | |
|
1457 | 1457 | try: |
|
1458 | 1458 | os.unlink(rel) |
|
1459 | 1459 | except OSError, inst: |
@@ -1505,7 +1505,7 def revert(ui, repo, *names, **opts): | |||
|
1505 | 1505 | r = repo.update(node, False, True, choose, False) |
|
1506 | 1506 | for n in relnames: |
|
1507 | 1507 | if n not in chosen: |
|
1508 | ui.warn('error: no matches for %s\n' % n) | |
|
1508 | ui.warn(_('error: no matches for %s\n') % n) | |
|
1509 | 1509 | r = 1 |
|
1510 | 1510 | sys.stdout.flush() |
|
1511 | 1511 | return r |
@@ -1605,9 +1605,9 def serve(ui, repo, **opts): | |||
|
1605 | 1605 | except socket.error: |
|
1606 | 1606 | pass |
|
1607 | 1607 | if port != 80: |
|
1608 | ui.status('listening at http://%s:%d/\n' % (addr, port)) | |
|
1608 | ui.status(_('listening at http://%s:%d/\n') % (addr, port)) | |
|
1609 | 1609 | else: |
|
1610 | ui.status('listening at http://%s/\n' % addr) | |
|
1610 | ui.status(_('listening at http://%s/\n') % addr) | |
|
1611 | 1611 | httpd.serve_forever() |
|
1612 | 1612 | |
|
1613 | 1613 | def status(ui, repo, *pats, **opts): |
@@ -1624,10 +1624,10 def status(ui, repo, *pats, **opts): | |||
|
1624 | 1624 | (c, a, d, u) = [[util.pathto(cwd, x) for x in n] |
|
1625 | 1625 | for n in repo.changes(files=files, match=matchfn)] |
|
1626 | 1626 | |
|
1627 | changetypes = [('modified', 'M', c), | |
|
1628 | ('added', 'A', a), | |
|
1629 | ('removed', 'R', d), | |
|
1630 | ('unknown', '?', u)] | |
|
1627 | changetypes = [(_('modified'), 'M', c), | |
|
1628 | (_('added'), 'A', a), | |
|
1629 | (_('removed'), 'R', d), | |
|
1630 | (_('unknown'), '?', u)] | |
|
1631 | 1631 | |
|
1632 | 1632 | end = opts['print0'] and '\0' or '\n' |
|
1633 | 1633 | |
@@ -1644,17 +1644,17 def status(ui, repo, *pats, **opts): | |||
|
1644 | 1644 | def tag(ui, repo, name, rev=None, **opts): |
|
1645 | 1645 | """add a tag for the current tip or a given revision""" |
|
1646 | 1646 | if opts['text']: |
|
1647 | ui.warn("Warning: -t and --text is deprecated," | |
|
1648 | " please use -m or --message instead.\n") | |
|
1647 | ui.warn(_("Warning: -t and --text is deprecated," | |
|
1648 | " please use -m or --message instead.\n")) | |
|
1649 | 1649 | if name == "tip": |
|
1650 | raise util.Abort("the name 'tip' is reserved") | |
|
1650 | raise util.Abort(_("the name 'tip' is reserved")) | |
|
1651 | 1651 | if rev: |
|
1652 | 1652 | r = hex(repo.lookup(rev)) |
|
1653 | 1653 | else: |
|
1654 | 1654 | r = hex(repo.changelog.tip()) |
|
1655 | 1655 | |
|
1656 | 1656 | if name.find(revrangesep) >= 0: |
|
1657 | raise util.Abort("'%s' cannot be used in a tag name" % revrangesep) | |
|
1657 | raise util.Abort(_("'%s' cannot be used in a tag name") % revrangesep) | |
|
1658 | 1658 | |
|
1659 | 1659 | if opts['local']: |
|
1660 | 1660 | repo.opener("localtags", "a").write("%s %s\n" % (r, name)) |
@@ -1663,15 +1663,15 def tag(ui, repo, name, rev=None, **opts | |||
|
1663 | 1663 | (c, a, d, u) = repo.changes() |
|
1664 | 1664 | for x in (c, a, d, u): |
|
1665 | 1665 | if ".hgtags" in x: |
|
1666 | raise util.Abort("working copy of .hgtags is changed " | |
|
1667 | "(please commit .hgtags manually)") | |
|
1666 | raise util.Abort(_("working copy of .hgtags is changed " | |
|
1667 | "(please commit .hgtags manually)")) | |
|
1668 | 1668 | |
|
1669 | 1669 | repo.wfile(".hgtags", "ab").write("%s %s\n" % (r, name)) |
|
1670 | 1670 | if repo.dirstate.state(".hgtags") == '?': |
|
1671 | 1671 | repo.add([".hgtags"]) |
|
1672 | 1672 | |
|
1673 | 1673 | message = (opts['message'] or opts['text'] or |
|
1674 | "Added tag %s for changeset %s" % (name, r)) | |
|
1674 | _("Added tag %s for changeset %s") % (name, r)) | |
|
1675 | 1675 | try: |
|
1676 | 1676 | repo.commit([".hgtags"], message, opts['user'], opts['date']) |
|
1677 | 1677 | except ValueError, inst: |
@@ -1699,7 +1699,7 def unbundle(ui, repo, fname): | |||
|
1699 | 1699 | f = urllib.urlopen(fname) |
|
1700 | 1700 | |
|
1701 | 1701 | if f.read(4) != "HG10": |
|
1702 | raise util.Abort("%s: not a Mercurial bundle file" % fname) | |
|
1702 | raise util.Abort(_("%s: not a Mercurial bundle file") % fname) | |
|
1703 | 1703 | |
|
1704 | 1704 | def bzgenerator(f): |
|
1705 | 1705 | zd = bz2.BZ2Decompressor() |
@@ -1745,15 +1745,15 def update(ui, repo, node=None, merge=Fa | |||
|
1745 | 1745 | if branch in br[x]: |
|
1746 | 1746 | found.append(x) |
|
1747 | 1747 | if len(found) > 1: |
|
1748 | ui.warn("Found multiple heads for %s\n" % branch) | |
|
1748 | ui.warn(_("Found multiple heads for %s\n") % branch) | |
|
1749 | 1749 | for x in found: |
|
1750 | 1750 | show_changeset(ui, repo, changenode=x, brinfo=br) |
|
1751 | 1751 | return 1 |
|
1752 | 1752 | if len(found) == 1: |
|
1753 | 1753 | node = found[0] |
|
1754 | ui.warn("Using head %s for branch %s\n" % (short(node), branch)) | |
|
1754 | ui.warn(_("Using head %s for branch %s\n") % (short(node), branch)) | |
|
1755 | 1755 | else: |
|
1756 | ui.warn("branch %s not found\n" % (branch)) | |
|
1756 | ui.warn(_("branch %s not found\n") % (branch)) | |
|
1757 | 1757 | return 1 |
|
1758 | 1758 | else: |
|
1759 | 1759 | node = node and repo.lookup(node) or repo.changelog.tip() |
@@ -1768,243 +1768,243 def verify(ui, repo): | |||
|
1768 | 1768 | table = { |
|
1769 | 1769 | "^add": |
|
1770 | 1770 | (add, |
|
1771 | [('I', 'include', [], 'include path in search'), | |
|
1772 | ('X', 'exclude', [], 'exclude path from search')], | |
|
1771 | [('I', 'include', [], _('include path in search')), | |
|
1772 | ('X', 'exclude', [], _('exclude path from search'))], | |
|
1773 | 1773 | "hg add [OPTION]... [FILE]..."), |
|
1774 | 1774 | "addremove": |
|
1775 | 1775 | (addremove, |
|
1776 | [('I', 'include', [], 'include path in search'), | |
|
1777 | ('X', 'exclude', [], 'exclude path from search')], | |
|
1778 | "hg addremove [OPTION]... [FILE]..."), | |
|
1776 | [('I', 'include', [], _('include path in search')), | |
|
1777 | ('X', 'exclude', [], _('exclude path from search'))], | |
|
1778 | _("hg addremove [OPTION]... [FILE]...")), | |
|
1779 | 1779 | "^annotate": |
|
1780 | 1780 | (annotate, |
|
1781 | [('r', 'rev', '', 'revision'), | |
|
1782 | ('a', 'text', None, 'treat all files as text'), | |
|
1783 | ('u', 'user', None, 'show user'), | |
|
1784 | ('n', 'number', None, 'show revision number'), | |
|
1785 | ('c', 'changeset', None, 'show changeset'), | |
|
1786 | ('I', 'include', [], 'include path in search'), | |
|
1787 | ('X', 'exclude', [], 'exclude path from search')], | |
|
1788 | 'hg annotate [OPTION]... FILE...'), | |
|
1781 | [('r', 'rev', '', _('revision')), | |
|
1782 | ('a', 'text', None, _('treat all files as text')), | |
|
1783 | ('u', 'user', None, _('show user')), | |
|
1784 | ('n', 'number', None, _('show revision number')), | |
|
1785 | ('c', 'changeset', None, _('show changeset')), | |
|
1786 | ('I', 'include', [], _('include path in search')), | |
|
1787 | ('X', 'exclude', [], _('exclude path from search'))], | |
|
1788 | _('hg annotate [OPTION]... FILE...')), | |
|
1789 | 1789 | "bundle": |
|
1790 | 1790 | (bundle, |
|
1791 | 1791 | [], |
|
1792 | 'hg bundle FILE DEST'), | |
|
1792 | _('hg bundle FILE DEST')), | |
|
1793 | 1793 | "cat": |
|
1794 | 1794 | (cat, |
|
1795 | [('I', 'include', [], 'include path in search'), | |
|
1796 | ('X', 'exclude', [], 'exclude path from search'), | |
|
1797 | ('o', 'output', "", 'output to file'), | |
|
1798 | ('r', 'rev', '', 'revision')], | |
|
1799 | 'hg cat [OPTION]... FILE...'), | |
|
1795 | [('I', 'include', [], _('include path in search')), | |
|
1796 | ('X', 'exclude', [], _('exclude path from search')), | |
|
1797 | ('o', 'output', "", _('output to file')), | |
|
1798 | ('r', 'rev', '', _('revision'))], | |
|
1799 | _('hg cat [OPTION]... FILE...')), | |
|
1800 | 1800 | "^clone": |
|
1801 | 1801 | (clone, |
|
1802 | [('U', 'noupdate', None, 'skip update after cloning'), | |
|
1803 | ('e', 'ssh', "", 'ssh command'), | |
|
1804 | ('', 'pull', None, 'use pull protocol to copy metadata'), | |
|
1805 | ('', 'remotecmd', "", 'remote hg command')], | |
|
1806 | 'hg clone [OPTION]... SOURCE [DEST]'), | |
|
1802 | [('U', 'noupdate', None, _('skip update after cloning')), | |
|
1803 | ('e', 'ssh', "", _('ssh command')), | |
|
1804 | ('', 'pull', None, _('use pull protocol to copy metadata')), | |
|
1805 | ('', 'remotecmd', "", _('remote hg command'))], | |
|
1806 | _('hg clone [OPTION]... SOURCE [DEST]')), | |
|
1807 | 1807 | "^commit|ci": |
|
1808 | 1808 | (commit, |
|
1809 | [('A', 'addremove', None, 'run add/remove during commit'), | |
|
1810 | ('I', 'include', [], 'include path in search'), | |
|
1811 | ('X', 'exclude', [], 'exclude path from search'), | |
|
1812 | ('m', 'message', "", 'commit message'), | |
|
1813 | ('t', 'text', "", 'commit message (deprecated: use -m)'), | |
|
1814 | ('l', 'logfile', "", 'commit message file'), | |
|
1815 | ('d', 'date', "", 'date code'), | |
|
1816 | ('u', 'user', "", 'user')], | |
|
1817 | 'hg commit [OPTION]... [FILE]...'), | |
|
1809 | [('A', 'addremove', None, _('run add/remove during commit')), | |
|
1810 | ('I', 'include', [], _('include path in search')), | |
|
1811 | ('X', 'exclude', [], _('exclude path from search')), | |
|
1812 | ('m', 'message', "", _('commit message')), | |
|
1813 | ('t', 'text', "", _('commit message (deprecated: use -m)')), | |
|
1814 | ('l', 'logfile', "", _('commit message file')), | |
|
1815 | ('d', 'date', "", _('date code')), | |
|
1816 | ('u', 'user', "", _('user'))], | |
|
1817 | _('hg commit [OPTION]... [FILE]...')), | |
|
1818 | 1818 | "copy|cp": (copy, |
|
1819 | [('I', 'include', [], 'include path in search'), | |
|
1820 | ('X', 'exclude', [], 'exclude path from search'), | |
|
1821 | ('A', 'after', None, 'record a copy after it has happened'), | |
|
1822 | ('f', 'force', None, 'replace destination if it exists'), | |
|
1823 | ('p', 'parents', None, 'append source path to dest')], | |
|
1824 | 'hg copy [OPTION]... [SOURCE]... DEST'), | |
|
1825 | "debugancestor": (debugancestor, [], 'debugancestor INDEX REV1 REV2'), | |
|
1826 | "debugcheckstate": (debugcheckstate, [], 'debugcheckstate'), | |
|
1827 | "debugconfig": (debugconfig, [], 'debugconfig'), | |
|
1828 | "debugsetparents": (debugsetparents, [], 'debugsetparents REV1 [REV2]'), | |
|
1829 | "debugstate": (debugstate, [], 'debugstate'), | |
|
1830 | "debugdata": (debugdata, [], 'debugdata FILE REV'), | |
|
1831 | "debugindex": (debugindex, [], 'debugindex FILE'), | |
|
1832 | "debugindexdot": (debugindexdot, [], 'debugindexdot FILE'), | |
|
1833 | "debugrename": (debugrename, [], 'debugrename FILE [REV]'), | |
|
1819 | [('I', 'include', [], _('include path in search')), | |
|
1820 | ('X', 'exclude', [], _('exclude path from search')), | |
|
1821 | ('A', 'after', None, _('record a copy after it has happened')), | |
|
1822 | ('f', 'force', None, _('replace destination if it exists')), | |
|
1823 | ('p', 'parents', None, _('append source path to dest'))], | |
|
1824 | _('hg copy [OPTION]... [SOURCE]... DEST')), | |
|
1825 | "debugancestor": (debugancestor, [], _('debugancestor INDEX REV1 REV2')), | |
|
1826 | "debugcheckstate": (debugcheckstate, [], _('debugcheckstate')), | |
|
1827 | "debugconfig": (debugconfig, [], _('debugconfig')), | |
|
1828 | "debugsetparents": (debugsetparents, [], _('debugsetparents REV1 [REV2]')), | |
|
1829 | "debugstate": (debugstate, [], _('debugstate')), | |
|
1830 | "debugdata": (debugdata, [], _('debugdata FILE REV')), | |
|
1831 | "debugindex": (debugindex, [], _('debugindex FILE')), | |
|
1832 | "debugindexdot": (debugindexdot, [], _('debugindexdot FILE')), | |
|
1833 | "debugrename": (debugrename, [], _('debugrename FILE [REV]')), | |
|
1834 | 1834 | "debugwalk": |
|
1835 | 1835 | (debugwalk, |
|
1836 | [('I', 'include', [], 'include path in search'), | |
|
1837 | ('X', 'exclude', [], 'exclude path from search')], | |
|
1838 | 'debugwalk [OPTION]... [FILE]...'), | |
|
1836 | [('I', 'include', [], _('include path in search')), | |
|
1837 | ('X', 'exclude', [], _('exclude path from search'))], | |
|
1838 | _('debugwalk [OPTION]... [FILE]...')), | |
|
1839 | 1839 | "^diff": |
|
1840 | 1840 | (diff, |
|
1841 | [('r', 'rev', [], 'revision'), | |
|
1842 | ('a', 'text', None, 'treat all files as text'), | |
|
1843 | ('I', 'include', [], 'include path in search'), | |
|
1844 | ('X', 'exclude', [], 'exclude path from search')], | |
|
1845 | 'hg diff [-a] [-I] [-X] [-r REV1 [-r REV2]] [FILE]...'), | |
|
1841 | [('r', 'rev', [], _('revision')), | |
|
1842 | ('a', 'text', None, _('treat all files as text')), | |
|
1843 | ('I', 'include', [], _('include path in search')), | |
|
1844 | ('X', 'exclude', [], _('exclude path from search'))], | |
|
1845 | _('hg diff [-a] [-I] [-X] [-r REV1 [-r REV2]] [FILE]...')), | |
|
1846 | 1846 | "^export": |
|
1847 | 1847 | (export, |
|
1848 | [('o', 'output', "", 'output to file'), | |
|
1849 | ('a', 'text', None, 'treat all files as text')], | |
|
1850 | "hg export [-a] [-o OUTFILE] REV..."), | |
|
1848 | [('o', 'output', "", _('output to file')), | |
|
1849 | ('a', 'text', None, _('treat all files as text'))], | |
|
1850 | _("hg export [-a] [-o OUTFILE] REV...")), | |
|
1851 | 1851 | "forget": |
|
1852 | 1852 | (forget, |
|
1853 | [('I', 'include', [], 'include path in search'), | |
|
1854 | ('X', 'exclude', [], 'exclude path from search')], | |
|
1855 | "hg forget [OPTION]... FILE..."), | |
|
1853 | [('I', 'include', [], _('include path in search')), | |
|
1854 | ('X', 'exclude', [], _('exclude path from search'))], | |
|
1855 | _("hg forget [OPTION]... FILE...")), | |
|
1856 | 1856 | "grep": |
|
1857 | 1857 | (grep, |
|
1858 | [('0', 'print0', None, 'end fields with NUL'), | |
|
1859 | ('I', 'include', [], 'include path in search'), | |
|
1860 | ('X', 'exclude', [], 'include path in search'), | |
|
1861 | ('', 'all', None, 'print all revisions with matches'), | |
|
1862 | ('i', 'ignore-case', None, 'ignore case when matching'), | |
|
1863 | ('l', 'files-with-matches', None, 'print names of files and revs with matches'), | |
|
1864 | ('n', 'line-number', None, 'print line numbers'), | |
|
1865 | ('r', 'rev', [], 'search in revision rev'), | |
|
1866 | ('u', 'user', None, 'print user who made change')], | |
|
1867 | "hg grep [OPTION]... PATTERN [FILE]..."), | |
|
1858 | [('0', 'print0', None, _('end fields with NUL')), | |
|
1859 | ('I', 'include', [], _('include path in search')), | |
|
1860 | ('X', 'exclude', [], _('include path in search')), | |
|
1861 | ('', 'all', None, _('print all revisions with matches')), | |
|
1862 | ('i', 'ignore-case', None, _('ignore case when matching')), | |
|
1863 | ('l', 'files-with-matches', None, _('print names of files and revs with matches')), | |
|
1864 | ('n', 'line-number', None, _('print line numbers')), | |
|
1865 | ('r', 'rev', [], _('search in revision rev')), | |
|
1866 | ('u', 'user', None, _('print user who made change'))], | |
|
1867 | _("hg grep [OPTION]... PATTERN [FILE]...")), | |
|
1868 | 1868 | "heads": |
|
1869 | 1869 | (heads, |
|
1870 | [('b', 'branches', None, 'find branch info')], | |
|
1871 | 'hg heads [-b]'), | |
|
1872 | "help": (help_, [], 'hg help [COMMAND]'), | |
|
1873 | "identify|id": (identify, [], 'hg identify'), | |
|
1870 | [('b', 'branches', None, _('find branch info'))], | |
|
1871 | _('hg heads [-b]')), | |
|
1872 | "help": (help_, [], _('hg help [COMMAND]')), | |
|
1873 | "identify|id": (identify, [], _('hg identify')), | |
|
1874 | 1874 | "import|patch": |
|
1875 | 1875 | (import_, |
|
1876 | [('p', 'strip', 1, 'path strip'), | |
|
1877 | ('f', 'force', None, 'skip check for outstanding changes'), | |
|
1878 | ('b', 'base', "", 'base path')], | |
|
1879 | "hg import [-f] [-p NUM] [-b BASE] PATCH..."), | |
|
1876 | [('p', 'strip', 1, _('path strip')), | |
|
1877 | ('f', 'force', None, _('skip check for outstanding changes')), | |
|
1878 | ('b', 'base', "", _('base path'))], | |
|
1879 | _("hg import [-f] [-p NUM] [-b BASE] PATCH...")), | |
|
1880 | 1880 | "incoming|in": (incoming, |
|
1881 | [('p', 'patch', None, 'show patch')], | |
|
1882 | 'hg incoming [-p] [SOURCE]'), | |
|
1883 | "^init": (init, [], 'hg init [DEST]'), | |
|
1881 | [('p', 'patch', None, _('show patch'))], | |
|
1882 | _('hg incoming [-p] [SOURCE]')), | |
|
1883 | "^init": (init, [], _('hg init [DEST]')), | |
|
1884 | 1884 | "locate": |
|
1885 | 1885 | (locate, |
|
1886 | [('r', 'rev', '', 'revision'), | |
|
1887 | ('0', 'print0', None, 'end filenames with NUL'), | |
|
1888 | ('f', 'fullpath', None, 'print complete paths'), | |
|
1889 | ('I', 'include', [], 'include path in search'), | |
|
1890 | ('X', 'exclude', [], 'exclude path from search')], | |
|
1891 | 'hg locate [OPTION]... [PATTERN]...'), | |
|
1886 | [('r', 'rev', '', _('revision')), | |
|
1887 | ('0', 'print0', None, _('end filenames with NUL')), | |
|
1888 | ('f', 'fullpath', None, _('print complete paths')), | |
|
1889 | ('I', 'include', [], _('include path in search')), | |
|
1890 | ('X', 'exclude', [], _('exclude path from search'))], | |
|
1891 | _('hg locate [OPTION]... [PATTERN]...')), | |
|
1892 | 1892 | "^log|history": |
|
1893 | 1893 | (log, |
|
1894 | [('I', 'include', [], 'include path in search'), | |
|
1895 | ('X', 'exclude', [], 'exclude path from search'), | |
|
1896 | ('b', 'branch', None, 'show branches'), | |
|
1897 | ('k', 'keyword', [], 'search for a keyword'), | |
|
1898 | ('r', 'rev', [], 'revision'), | |
|
1899 | ('p', 'patch', None, 'show patch')], | |
|
1900 | 'hg log [-I] [-X] [-r REV]... [-p] [FILE]'), | |
|
1901 | "manifest": (manifest, [], 'hg manifest [REV]'), | |
|
1894 | [('I', 'include', [], _('include path in search')), | |
|
1895 | ('X', 'exclude', [], _('exclude path from search')), | |
|
1896 | ('b', 'branch', None, _('show branches')), | |
|
1897 | ('k', 'keyword', [], _('search for a keyword')), | |
|
1898 | ('r', 'rev', [], _('revision')), | |
|
1899 | ('p', 'patch', None, _('show patch'))], | |
|
1900 | _('hg log [-I] [-X] [-r REV]... [-p] [FILE]')), | |
|
1901 | "manifest": (manifest, [], _('hg manifest [REV]')), | |
|
1902 | 1902 | "outgoing|out": (outgoing, |
|
1903 | [('p', 'patch', None, 'show patch')], | |
|
1904 | 'hg outgoing [-p] [DEST]'), | |
|
1905 | "parents": (parents, [], 'hg parents [REV]'), | |
|
1906 | "paths": (paths, [], 'hg paths [NAME]'), | |
|
1903 | [('p', 'patch', None, _('show patch'))], | |
|
1904 | _('hg outgoing [-p] [DEST]')), | |
|
1905 | "parents": (parents, [], _('hg parents [REV]')), | |
|
1906 | "paths": (paths, [], _('hg paths [NAME]')), | |
|
1907 | 1907 | "^pull": |
|
1908 | 1908 | (pull, |
|
1909 | [('u', 'update', None, 'update working directory'), | |
|
1910 | ('e', 'ssh', "", 'ssh command'), | |
|
1911 | ('', 'remotecmd', "", 'remote hg command')], | |
|
1912 | 'hg pull [-u] [-e FILE] [--remotecmd FILE] [SOURCE]'), | |
|
1909 | [('u', 'update', None, _('update working directory')), | |
|
1910 | ('e', 'ssh', "", _('ssh command')), | |
|
1911 | ('', 'remotecmd', "", _('remote hg command'))], | |
|
1912 | _('hg pull [-u] [-e FILE] [--remotecmd FILE] [SOURCE]')), | |
|
1913 | 1913 | "^push": |
|
1914 | 1914 | (push, |
|
1915 | [('f', 'force', None, 'force push'), | |
|
1916 | ('e', 'ssh', "", 'ssh command'), | |
|
1917 | ('', 'remotecmd', "", 'remote hg command')], | |
|
1918 | 'hg push [-f] [-e FILE] [--remotecmd FILE] [DEST]'), | |
|
1915 | [('f', 'force', None, _('force push')), | |
|
1916 | ('e', 'ssh', "", _('ssh command')), | |
|
1917 | ('', 'remotecmd', "", _('remote hg command'))], | |
|
1918 | _('hg push [-f] [-e FILE] [--remotecmd FILE] [DEST]')), | |
|
1919 | 1919 | "rawcommit": |
|
1920 | 1920 | (rawcommit, |
|
1921 | [('p', 'parent', [], 'parent'), | |
|
1922 | ('d', 'date', "", 'date code'), | |
|
1923 | ('u', 'user', "", 'user'), | |
|
1924 | ('F', 'files', "", 'file list'), | |
|
1925 | ('m', 'message', "", 'commit message'), | |
|
1926 | ('t', 'text', "", 'commit message (deprecated: use -m)'), | |
|
1927 | ('l', 'logfile', "", 'commit message file')], | |
|
1928 | 'hg rawcommit [OPTION]... [FILE]...'), | |
|
1929 | "recover": (recover, [], "hg recover"), | |
|
1921 | [('p', 'parent', [], _('parent')), | |
|
1922 | ('d', 'date', "", _('date code')), | |
|
1923 | ('u', 'user', "", _('user')), | |
|
1924 | ('F', 'files', "", _('file list')), | |
|
1925 | ('m', 'message', "", _('commit message')), | |
|
1926 | ('t', 'text', "", _('commit message (deprecated: use -m)')), | |
|
1927 | ('l', 'logfile', "", _('commit message file'))], | |
|
1928 | _('hg rawcommit [OPTION]... [FILE]...')), | |
|
1929 | "recover": (recover, [], _("hg recover")), | |
|
1930 | 1930 | "^remove|rm": (remove, |
|
1931 | [('I', 'include', [], 'include path in search'), | |
|
1932 | ('X', 'exclude', [], 'exclude path from search')], | |
|
1933 | "hg remove [OPTION]... FILE..."), | |
|
1931 | [('I', 'include', [], _('include path in search')), | |
|
1932 | ('X', 'exclude', [], _('exclude path from search'))], | |
|
1933 | _("hg remove [OPTION]... FILE...")), | |
|
1934 | 1934 | "rename|mv": (rename, |
|
1935 | [('I', 'include', [], 'include path in search'), | |
|
1936 | ('X', 'exclude', [], 'exclude path from search'), | |
|
1937 | ('A', 'after', None, 'record a copy after it has happened'), | |
|
1938 | ('f', 'force', None, 'replace destination if it exists'), | |
|
1939 | ('p', 'parents', None, 'append source path to dest')], | |
|
1940 | 'hg rename [OPTION]... [SOURCE]... DEST'), | |
|
1935 | [('I', 'include', [], _('include path in search')), | |
|
1936 | ('X', 'exclude', [], _('exclude path from search')), | |
|
1937 | ('A', 'after', None, _('record a copy after it has happened')), | |
|
1938 | ('f', 'force', None, _('replace destination if it exists')), | |
|
1939 | ('p', 'parents', None, _('append source path to dest'))], | |
|
1940 | _('hg rename [OPTION]... [SOURCE]... DEST')), | |
|
1941 | 1941 | "^revert": |
|
1942 | 1942 | (revert, |
|
1943 | [("n", "nonrecursive", None, "don't recurse into subdirs"), | |
|
1944 | ("r", "rev", "", "revision")], | |
|
1945 | "hg revert [-n] [-r REV] [NAME]..."), | |
|
1946 | "root": (root, [], "hg root"), | |
|
1943 | [("n", "nonrecursive", None, _("don't recurse into subdirs")), | |
|
1944 | ("r", "rev", "", _("revision"))], | |
|
1945 | _("hg revert [-n] [-r REV] [NAME]...")), | |
|
1946 | "root": (root, [], _("hg root")), | |
|
1947 | 1947 | "^serve": |
|
1948 | 1948 | (serve, |
|
1949 | [('A', 'accesslog', '', 'access log file'), | |
|
1950 | ('E', 'errorlog', '', 'error log file'), | |
|
1951 | ('p', 'port', 0, 'listen port'), | |
|
1952 | ('a', 'address', '', 'interface address'), | |
|
1953 | ('n', 'name', "", 'repository name'), | |
|
1954 | ('', 'stdio', None, 'for remote clients'), | |
|
1955 | ('t', 'templates', "", 'template directory'), | |
|
1956 | ('', 'style', "", 'template style'), | |
|
1957 | ('6', 'ipv6', None, 'use IPv6 in addition to IPv4')], | |
|
1958 | "hg serve [OPTION]..."), | |
|
1949 | [('A', 'accesslog', '', _('access log file')), | |
|
1950 | ('E', 'errorlog', '', _('error log file')), | |
|
1951 | ('p', 'port', 0, _('listen port')), | |
|
1952 | ('a', 'address', '', _('interface address')), | |
|
1953 | ('n', 'name', "", _('repository name')), | |
|
1954 | ('', 'stdio', None, _('for remote clients')), | |
|
1955 | ('t', 'templates', "", _('template directory')), | |
|
1956 | ('', 'style', "", _('template style')), | |
|
1957 | ('6', 'ipv6', None, _('use IPv6 in addition to IPv4'))], | |
|
1958 | _("hg serve [OPTION]...")), | |
|
1959 | 1959 | "^status": |
|
1960 | 1960 | (status, |
|
1961 | [('m', 'modified', None, 'show only modified files'), | |
|
1962 | ('a', 'added', None, 'show only added files'), | |
|
1963 | ('r', 'removed', None, 'show only removed files'), | |
|
1964 | ('u', 'unknown', None, 'show only unknown (not tracked) files'), | |
|
1965 | ('n', 'no-status', None, 'hide status prefix'), | |
|
1966 | ('0', 'print0', None, 'end filenames with NUL'), | |
|
1967 | ('I', 'include', [], 'include path in search'), | |
|
1968 | ('X', 'exclude', [], 'exclude path from search')], | |
|
1969 | "hg status [OPTION]... [FILE]..."), | |
|
1961 | [('m', 'modified', None, _('show only modified files')), | |
|
1962 | ('a', 'added', None, _('show only added files')), | |
|
1963 | ('r', 'removed', None, _('show only removed files')), | |
|
1964 | ('u', 'unknown', None, _('show only unknown (not tracked) files')), | |
|
1965 | ('n', 'no-status', None, _('hide status prefix')), | |
|
1966 | ('0', 'print0', None, _('end filenames with NUL')), | |
|
1967 | ('I', 'include', [], _('include path in search')), | |
|
1968 | ('X', 'exclude', [], _('exclude path from search'))], | |
|
1969 | _("hg status [OPTION]... [FILE]...")), | |
|
1970 | 1970 | "tag": |
|
1971 | 1971 | (tag, |
|
1972 | [('l', 'local', None, 'make the tag local'), | |
|
1973 | ('m', 'message', "", 'commit message'), | |
|
1974 | ('t', 'text', "", 'commit message (deprecated: use -m)'), | |
|
1975 | ('d', 'date', "", 'date code'), | |
|
1976 | ('u', 'user', "", 'user')], | |
|
1977 | 'hg tag [OPTION]... NAME [REV]'), | |
|
1978 | "tags": (tags, [], 'hg tags'), | |
|
1979 | "tip": (tip, [], 'hg tip'), | |
|
1972 | [('l', 'local', None, _('make the tag local')), | |
|
1973 | ('m', 'message', "", _('commit message')), | |
|
1974 | ('t', 'text', "", _('commit message (deprecated: use -m)')), | |
|
1975 | ('d', 'date', "", _('date code')), | |
|
1976 | ('u', 'user', "", _('user'))], | |
|
1977 | _('hg tag [OPTION]... NAME [REV]')), | |
|
1978 | "tags": (tags, [], _('hg tags')), | |
|
1979 | "tip": (tip, [], _('hg tip')), | |
|
1980 | 1980 | "unbundle": |
|
1981 | 1981 | (unbundle, |
|
1982 | 1982 | [], |
|
1983 | 'hg unbundle FILE'), | |
|
1984 | "undo": (undo, [], 'hg undo'), | |
|
1983 | _('hg unbundle FILE')), | |
|
1984 | "undo": (undo, [], _('hg undo')), | |
|
1985 | 1985 | "^update|up|checkout|co": |
|
1986 | 1986 | (update, |
|
1987 | [('b', 'branch', "", 'checkout the head of a specific branch'), | |
|
1988 | ('m', 'merge', None, 'allow merging of conflicts'), | |
|
1989 | ('C', 'clean', None, 'overwrite locally modified files')], | |
|
1990 | 'hg update [-b TAG] [-m] [-C] [REV]'), | |
|
1991 | "verify": (verify, [], 'hg verify'), | |
|
1992 | "version": (show_version, [], 'hg version'), | |
|
1987 | [('b', 'branch', "", _('checkout the head of a specific branch')), | |
|
1988 | ('m', 'merge', None, _('allow merging of conflicts')), | |
|
1989 | ('C', 'clean', None, _('overwrite locally modified files'))], | |
|
1990 | _('hg update [-b TAG] [-m] [-C] [REV]')), | |
|
1991 | "verify": (verify, [], _('hg verify')), | |
|
1992 | "version": (show_version, [], _('hg version')), | |
|
1993 | 1993 | } |
|
1994 | 1994 | |
|
1995 | 1995 | globalopts = [ |
|
1996 | ('R', 'repository', "", 'repository root directory'), | |
|
1997 | ('', 'cwd', '', 'change working directory'), | |
|
1998 | ('y', 'noninteractive', None, 'run non-interactively'), | |
|
1999 | ('q', 'quiet', None, 'quiet mode'), | |
|
2000 | ('v', 'verbose', None, 'verbose mode'), | |
|
2001 | ('', 'debug', None, 'debug mode'), | |
|
2002 | ('', 'debugger', None, 'start debugger'), | |
|
2003 | ('', 'traceback', None, 'print traceback on exception'), | |
|
2004 | ('', 'time', None, 'time how long the command takes'), | |
|
2005 | ('', 'profile', None, 'profile'), | |
|
2006 | ('', 'version', None, 'output version information and exit'), | |
|
2007 | ('h', 'help', None, 'display help and exit'), | |
|
1996 | ('R', 'repository', "", _('repository root directory')), | |
|
1997 | ('', 'cwd', '', _('change working directory')), | |
|
1998 | ('y', 'noninteractive', None, _('run non-interactively')), | |
|
1999 | ('q', 'quiet', None, _('quiet mode')), | |
|
2000 | ('v', 'verbose', None, _('verbose mode')), | |
|
2001 | ('', 'debug', None, _('debug mode')), | |
|
2002 | ('', 'debugger', None, _('start debugger')), | |
|
2003 | ('', 'traceback', None, _('print traceback on exception')), | |
|
2004 | ('', 'time', None, _('time how long the command takes')), | |
|
2005 | ('', 'profile', None, _('profile')), | |
|
2006 | ('', 'version', None, _('output version information and exit')), | |
|
2007 | ('h', 'help', None, _('display help and exit')), | |
|
2008 | 2008 | ] |
|
2009 | 2009 | |
|
2010 | 2010 | norepo = ("clone init version help debugancestor debugconfig debugdata" |
@@ -2077,7 +2077,7 def dispatch(args): | |||
|
2077 | 2077 | try: |
|
2078 | 2078 | mod = imp.load_source(x[0], x[1]) |
|
2079 | 2079 | except: |
|
2080 | u.warn("*** failed to import extension %s\n" % x[1]) | |
|
2080 | u.warn(_("*** failed to import extension %s\n") % x[1]) | |
|
2081 | 2081 | continue |
|
2082 | 2082 | else: |
|
2083 | 2083 | def importh(name): |
@@ -2089,7 +2089,7 def dispatch(args): | |||
|
2089 | 2089 | try: |
|
2090 | 2090 | mod = importh(x[0]) |
|
2091 | 2091 | except: |
|
2092 | u.warn("failed to import extension %s\n" % x[0]) | |
|
2092 | u.warn(_("failed to import extension %s\n") % x[0]) | |
|
2093 | 2093 | continue |
|
2094 | 2094 | |
|
2095 | 2095 | external.append(mod) |
@@ -2097,21 +2097,21 def dispatch(args): | |||
|
2097 | 2097 | cmdtable = getattr(x, 'cmdtable', {}) |
|
2098 | 2098 | for t in cmdtable: |
|
2099 | 2099 | if t in table: |
|
2100 | u.warn("module %s overrides %s\n" % (x.__name__, t)) | |
|
2100 | u.warn(_("module %s overrides %s\n") % (x.__name__, t)) | |
|
2101 | 2101 | table.update(cmdtable) |
|
2102 | 2102 | |
|
2103 | 2103 | try: |
|
2104 | 2104 | cmd, func, args, options, cmdoptions = parse(args) |
|
2105 | 2105 | except ParseError, inst: |
|
2106 | 2106 | if inst.args[0]: |
|
2107 | u.warn("hg %s: %s\n" % (inst.args[0], inst.args[1])) | |
|
2107 | u.warn(_("hg %s: %s\n") % (inst.args[0], inst.args[1])) | |
|
2108 | 2108 | help_(u, inst.args[0]) |
|
2109 | 2109 | else: |
|
2110 | u.warn("hg: %s\n" % inst.args[1]) | |
|
2110 | u.warn(_("hg: %s\n") % inst.args[1]) | |
|
2111 | 2111 | help_(u, 'shortlist') |
|
2112 | 2112 | sys.exit(-1) |
|
2113 | 2113 | except UnknownCommand, inst: |
|
2114 | u.warn("hg: unknown command '%s'\n" % inst.args[0]) | |
|
2114 | u.warn(_("hg: unknown command '%s'\n") % inst.args[0]) | |
|
2115 | 2115 | help_(u, 'shortlist') |
|
2116 | 2116 | sys.exit(1) |
|
2117 | 2117 | |
@@ -2124,7 +2124,7 def dispatch(args): | |||
|
2124 | 2124 | s = get_times() |
|
2125 | 2125 | def print_time(): |
|
2126 | 2126 | t = get_times() |
|
2127 | u.warn("Time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n" % | |
|
2127 | u.warn(_("Time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") % | |
|
2128 | 2128 | (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3])) |
|
2129 | 2129 | atexit.register(print_time) |
|
2130 | 2130 | |
@@ -2183,42 +2183,42 def dispatch(args): | |||
|
2183 | 2183 | traceback.print_exc() |
|
2184 | 2184 | raise |
|
2185 | 2185 | except hg.RepoError, inst: |
|
2186 | u.warn("abort: ", inst, "!\n") | |
|
2186 | u.warn(_("abort: "), inst, "!\n") | |
|
2187 | 2187 | except revlog.RevlogError, inst: |
|
2188 | u.warn("abort: ", inst, "!\n") | |
|
2188 | u.warn(_("abort: "), inst, "!\n") | |
|
2189 | 2189 | except SignalInterrupt: |
|
2190 | u.warn("killed!\n") | |
|
2190 | u.warn(_("killed!\n")) | |
|
2191 | 2191 | except KeyboardInterrupt: |
|
2192 | 2192 | try: |
|
2193 | u.warn("interrupted!\n") | |
|
2193 | u.warn(_("interrupted!\n")) | |
|
2194 | 2194 | except IOError, inst: |
|
2195 | 2195 | if inst.errno == errno.EPIPE: |
|
2196 | 2196 | if u.debugflag: |
|
2197 | u.warn("\nbroken pipe\n") | |
|
2197 | u.warn(_("\nbroken pipe\n")) | |
|
2198 | 2198 | else: |
|
2199 | 2199 | raise |
|
2200 | 2200 | except IOError, inst: |
|
2201 | 2201 | if hasattr(inst, "code"): |
|
2202 | u.warn("abort: %s\n" % inst) | |
|
2202 | u.warn(_("abort: %s\n") % inst) | |
|
2203 | 2203 | elif hasattr(inst, "reason"): |
|
2204 | u.warn("abort: error: %s\n" % inst.reason[1]) | |
|
2204 | u.warn(_("abort: error: %s\n") % inst.reason[1]) | |
|
2205 | 2205 | elif hasattr(inst, "args") and inst[0] == errno.EPIPE: |
|
2206 | 2206 | if u.debugflag: |
|
2207 | u.warn("broken pipe\n") | |
|
2207 | u.warn(_("broken pipe\n")) | |
|
2208 | 2208 | elif getattr(inst, "strerror", None): |
|
2209 | 2209 | if getattr(inst, "filename", None): |
|
2210 | u.warn("abort: %s - %s\n" % (inst.strerror, inst.filename)) | |
|
2210 | u.warn(_("abort: %s - %s\n") % (inst.strerror, inst.filename)) | |
|
2211 | 2211 | else: |
|
2212 | u.warn("abort: %s\n" % inst.strerror) | |
|
2212 | u.warn(_("abort: %s\n") % inst.strerror) | |
|
2213 | 2213 | else: |
|
2214 | 2214 | raise |
|
2215 | 2215 | except OSError, inst: |
|
2216 | 2216 | if hasattr(inst, "filename"): |
|
2217 | u.warn("abort: %s: %s\n" % (inst.strerror, inst.filename)) | |
|
2217 | u.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename)) | |
|
2218 | 2218 | else: |
|
2219 | u.warn("abort: %s\n" % inst.strerror) | |
|
2219 | u.warn(_("abort: %s\n") % inst.strerror) | |
|
2220 | 2220 | except util.Abort, inst: |
|
2221 | u.warn('abort: ', inst.args[0] % inst.args[1:], '\n') | |
|
2221 | u.warn(_('abort: '), inst.args[0] % inst.args[1:], '\n') | |
|
2222 | 2222 | sys.exit(1) |
|
2223 | 2223 | except TypeError, inst: |
|
2224 | 2224 | # was this an argument error? |
@@ -2226,17 +2226,17 def dispatch(args): | |||
|
2226 | 2226 | if len(tb) > 2: # no |
|
2227 | 2227 | raise |
|
2228 | 2228 | u.debug(inst, "\n") |
|
2229 | u.warn("%s: invalid arguments\n" % cmd) | |
|
2229 | u.warn(_("%s: invalid arguments\n") % cmd) | |
|
2230 | 2230 | help_(u, cmd) |
|
2231 | 2231 | except UnknownCommand, inst: |
|
2232 | u.warn("hg: unknown command '%s'\n" % inst.args[0]) | |
|
2232 | u.warn(_("hg: unknown command '%s'\n") % inst.args[0]) | |
|
2233 | 2233 | help_(u, 'shortlist') |
|
2234 | 2234 | except SystemExit: |
|
2235 | 2235 | # don't catch this in the catch-all below |
|
2236 | 2236 | raise |
|
2237 | 2237 | except: |
|
2238 | u.warn("** unknown exception encountered, details follow\n") | |
|
2239 | u.warn("** report bug details to mercurial@selenic.com\n") | |
|
2238 | u.warn(_("** unknown exception encountered, details follow\n")) | |
|
2239 | u.warn(_("** report bug details to mercurial@selenic.com\n")) | |
|
2240 | 2240 | raise |
|
2241 | 2241 | |
|
2242 | 2242 | sys.exit(-1) |
@@ -68,7 +68,7 class dirstate: | |||
|
68 | 68 | try: |
|
69 | 69 | syntax = syntaxes[s] |
|
70 | 70 | except KeyError: |
|
71 | self.ui.warn("ignoring invalid syntax '%s'\n" % s) | |
|
71 | self.ui.warn(_("ignoring invalid syntax '%s'\n") % s) | |
|
72 | 72 | continue |
|
73 | 73 | pat = syntax + line |
|
74 | 74 | for s in syntaxes.values(): |
@@ -190,7 +190,7 class dirstate: | |||
|
190 | 190 | try: |
|
191 | 191 | del self.map[f] |
|
192 | 192 | except KeyError: |
|
193 | self.ui.warn("not in dirstate: %s!\n" % f) | |
|
193 | self.ui.warn(_("not in dirstate: %s!\n") % f) | |
|
194 | 194 | pass |
|
195 | 195 | |
|
196 | 196 | def clear(self): |
@@ -276,13 +276,13 class dirstate: | |||
|
276 | 276 | return True |
|
277 | 277 | else: |
|
278 | 278 | kind = 'unknown' |
|
279 | if stat.S_ISCHR(st.st_mode): kind = 'character device' | |
|
280 | elif stat.S_ISBLK(st.st_mode): kind = 'block device' | |
|
281 | elif stat.S_ISFIFO(st.st_mode): kind = 'fifo' | |
|
282 | elif stat.S_ISLNK(st.st_mode): kind = 'symbolic link' | |
|
283 | elif stat.S_ISSOCK(st.st_mode): kind = 'socket' | |
|
284 | elif stat.S_ISDIR(st.st_mode): kind = 'directory' | |
|
285 | self.ui.warn('%s: unsupported file type (type is %s)\n' % ( | |
|
279 | if stat.S_ISCHR(st.st_mode): kind = _('character device') | |
|
280 | elif stat.S_ISBLK(st.st_mode): kind = _('block device') | |
|
281 | elif stat.S_ISFIFO(st.st_mode): kind = _('fifo') | |
|
282 | elif stat.S_ISLNK(st.st_mode): kind = _('symbolic link') | |
|
283 | elif stat.S_ISSOCK(st.st_mode): kind = _('socket') | |
|
284 | elif stat.S_ISDIR(st.st_mode): kind = _('directory') | |
|
285 | self.ui.warn(_('%s: unsupported file type (type is %s)\n') % ( | |
|
286 | 286 | util.pathto(self.getcwd(), f), |
|
287 | 287 | kind)) |
|
288 | 288 | return False |
@@ -112,7 +112,7 class templater: | |||
|
112 | 112 | if m: |
|
113 | 113 | self.map[m.group(1)] = os.path.join(self.base, m.group(2)) |
|
114 | 114 | else: |
|
115 | raise LookupError("unknown map entry '%s'" % l) | |
|
115 | raise LookupError(_("unknown map entry '%s'") % l) | |
|
116 | 116 | |
|
117 | 117 | def __call__(self, t, **map): |
|
118 | 118 | m = self.defaults.copy() |
@@ -844,7 +844,7 def create_server(repo): | |||
|
844 | 844 | |
|
845 | 845 | def __init__(self, *args, **kwargs): |
|
846 | 846 | if self.address_family is None: |
|
847 | raise hg.RepoError('IPv6 not available on this system') | |
|
847 | raise hg.RepoError(_('IPv6 not available on this system')) | |
|
848 | 848 | BaseHTTPServer.HTTPServer.__init__(self, *args, **kwargs) |
|
849 | 849 | |
|
850 | 850 | class hgwebhandler(BaseHTTPServer.BaseHTTPRequestHandler): |
@@ -68,7 +68,7 class httprepository(remoterepository): | |||
|
68 | 68 | return -1 |
|
69 | 69 | |
|
70 | 70 | def do_cmd(self, cmd, **args): |
|
71 | self.ui.debug("sending %s command\n" % cmd) | |
|
71 | self.ui.debug(_("sending %s command\n") % cmd) | |
|
72 | 72 | q = {"cmd": cmd} |
|
73 | 73 | q.update(args) |
|
74 | 74 | qs = urllib.urlencode(q) |
@@ -80,13 +80,13 class httprepository(remoterepository): | |||
|
80 | 80 | if not proto.startswith('application/mercurial') and \ |
|
81 | 81 | not proto.startswith('text/plain') and \ |
|
82 | 82 | not proto.startswith('application/hg-changegroup'): |
|
83 | raise hg.RepoError("'%s' does not appear to be an hg repository" % | |
|
83 | raise hg.RepoError(_("'%s' does not appear to be an hg repository") % | |
|
84 | 84 | self.url) |
|
85 | 85 | |
|
86 | 86 | if proto.startswith('application/mercurial'): |
|
87 | 87 | version = proto[22:] |
|
88 | 88 | if float(version) > 0.1: |
|
89 | raise hg.RepoError("'%s' uses newer protocol %s" % | |
|
89 | raise hg.RepoError(_("'%s' uses newer protocol %s") % | |
|
90 | 90 | (self.url, version)) |
|
91 | 91 | |
|
92 | 92 | return resp |
@@ -96,7 +96,7 class httprepository(remoterepository): | |||
|
96 | 96 | try: |
|
97 | 97 | return map(bin, d[:-1].split(" ")) |
|
98 | 98 | except: |
|
99 | self.ui.warn("unexpected response:\n" + d[:400] + "\n...\n") | |
|
99 | self.ui.warn(_("unexpected response:\n") + d[:400] + "\n...\n") | |
|
100 | 100 | raise |
|
101 | 101 | |
|
102 | 102 | def branches(self, nodes): |
@@ -106,7 +106,7 class httprepository(remoterepository): | |||
|
106 | 106 | br = [ tuple(map(bin, b.split(" "))) for b in d.splitlines() ] |
|
107 | 107 | return br |
|
108 | 108 | except: |
|
109 | self.ui.warn("unexpected response:\n" + d[:400] + "\n...\n") | |
|
109 | self.ui.warn(_("unexpected response:\n") + d[:400] + "\n...\n") | |
|
110 | 110 | raise |
|
111 | 111 | |
|
112 | 112 | def between(self, pairs): |
@@ -116,7 +116,7 class httprepository(remoterepository): | |||
|
116 | 116 | p = [ l and map(bin, l.split(" ")) or [] for l in d.splitlines() ] |
|
117 | 117 | return p |
|
118 | 118 | except: |
|
119 | self.ui.warn("unexpected response:\n" + d[:400] + "\n...\n") | |
|
119 | self.ui.warn(_("unexpected response:\n") + d[:400] + "\n...\n") | |
|
120 | 120 | raise |
|
121 | 121 | |
|
122 | 122 | def changegroup(self, nodes): |
@@ -19,12 +19,12 class localrepository: | |||
|
19 | 19 | while not os.path.isdir(os.path.join(p, ".hg")): |
|
20 | 20 | oldp = p |
|
21 | 21 | p = os.path.dirname(p) |
|
22 | if p == oldp: raise repo.RepoError("no repo found") | |
|
22 | if p == oldp: raise repo.RepoError(_("no repo found")) | |
|
23 | 23 | path = p |
|
24 | 24 | self.path = os.path.join(path, ".hg") |
|
25 | 25 | |
|
26 | 26 | if not create and not os.path.isdir(self.path): |
|
27 | raise repo.RepoError("repository %s not found" % self.path) | |
|
27 | raise repo.RepoError(_("repository %s not found") % self.path) | |
|
28 | 28 | |
|
29 | 29 | self.root = os.path.abspath(path) |
|
30 | 30 | self.ui = ui |
@@ -49,7 +49,7 class localrepository: | |||
|
49 | 49 | def hook(self, name, **args): |
|
50 | 50 | s = self.ui.config("hooks", name) |
|
51 | 51 | if s: |
|
52 | self.ui.note("running hook %s: %s\n" % (name, s)) | |
|
52 | self.ui.note(_("running hook %s: %s\n") % (name, s)) | |
|
53 | 53 | old = {} |
|
54 | 54 | for k, v in args.items(): |
|
55 | 55 | k = k.upper() |
@@ -69,7 +69,7 class localrepository: | |||
|
69 | 69 | del os.environ[k] |
|
70 | 70 | |
|
71 | 71 | if r: |
|
72 | self.ui.warn("abort: %s hook failed with status %d!\n" % | |
|
72 | self.ui.warn(_("abort: %s hook failed with status %d!\n") % | |
|
73 | 73 | (name, r)) |
|
74 | 74 | return False |
|
75 | 75 | return True |
@@ -139,7 +139,7 class localrepository: | |||
|
139 | 139 | try: |
|
140 | 140 | return self.changelog.lookup(key) |
|
141 | 141 | except: |
|
142 | raise repo.RepoError("unknown revision '%s'" % key) | |
|
142 | raise repo.RepoError(_("unknown revision '%s'") % key) | |
|
143 | 143 | |
|
144 | 144 | def dev(self): |
|
145 | 145 | return os.stat(self.path).st_dev |
@@ -175,7 +175,7 class localrepository: | |||
|
175 | 175 | |
|
176 | 176 | for mf, cmd in self.encodepats: |
|
177 | 177 | if mf(filename): |
|
178 | self.ui.debug("filtering %s through %s\n" % (filename, cmd)) | |
|
178 | self.ui.debug(_("filtering %s through %s\n") % (filename, cmd)) | |
|
179 | 179 | data = util.filter(data, cmd) |
|
180 | 180 | break |
|
181 | 181 | |
@@ -191,7 +191,7 class localrepository: | |||
|
191 | 191 | |
|
192 | 192 | for mf, cmd in self.decodepats: |
|
193 | 193 | if mf(filename): |
|
194 | self.ui.debug("filtering %s through %s\n" % (filename, cmd)) | |
|
194 | self.ui.debug(_("filtering %s through %s\n") % (filename, cmd)) | |
|
195 | 195 | data = util.filter(data, cmd) |
|
196 | 196 | break |
|
197 | 197 | |
@@ -218,28 +218,28 class localrepository: | |||
|
218 | 218 | def recover(self): |
|
219 | 219 | lock = self.lock() |
|
220 | 220 | if os.path.exists(self.join("journal")): |
|
221 | self.ui.status("rolling back interrupted transaction\n") | |
|
221 | self.ui.status(_("rolling back interrupted transaction\n")) | |
|
222 | 222 | return transaction.rollback(self.opener, self.join("journal")) |
|
223 | 223 | else: |
|
224 | self.ui.warn("no interrupted transaction available\n") | |
|
224 | self.ui.warn(_("no interrupted transaction available\n")) | |
|
225 | 225 | |
|
226 | 226 | def undo(self): |
|
227 | 227 | lock = self.lock() |
|
228 | 228 | if os.path.exists(self.join("undo")): |
|
229 | self.ui.status("rolling back last transaction\n") | |
|
229 | self.ui.status(_("rolling back last transaction\n")) | |
|
230 | 230 | transaction.rollback(self.opener, self.join("undo")) |
|
231 | 231 | self.dirstate = None |
|
232 | 232 | util.rename(self.join("undo.dirstate"), self.join("dirstate")) |
|
233 | 233 | self.dirstate = dirstate.dirstate(self.opener, self.ui, self.root) |
|
234 | 234 | else: |
|
235 | self.ui.warn("no undo information available\n") | |
|
235 | self.ui.warn(_("no undo information available\n")) | |
|
236 | 236 | |
|
237 | 237 | def lock(self, wait=1): |
|
238 | 238 | try: |
|
239 | 239 | return lock.lock(self.join("lock"), 0) |
|
240 | 240 | except lock.LockHeld, inst: |
|
241 | 241 | if wait: |
|
242 | self.ui.warn("waiting for lock held by %s\n" % inst.args[0]) | |
|
242 | self.ui.warn(_("waiting for lock held by %s\n") % inst.args[0]) | |
|
243 | 243 | return lock.lock(self.join("lock"), wait) |
|
244 | 244 | raise inst |
|
245 | 245 | |
@@ -327,7 +327,7 class localrepository: | |||
|
327 | 327 | elif s == 'r': |
|
328 | 328 | remove.append(f) |
|
329 | 329 | else: |
|
330 | self.ui.warn("%s not tracked!\n" % f) | |
|
330 | self.ui.warn(_("%s not tracked!\n") % f) | |
|
331 | 331 | else: |
|
332 | 332 | (c, a, d, u) = self.changes(match=match) |
|
333 | 333 | commit = c + a |
@@ -341,7 +341,7 class localrepository: | |||
|
341 | 341 | m2 = self.manifest.read(c2[0]) |
|
342 | 342 | |
|
343 | 343 | if not commit and not remove and not force and p2 == nullid: |
|
344 | self.ui.status("nothing changed\n") | |
|
344 | self.ui.status(_("nothing changed\n")) | |
|
345 | 345 | return None |
|
346 | 346 | |
|
347 | 347 | if not self.hook("precommit"): |
@@ -360,7 +360,7 class localrepository: | |||
|
360 | 360 | mf1[f] = util.is_exec(self.wjoin(f), mf1.get(f, False)) |
|
361 | 361 | t = self.wread(f) |
|
362 | 362 | except IOError: |
|
363 | self.ui.warn("trouble committing %s!\n" % f) | |
|
363 | self.ui.warn(_("trouble committing %s!\n") % f) | |
|
364 | 364 | raise |
|
365 | 365 | |
|
366 | 366 | r = self.file(f) |
@@ -370,7 +370,7 class localrepository: | |||
|
370 | 370 | if cp: |
|
371 | 371 | meta["copy"] = cp |
|
372 | 372 | meta["copyrev"] = hex(m1.get(cp, m2.get(cp, nullid))) |
|
373 | self.ui.debug(" %s: copy %s:%s\n" % (f, cp, meta["copyrev"])) | |
|
373 | self.ui.debug(_(" %s: copy %s:%s\n") % (f, cp, meta["copyrev"])) | |
|
374 | 374 | fp1, fp2 = nullid, nullid |
|
375 | 375 | else: |
|
376 | 376 | fp1 = m1.get(f, nullid) |
@@ -521,18 +521,18 class localrepository: | |||
|
521 | 521 | for f in list: |
|
522 | 522 | p = self.wjoin(f) |
|
523 | 523 | if not os.path.exists(p): |
|
524 | self.ui.warn("%s does not exist!\n" % f) | |
|
524 | self.ui.warn(_("%s does not exist!\n") % f) | |
|
525 | 525 | elif not os.path.isfile(p): |
|
526 | self.ui.warn("%s not added: only files supported currently\n" % f) | |
|
526 | self.ui.warn(_("%s not added: only files supported currently\n") % f) | |
|
527 | 527 | elif self.dirstate.state(f) in 'an': |
|
528 | self.ui.warn("%s already tracked!\n" % f) | |
|
528 | self.ui.warn(_("%s already tracked!\n") % f) | |
|
529 | 529 | else: |
|
530 | 530 | self.dirstate.update([f], "a") |
|
531 | 531 | |
|
532 | 532 | def forget(self, list): |
|
533 | 533 | for f in list: |
|
534 | 534 | if self.dirstate.state(f) not in 'ai': |
|
535 | self.ui.warn("%s not added!\n" % f) | |
|
535 | self.ui.warn(_("%s not added!\n") % f) | |
|
536 | 536 | else: |
|
537 | 537 | self.dirstate.forget([f]) |
|
538 | 538 | |
@@ -540,21 +540,21 class localrepository: | |||
|
540 | 540 | for f in list: |
|
541 | 541 | p = self.wjoin(f) |
|
542 | 542 | if os.path.exists(p): |
|
543 | self.ui.warn("%s still exists!\n" % f) | |
|
543 | self.ui.warn(_("%s still exists!\n") % f) | |
|
544 | 544 | elif self.dirstate.state(f) == 'a': |
|
545 | self.ui.warn("%s never committed!\n" % f) | |
|
545 | self.ui.warn(_("%s never committed!\n") % f) | |
|
546 | 546 | self.dirstate.forget([f]) |
|
547 | 547 | elif f not in self.dirstate: |
|
548 | self.ui.warn("%s not tracked!\n" % f) | |
|
548 | self.ui.warn(_("%s not tracked!\n") % f) | |
|
549 | 549 | else: |
|
550 | 550 | self.dirstate.update([f], "r") |
|
551 | 551 | |
|
552 | 552 | def copy(self, source, dest): |
|
553 | 553 | p = self.wjoin(dest) |
|
554 | 554 | if not os.path.exists(p): |
|
555 | self.ui.warn("%s does not exist!\n" % dest) | |
|
555 | self.ui.warn(_("%s does not exist!\n") % dest) | |
|
556 | 556 | elif not os.path.isfile(p): |
|
557 | self.ui.warn("copy failed: %s is not a file\n" % dest) | |
|
557 | self.ui.warn(_("copy failed: %s is not a file\n") % dest) | |
|
558 | 558 | else: |
|
559 | 559 | if self.dirstate.state(dest) == '?': |
|
560 | 560 | self.dirstate.update([dest], "a") |
@@ -738,7 +738,7 class localrepository: | |||
|
738 | 738 | |
|
739 | 739 | # assume we're closer to the tip than the root |
|
740 | 740 | # and start by examining the heads |
|
741 | self.ui.status("searching for changes\n") | |
|
741 | self.ui.status(_("searching for changes\n")) | |
|
742 | 742 | |
|
743 | 743 | if not heads: |
|
744 | 744 | heads = remote.heads() |
@@ -768,21 +768,21 class localrepository: | |||
|
768 | 768 | if n[0] in seen: |
|
769 | 769 | continue |
|
770 | 770 | |
|
771 | self.ui.debug("examining %s:%s\n" % (short(n[0]), short(n[1]))) | |
|
771 | self.ui.debug(_("examining %s:%s\n") % (short(n[0]), short(n[1]))) | |
|
772 | 772 | if n[0] == nullid: |
|
773 | 773 | break |
|
774 | 774 | if n in seenbranch: |
|
775 | self.ui.debug("branch already found\n") | |
|
775 | self.ui.debug(_("branch already found\n")) | |
|
776 | 776 | continue |
|
777 | 777 | if n[1] and n[1] in m: # do we know the base? |
|
778 | self.ui.debug("found incomplete branch %s:%s\n" | |
|
778 | self.ui.debug(_("found incomplete branch %s:%s\n") | |
|
779 | 779 | % (short(n[0]), short(n[1]))) |
|
780 | 780 | search.append(n) # schedule branch range for scanning |
|
781 | 781 | seenbranch[n] = 1 |
|
782 | 782 | else: |
|
783 | 783 | if n[1] not in seen and n[1] not in fetch: |
|
784 | 784 | if n[2] in m and n[3] in m: |
|
785 | self.ui.debug("found new changeset %s\n" % | |
|
785 | self.ui.debug(_("found new changeset %s\n") % | |
|
786 | 786 | short(n[1])) |
|
787 | 787 | fetch[n[1]] = 1 # earliest unknown |
|
788 | 788 | base[n[2]] = 1 # latest known |
@@ -797,14 +797,14 class localrepository: | |||
|
797 | 797 | |
|
798 | 798 | if r: |
|
799 | 799 | reqcnt += 1 |
|
800 | self.ui.debug("request %d: %s\n" % | |
|
800 | self.ui.debug(_("request %d: %s\n") % | |
|
801 | 801 | (reqcnt, " ".join(map(short, r)))) |
|
802 | 802 | for p in range(0, len(r), 10): |
|
803 | 803 | for b in remote.branches(r[p:p+10]): |
|
804 | self.ui.debug("received %s:%s\n" % | |
|
804 | self.ui.debug(_("received %s:%s\n") % | |
|
805 | 805 | (short(b[0]), short(b[1]))) |
|
806 | 806 | if b[0] in m: |
|
807 | self.ui.debug("found base node %s\n" % short(b[0])) | |
|
807 | self.ui.debug(_("found base node %s\n") % short(b[0])) | |
|
808 | 808 | base[b[0]] = 1 |
|
809 | 809 | elif b[0] not in seen: |
|
810 | 810 | unknown.append(b) |
@@ -818,15 +818,15 class localrepository: | |||
|
818 | 818 | p = n[0] |
|
819 | 819 | f = 1 |
|
820 | 820 | for i in l: |
|
821 | self.ui.debug("narrowing %d:%d %s\n" % (f, len(l), short(i))) | |
|
821 | self.ui.debug(_("narrowing %d:%d %s\n") % (f, len(l), short(i))) | |
|
822 | 822 | if i in m: |
|
823 | 823 | if f <= 2: |
|
824 | self.ui.debug("found new branch changeset %s\n" % | |
|
824 | self.ui.debug(_("found new branch changeset %s\n") % | |
|
825 | 825 | short(p)) |
|
826 | 826 | fetch[p] = 1 |
|
827 | 827 | base[i] = 1 |
|
828 | 828 | else: |
|
829 | self.ui.debug("narrowed branch search to %s:%s\n" | |
|
829 | self.ui.debug(_("narrowed branch search to %s:%s\n") | |
|
830 | 830 | % (short(p), short(i))) |
|
831 | 831 | search.append((p, i)) |
|
832 | 832 | break |
@@ -835,15 +835,15 class localrepository: | |||
|
835 | 835 | # sanity check our fetch list |
|
836 | 836 | for f in fetch.keys(): |
|
837 | 837 | if f in m: |
|
838 | raise repo.RepoError("already have changeset " + short(f[:4])) | |
|
838 | raise repo.RepoError(_("already have changeset ") + short(f[:4])) | |
|
839 | 839 | |
|
840 | 840 | if base.keys() == [nullid]: |
|
841 | self.ui.warn("warning: pulling from an unrelated repository!\n") | |
|
841 | self.ui.warn(_("warning: pulling from an unrelated repository!\n")) | |
|
842 | 842 | |
|
843 | self.ui.note("found new changesets starting at " + | |
|
843 | self.ui.note(_("found new changesets starting at ") + | |
|
844 | 844 | " ".join([short(f) for f in fetch]) + "\n") |
|
845 | 845 | |
|
846 | self.ui.debug("%d total queries\n" % reqcnt) | |
|
846 | self.ui.debug(_("%d total queries\n") % reqcnt) | |
|
847 | 847 | |
|
848 | 848 | return fetch.keys() |
|
849 | 849 | |
@@ -852,7 +852,7 class localrepository: | |||
|
852 | 852 | base = {} |
|
853 | 853 | self.findincoming(remote, base, heads) |
|
854 | 854 | |
|
855 | self.ui.debug("common changesets up to " | |
|
855 | self.ui.debug(_("common changesets up to ") | |
|
856 | 856 | + " ".join(map(short, base.keys())) + "\n") |
|
857 | 857 | |
|
858 | 858 | remain = dict.fromkeys(self.changelog.nodemap) |
@@ -882,13 +882,13 class localrepository: | |||
|
882 | 882 | |
|
883 | 883 | # if we have an empty repo, fetch everything |
|
884 | 884 | if self.changelog.tip() == nullid: |
|
885 | self.ui.status("requesting all changes\n") | |
|
885 | self.ui.status(_("requesting all changes\n")) | |
|
886 | 886 | fetch = [nullid] |
|
887 | 887 | else: |
|
888 | 888 | fetch = self.findincoming(remote) |
|
889 | 889 | |
|
890 | 890 | if not fetch: |
|
891 | self.ui.status("no changes found\n") | |
|
891 | self.ui.status(_("no changes found\n")) | |
|
892 | 892 | return 1 |
|
893 | 893 | |
|
894 | 894 | cg = remote.changegroup(fetch) |
@@ -901,19 +901,19 class localrepository: | |||
|
901 | 901 | heads = remote.heads() |
|
902 | 902 | inc = self.findincoming(remote, base, heads) |
|
903 | 903 | if not force and inc: |
|
904 | self.ui.warn("abort: unsynced remote changes!\n") | |
|
905 | self.ui.status("(did you forget to sync? use push -f to force)\n") | |
|
904 | self.ui.warn(_("abort: unsynced remote changes!\n")) | |
|
905 | self.ui.status(_("(did you forget to sync? use push -f to force)\n")) | |
|
906 | 906 | return 1 |
|
907 | 907 | |
|
908 | 908 | update = self.findoutgoing(remote, base) |
|
909 | 909 | if not update: |
|
910 | self.ui.status("no changes found\n") | |
|
910 | self.ui.status(_("no changes found\n")) | |
|
911 | 911 | return 1 |
|
912 | 912 | elif not force: |
|
913 | 913 | if len(heads) < len(self.changelog.heads()): |
|
914 | self.ui.warn("abort: push creates new remote branches!\n") | |
|
915 |
self.ui.status("(did you forget to merge?" |
|
|
916 | " use push -f to force)\n") | |
|
914 | self.ui.warn(_("abort: push creates new remote branches!\n")) | |
|
915 | self.ui.status(_("(did you forget to merge?" | |
|
916 | " use push -f to force)\n")) | |
|
917 | 917 | return 1 |
|
918 | 918 | |
|
919 | 919 | cg = self.changegroup(update) |
@@ -963,8 +963,8 class localrepository: | |||
|
963 | 963 | if l <= 4: return "" |
|
964 | 964 | d = source.read(l - 4) |
|
965 | 965 | if len(d) < l - 4: |
|
966 |
raise repo.RepoError("premature EOF reading chunk" |
|
|
967 | " (got %d bytes, expected %d)" | |
|
966 | raise repo.RepoError(_("premature EOF reading chunk" | |
|
967 | " (got %d bytes, expected %d)") | |
|
968 | 968 | % (len(d), l - 4)) |
|
969 | 969 | return d |
|
970 | 970 | |
@@ -975,7 +975,7 class localrepository: | |||
|
975 | 975 | yield c |
|
976 | 976 | |
|
977 | 977 | def csmap(x): |
|
978 | self.ui.debug("add changeset %s\n" % short(x)) | |
|
978 | self.ui.debug(_("add changeset %s\n") % short(x)) | |
|
979 | 979 | return self.changelog.count() |
|
980 | 980 | |
|
981 | 981 | def revmap(x): |
@@ -989,7 +989,7 class localrepository: | |||
|
989 | 989 | oldheads = len(self.changelog.heads()) |
|
990 | 990 | |
|
991 | 991 | # pull off the changeset group |
|
992 | self.ui.status("adding changesets\n") | |
|
992 | self.ui.status(_("adding changesets\n")) | |
|
993 | 993 | co = self.changelog.tip() |
|
994 | 994 | cn = self.changelog.addgroup(getgroup(), csmap, tr, 1) # unique |
|
995 | 995 | cnr, cor = map(self.changelog.rev, (cn, co)) |
@@ -998,16 +998,16 class localrepository: | |||
|
998 | 998 | changesets = cnr - cor |
|
999 | 999 | |
|
1000 | 1000 | # pull off the manifest group |
|
1001 | self.ui.status("adding manifests\n") | |
|
1001 | self.ui.status(_("adding manifests\n")) | |
|
1002 | 1002 | mm = self.manifest.tip() |
|
1003 | 1003 | mo = self.manifest.addgroup(getgroup(), revmap, tr) |
|
1004 | 1004 | |
|
1005 | 1005 | # process the files |
|
1006 | self.ui.status("adding file changes\n") | |
|
1006 | self.ui.status(_("adding file changes\n")) | |
|
1007 | 1007 | while 1: |
|
1008 | 1008 | f = getchunk() |
|
1009 | 1009 | if not f: break |
|
1010 | self.ui.debug("adding %s revisions\n" % f) | |
|
1010 | self.ui.debug(_("adding %s revisions\n") % f) | |
|
1011 | 1011 | fl = self.file(f) |
|
1012 | 1012 | o = fl.count() |
|
1013 | 1013 | n = fl.addgroup(getgroup(), revmap, tr) |
@@ -1017,9 +1017,9 class localrepository: | |||
|
1017 | 1017 | newheads = len(self.changelog.heads()) |
|
1018 | 1018 | heads = "" |
|
1019 | 1019 | if oldheads and newheads > oldheads: |
|
1020 | heads = " (+%d heads)" % (newheads - oldheads) | |
|
1020 | heads = _(" (+%d heads)") % (newheads - oldheads) | |
|
1021 | 1021 | |
|
1022 |
self.ui.status(("added %d changesets" |
|
|
1022 | self.ui.status(_("added %d changesets" | |
|
1023 | 1023 | " with %d changes to %d files%s\n") |
|
1024 | 1024 | % (changesets, revisions, files, heads)) |
|
1025 | 1025 | |
@@ -1028,7 +1028,7 class localrepository: | |||
|
1028 | 1028 | if changesets > 0: |
|
1029 | 1029 | if not self.hook("changegroup", |
|
1030 | 1030 | node=hex(self.changelog.node(cor+1))): |
|
1031 | self.ui.warn("abort: changegroup hook returned failure!\n") | |
|
1031 | self.ui.warn(_("abort: changegroup hook returned failure!\n")) | |
|
1032 | 1032 | return 1 |
|
1033 | 1033 | |
|
1034 | 1034 | for i in range(cor + 1, cnr + 1): |
@@ -1040,7 +1040,7 class localrepository: | |||
|
1040 | 1040 | moddirstate=True): |
|
1041 | 1041 | pl = self.dirstate.parents() |
|
1042 | 1042 | if not force and pl[1] != nullid: |
|
1043 | self.ui.warn("aborting: outstanding uncommitted merges\n") | |
|
1043 | self.ui.warn(_("aborting: outstanding uncommitted merges\n")) | |
|
1044 | 1044 | return 1 |
|
1045 | 1045 | |
|
1046 | 1046 | p1, p2 = pl[0], node |
@@ -1063,10 +1063,10 class localrepository: | |||
|
1063 | 1063 | |
|
1064 | 1064 | # resolve the manifest to determine which files |
|
1065 | 1065 | # we care about merging |
|
1066 | self.ui.note("resolving manifests\n") | |
|
1067 | self.ui.debug(" force %s allow %s moddirstate %s linear %s\n" % | |
|
1066 | self.ui.note(_("resolving manifests\n")) | |
|
1067 | self.ui.debug(_(" force %s allow %s moddirstate %s linear %s\n") % | |
|
1068 | 1068 | (force, allow, moddirstate, linear_path)) |
|
1069 | self.ui.debug(" ancestor %s local %s remote %s\n" % | |
|
1069 | self.ui.debug(_(" ancestor %s local %s remote %s\n") % | |
|
1070 | 1070 | (short(man), short(m1n), short(m2n))) |
|
1071 | 1071 | |
|
1072 | 1072 | merge = {} |
@@ -1112,7 +1112,7 class localrepository: | |||
|
1112 | 1112 | a = ma.get(f, nullid) |
|
1113 | 1113 | # are both different from the ancestor? |
|
1114 | 1114 | if n != a and m2[f] != a: |
|
1115 | self.ui.debug(" %s versions differ, resolve\n" % f) | |
|
1115 | self.ui.debug(_(" %s versions differ, resolve\n") % f) | |
|
1116 | 1116 | # merge executable bits |
|
1117 | 1117 | # "if we changed or they changed, change in merge" |
|
1118 | 1118 | a, b, c = mfa.get(f, 0), mfw[f], mf2[f] |
@@ -1123,7 +1123,7 class localrepository: | |||
|
1123 | 1123 | # is remote's version newer? |
|
1124 | 1124 | # or are we going back in time? |
|
1125 | 1125 | elif force or m2[f] != a or (p2 == pa and mw[f] == m1[f]): |
|
1126 | self.ui.debug(" remote %s is newer, get\n" % f) | |
|
1126 | self.ui.debug(_(" remote %s is newer, get\n") % f) | |
|
1127 | 1127 | get[f] = m2[f] |
|
1128 | 1128 | s = 1 |
|
1129 | 1129 | elif f in umap: |
@@ -1132,60 +1132,60 class localrepository: | |||
|
1132 | 1132 | |
|
1133 | 1133 | if not s and mfw[f] != mf2[f]: |
|
1134 | 1134 | if force: |
|
1135 | self.ui.debug(" updating permissions for %s\n" % f) | |
|
1135 | self.ui.debug(_(" updating permissions for %s\n") % f) | |
|
1136 | 1136 | util.set_exec(self.wjoin(f), mf2[f]) |
|
1137 | 1137 | else: |
|
1138 | 1138 | a, b, c = mfa.get(f, 0), mfw[f], mf2[f] |
|
1139 | 1139 | mode = ((a^b) | (a^c)) ^ a |
|
1140 | 1140 | if mode != b: |
|
1141 | self.ui.debug(" updating permissions for %s\n" % f) | |
|
1141 | self.ui.debug(_(" updating permissions for %s\n") % f) | |
|
1142 | 1142 | util.set_exec(self.wjoin(f), mode) |
|
1143 | 1143 | del m2[f] |
|
1144 | 1144 | elif f in ma: |
|
1145 | 1145 | if n != ma[f]: |
|
1146 | r = "d" | |
|
1146 | r = _("d") | |
|
1147 | 1147 | if not force and (linear_path or allow): |
|
1148 | 1148 | r = self.ui.prompt( |
|
1149 | (" local changed %s which remote deleted\n" % f) + | |
|
1150 | "(k)eep or (d)elete?", "[kd]", "k") | |
|
1151 | if r == "d": | |
|
1149 | (_(" local changed %s which remote deleted\n") % f) + | |
|
1150 | _("(k)eep or (d)elete?"), _("[kd]"), _("k")) | |
|
1151 | if r == _("d"): | |
|
1152 | 1152 | remove.append(f) |
|
1153 | 1153 | else: |
|
1154 | self.ui.debug("other deleted %s\n" % f) | |
|
1154 | self.ui.debug(_("other deleted %s\n") % f) | |
|
1155 | 1155 | remove.append(f) # other deleted it |
|
1156 | 1156 | else: |
|
1157 | 1157 | # file is created on branch or in working directory |
|
1158 | 1158 | if force and f not in umap: |
|
1159 | self.ui.debug("remote deleted %s, clobbering\n" % f) | |
|
1159 | self.ui.debug(_("remote deleted %s, clobbering\n") % f) | |
|
1160 | 1160 | remove.append(f) |
|
1161 | 1161 | elif n == m1.get(f, nullid): # same as parent |
|
1162 | 1162 | if p2 == pa: # going backwards? |
|
1163 | self.ui.debug("remote deleted %s\n" % f) | |
|
1163 | self.ui.debug(_("remote deleted %s\n") % f) | |
|
1164 | 1164 | remove.append(f) |
|
1165 | 1165 | else: |
|
1166 | self.ui.debug("local modified %s, keeping\n" % f) | |
|
1166 | self.ui.debug(_("local modified %s, keeping\n") % f) | |
|
1167 | 1167 | else: |
|
1168 | self.ui.debug("working dir created %s, keeping\n" % f) | |
|
1168 | self.ui.debug(_("working dir created %s, keeping\n") % f) | |
|
1169 | 1169 | |
|
1170 | 1170 | for f, n in m2.iteritems(): |
|
1171 | 1171 | if choose and not choose(f): continue |
|
1172 | 1172 | if f[0] == "/": continue |
|
1173 | 1173 | if f in ma and n != ma[f]: |
|
1174 | r = "k" | |
|
1174 | r = _("k") | |
|
1175 | 1175 | if not force and (linear_path or allow): |
|
1176 | 1176 | r = self.ui.prompt( |
|
1177 | ("remote changed %s which local deleted\n" % f) + | |
|
1178 | "(k)eep or (d)elete?", "[kd]", "k") | |
|
1179 | if r == "k": get[f] = n | |
|
1177 | (_("remote changed %s which local deleted\n") % f) + | |
|
1178 | _("(k)eep or (d)elete?"), _("[kd]"), _("k")) | |
|
1179 | if r == _("k"): get[f] = n | |
|
1180 | 1180 | elif f not in ma: |
|
1181 | self.ui.debug("remote created %s\n" % f) | |
|
1181 | self.ui.debug(_("remote created %s\n") % f) | |
|
1182 | 1182 | get[f] = n |
|
1183 | 1183 | else: |
|
1184 | 1184 | if force or p2 == pa: # going backwards? |
|
1185 | self.ui.debug("local deleted %s, recreating\n" % f) | |
|
1185 | self.ui.debug(_("local deleted %s, recreating\n") % f) | |
|
1186 | 1186 | get[f] = n |
|
1187 | 1187 | else: |
|
1188 | self.ui.debug("local deleted %s\n" % f) | |
|
1188 | self.ui.debug(_("local deleted %s\n") % f) | |
|
1189 | 1189 | |
|
1190 | 1190 | del mw, m1, m2, ma |
|
1191 | 1191 | |
@@ -1200,17 +1200,17 class localrepository: | |||
|
1200 | 1200 | p1, p2 = p2, nullid |
|
1201 | 1201 | else: |
|
1202 | 1202 | if not allow: |
|
1203 |
self.ui.status("this update spans a branch" |
|
|
1204 | " affecting the following files:\n") | |
|
1203 | self.ui.status(_("this update spans a branch" | |
|
1204 | " affecting the following files:\n")) | |
|
1205 | 1205 | fl = merge.keys() + get.keys() |
|
1206 | 1206 | fl.sort() |
|
1207 | 1207 | for f in fl: |
|
1208 | 1208 | cf = "" |
|
1209 | if f in merge: cf = " (resolve)" | |
|
1209 | if f in merge: cf = _(" (resolve)") | |
|
1210 | 1210 | self.ui.status(" %s%s\n" % (f, cf)) |
|
1211 | self.ui.warn("aborting update spanning branches!\n") | |
|
1212 |
self.ui.status("(use update -m to merge across branches" |
|
|
1213 | " or -C to lose changes)\n") | |
|
1211 | self.ui.warn(_("aborting update spanning branches!\n")) | |
|
1212 | self.ui.status(_("(use update -m to merge across branches" | |
|
1213 | " or -C to lose changes)\n")) | |
|
1214 | 1214 | return 1 |
|
1215 | 1215 | branch_merge = True |
|
1216 | 1216 | |
@@ -1222,7 +1222,7 class localrepository: | |||
|
1222 | 1222 | files.sort() |
|
1223 | 1223 | for f in files: |
|
1224 | 1224 | if f[0] == "/": continue |
|
1225 | self.ui.note("getting %s\n" % f) | |
|
1225 | self.ui.note(_("getting %s\n") % f) | |
|
1226 | 1226 | t = self.file(f).read(get[f]) |
|
1227 | 1227 | try: |
|
1228 | 1228 | self.wwrite(f, t) |
@@ -1242,7 +1242,7 class localrepository: | |||
|
1242 | 1242 | files = merge.keys() |
|
1243 | 1243 | files.sort() |
|
1244 | 1244 | for f in files: |
|
1245 | self.ui.status("merging %s\n" % f) | |
|
1245 | self.ui.status(_("merging %s\n") % f) | |
|
1246 | 1246 | my, other, flag = merge[f] |
|
1247 | 1247 | self.merge3(f, my, other) |
|
1248 | 1248 | util.set_exec(self.wjoin(f), flag) |
@@ -1262,12 +1262,12 class localrepository: | |||
|
1262 | 1262 | |
|
1263 | 1263 | remove.sort() |
|
1264 | 1264 | for f in remove: |
|
1265 | self.ui.note("removing %s\n" % f) | |
|
1265 | self.ui.note(_("removing %s\n") % f) | |
|
1266 | 1266 | try: |
|
1267 | 1267 | os.unlink(self.wjoin(f)) |
|
1268 | 1268 | except OSError, inst: |
|
1269 | 1269 | if inst.errno != errno.ENOENT: |
|
1270 | self.ui.warn("update failed to remove %s: %s!\n" % | |
|
1270 | self.ui.warn(_("update failed to remove %s: %s!\n") % | |
|
1271 | 1271 | (f, inst.strerror)) |
|
1272 | 1272 | # try removing directories that might now be empty |
|
1273 | 1273 | try: os.removedirs(os.path.dirname(self.wjoin(f))) |
@@ -1295,15 +1295,15 class localrepository: | |||
|
1295 | 1295 | b = temp("base", base) |
|
1296 | 1296 | c = temp("other", other) |
|
1297 | 1297 | |
|
1298 | self.ui.note("resolving %s\n" % fn) | |
|
1299 | self.ui.debug("file %s: my %s other %s ancestor %s\n" % | |
|
1298 | self.ui.note(_("resolving %s\n") % fn) | |
|
1299 | self.ui.debug(_("file %s: my %s other %s ancestor %s\n") % | |
|
1300 | 1300 | (fn, short(my), short(other), short(base))) |
|
1301 | 1301 | |
|
1302 | 1302 | cmd = (os.environ.get("HGMERGE") or self.ui.config("ui", "merge") |
|
1303 | 1303 | or "hgmerge") |
|
1304 | 1304 | r = os.system("%s %s %s %s" % (cmd, a, b, c)) |
|
1305 | 1305 | if r: |
|
1306 | self.ui.warn("merging %s failed!\n" % fn) | |
|
1306 | self.ui.warn(_("merging %s failed!\n") % fn) | |
|
1307 | 1307 | |
|
1308 | 1308 | os.unlink(b) |
|
1309 | 1309 | os.unlink(c) |
@@ -1320,25 +1320,25 class localrepository: | |||
|
1320 | 1320 | errors[0] += 1 |
|
1321 | 1321 | |
|
1322 | 1322 | seen = {} |
|
1323 | self.ui.status("checking changesets\n") | |
|
1323 | self.ui.status(_("checking changesets\n")) | |
|
1324 | 1324 | for i in range(self.changelog.count()): |
|
1325 | 1325 | changesets += 1 |
|
1326 | 1326 | n = self.changelog.node(i) |
|
1327 | 1327 | l = self.changelog.linkrev(n) |
|
1328 | 1328 | if l != i: |
|
1329 |
err("incorrect link (%d) for changeset revision %d" % |
|
|
1329 | err(_("incorrect link (%d) for changeset revision %d") %(l, i)) | |
|
1330 | 1330 | if n in seen: |
|
1331 | err("duplicate changeset at revision %d" % i) | |
|
1331 | err(_("duplicate changeset at revision %d") % i) | |
|
1332 | 1332 | seen[n] = 1 |
|
1333 | 1333 | |
|
1334 | 1334 | for p in self.changelog.parents(n): |
|
1335 | 1335 | if p not in self.changelog.nodemap: |
|
1336 | err("changeset %s has unknown parent %s" % | |
|
1336 | err(_("changeset %s has unknown parent %s") % | |
|
1337 | 1337 | (short(n), short(p))) |
|
1338 | 1338 | try: |
|
1339 | 1339 | changes = self.changelog.read(n) |
|
1340 | 1340 | except Exception, inst: |
|
1341 | err("unpacking changeset %s: %s" % (short(n), inst)) | |
|
1341 | err(_("unpacking changeset %s: %s") % (short(n), inst)) | |
|
1342 | 1342 | |
|
1343 | 1343 | neededmanifests[changes[0]] = n |
|
1344 | 1344 | |
@@ -1346,55 +1346,55 class localrepository: | |||
|
1346 | 1346 | filelinkrevs.setdefault(f, []).append(i) |
|
1347 | 1347 | |
|
1348 | 1348 | seen = {} |
|
1349 | self.ui.status("checking manifests\n") | |
|
1349 | self.ui.status(_("checking manifests\n")) | |
|
1350 | 1350 | for i in range(self.manifest.count()): |
|
1351 | 1351 | n = self.manifest.node(i) |
|
1352 | 1352 | l = self.manifest.linkrev(n) |
|
1353 | 1353 | |
|
1354 | 1354 | if l < 0 or l >= self.changelog.count(): |
|
1355 | err("bad manifest link (%d) at revision %d" % (l, i)) | |
|
1355 | err(_("bad manifest link (%d) at revision %d") % (l, i)) | |
|
1356 | 1356 | |
|
1357 | 1357 | if n in neededmanifests: |
|
1358 | 1358 | del neededmanifests[n] |
|
1359 | 1359 | |
|
1360 | 1360 | if n in seen: |
|
1361 | err("duplicate manifest at revision %d" % i) | |
|
1361 | err(_("duplicate manifest at revision %d") % i) | |
|
1362 | 1362 | |
|
1363 | 1363 | seen[n] = 1 |
|
1364 | 1364 | |
|
1365 | 1365 | for p in self.manifest.parents(n): |
|
1366 | 1366 | if p not in self.manifest.nodemap: |
|
1367 | err("manifest %s has unknown parent %s" % | |
|
1367 | err(_("manifest %s has unknown parent %s") % | |
|
1368 | 1368 | (short(n), short(p))) |
|
1369 | 1369 | |
|
1370 | 1370 | try: |
|
1371 | 1371 | delta = mdiff.patchtext(self.manifest.delta(n)) |
|
1372 | 1372 | except KeyboardInterrupt: |
|
1373 | self.ui.warn("interrupted") | |
|
1373 | self.ui.warn(_("interrupted")) | |
|
1374 | 1374 | raise |
|
1375 | 1375 | except Exception, inst: |
|
1376 | err("unpacking manifest %s: %s" % (short(n), inst)) | |
|
1376 | err(_("unpacking manifest %s: %s") % (short(n), inst)) | |
|
1377 | 1377 | |
|
1378 | 1378 | ff = [ l.split('\0') for l in delta.splitlines() ] |
|
1379 | 1379 | for f, fn in ff: |
|
1380 | 1380 | filenodes.setdefault(f, {})[bin(fn[:40])] = 1 |
|
1381 | 1381 | |
|
1382 | self.ui.status("crosschecking files in changesets and manifests\n") | |
|
1382 | self.ui.status(_("crosschecking files in changesets and manifests\n")) | |
|
1383 | 1383 | |
|
1384 | 1384 | for m,c in neededmanifests.items(): |
|
1385 | err("Changeset %s refers to unknown manifest %s" % | |
|
1385 | err(_("Changeset %s refers to unknown manifest %s") % | |
|
1386 | 1386 | (short(m), short(c))) |
|
1387 | 1387 | del neededmanifests |
|
1388 | 1388 | |
|
1389 | 1389 | for f in filenodes: |
|
1390 | 1390 | if f not in filelinkrevs: |
|
1391 | err("file %s in manifest but not in changesets" % f) | |
|
1391 | err(_("file %s in manifest but not in changesets") % f) | |
|
1392 | 1392 | |
|
1393 | 1393 | for f in filelinkrevs: |
|
1394 | 1394 | if f not in filenodes: |
|
1395 | err("file %s in changeset but not in manifest" % f) | |
|
1395 | err(_("file %s in changeset but not in manifest") % f) | |
|
1396 | 1396 | |
|
1397 | self.ui.status("checking files\n") | |
|
1397 | self.ui.status(_("checking files\n")) | |
|
1398 | 1398 | ff = filenodes.keys() |
|
1399 | 1399 | ff.sort() |
|
1400 | 1400 | for f in ff: |
@@ -1408,15 +1408,15 class localrepository: | |||
|
1408 | 1408 | n = fl.node(i) |
|
1409 | 1409 | |
|
1410 | 1410 | if n in seen: |
|
1411 | err("%s: duplicate revision %d" % (f, i)) | |
|
1411 | err(_("%s: duplicate revision %d") % (f, i)) | |
|
1412 | 1412 | if n not in filenodes[f]: |
|
1413 | err("%s: %d:%s not in manifests" % (f, i, short(n))) | |
|
1413 | err(_("%s: %d:%s not in manifests") % (f, i, short(n))) | |
|
1414 | 1414 | else: |
|
1415 | 1415 | del filenodes[f][n] |
|
1416 | 1416 | |
|
1417 | 1417 | flr = fl.linkrev(n) |
|
1418 | 1418 | if flr not in filelinkrevs[f]: |
|
1419 | err("%s:%s points to unexpected changeset %d" | |
|
1419 | err(_("%s:%s points to unexpected changeset %d") | |
|
1420 | 1420 | % (f, short(n), flr)) |
|
1421 | 1421 | else: |
|
1422 | 1422 | filelinkrevs[f].remove(flr) |
@@ -1425,25 +1425,25 class localrepository: | |||
|
1425 | 1425 | try: |
|
1426 | 1426 | t = fl.read(n) |
|
1427 | 1427 | except Exception, inst: |
|
1428 | err("unpacking file %s %s: %s" % (f, short(n), inst)) | |
|
1428 | err(_("unpacking file %s %s: %s") % (f, short(n), inst)) | |
|
1429 | 1429 | |
|
1430 | 1430 | # verify parents |
|
1431 | 1431 | (p1, p2) = fl.parents(n) |
|
1432 | 1432 | if p1 not in nodes: |
|
1433 | err("file %s:%s unknown parent 1 %s" % | |
|
1433 | err(_("file %s:%s unknown parent 1 %s") % | |
|
1434 | 1434 | (f, short(n), short(p1))) |
|
1435 | 1435 | if p2 not in nodes: |
|
1436 | err("file %s:%s unknown parent 2 %s" % | |
|
1436 | err(_("file %s:%s unknown parent 2 %s") % | |
|
1437 | 1437 | (f, short(n), short(p1))) |
|
1438 | 1438 | nodes[n] = 1 |
|
1439 | 1439 | |
|
1440 | 1440 | # cross-check |
|
1441 | 1441 | for node in filenodes[f]: |
|
1442 | err("node %s in manifests not in %s" % (hex(node), f)) | |
|
1442 | err(_("node %s in manifests not in %s") % (hex(node), f)) | |
|
1443 | 1443 | |
|
1444 | self.ui.status("%d files, %d changesets, %d total revisions\n" % | |
|
1444 | self.ui.status(_("%d files, %d changesets, %d total revisions\n") % | |
|
1445 | 1445 | (files, changesets, revisions)) |
|
1446 | 1446 | |
|
1447 | 1447 | if errors[0]: |
|
1448 | self.ui.warn("%d integrity errors encountered!\n" % errors[0]) | |
|
1448 | self.ui.warn(_("%d integrity errors encountered!\n") % errors[0]) | |
|
1449 | 1449 | return 1 |
@@ -44,7 +44,7 class manifest(revlog): | |||
|
44 | 44 | if self.listcache and self.addlist and self.listcache[0] == a: |
|
45 | 45 | d = mdiff.diff(self.listcache[1], self.addlist, 1) |
|
46 | 46 | if mdiff.patch(a, d) != b: |
|
47 | raise AssertionError("sortdiff failed!") | |
|
47 | raise AssertionError(_("sortdiff failed!")) | |
|
48 | 48 | return d |
|
49 | 49 | else: |
|
50 | 50 | return mdiff.textdiff(a, b) |
@@ -145,7 +145,7 class manifest(revlog): | |||
|
145 | 145 | end = bs |
|
146 | 146 | if w[1] == 1: |
|
147 | 147 | raise AssertionError( |
|
148 | "failed to remove %s from manifest\n" % f) | |
|
148 | _("failed to remove %s from manifest\n") % f) | |
|
149 | 149 | else: |
|
150 | 150 | # item is found, replace/delete the existing line |
|
151 | 151 | end = bs + 1 |
@@ -159,7 +159,7 class manifest(revlog): | |||
|
159 | 159 | |
|
160 | 160 | text = "".join(self.addlist) |
|
161 | 161 | if cachedelta and mdiff.patch(self.listcache[0], cachedelta) != text: |
|
162 | raise AssertionError("manifest delta failure\n") | |
|
162 | raise AssertionError(_("manifest delta failure\n")) | |
|
163 | 163 | n = self.addrevision(text, transaction, link, p1, p2, cachedelta) |
|
164 | 164 | self.mapcache = (n, map, flags) |
|
165 | 165 | self.listcache = (text, self.addlist) |
@@ -48,7 +48,7 def decompress(bin): | |||
|
48 | 48 | if t == '\0': return bin |
|
49 | 49 | if t == 'x': return zlib.decompress(bin) |
|
50 | 50 | if t == 'u': return bin[1:] |
|
51 | raise RevlogError("unknown compression type %s" % t) | |
|
51 | raise RevlogError(_("unknown compression type %s") % t) | |
|
52 | 52 | |
|
53 | 53 | indexformat = ">4l20s20s20s" |
|
54 | 54 | |
@@ -214,7 +214,7 class revlog: | |||
|
214 | 214 | try: |
|
215 | 215 | return self.nodemap[node] |
|
216 | 216 | except KeyError: |
|
217 | raise RevlogError('%s: no node %s' % (self.indexfile, hex(node))) | |
|
217 | raise RevlogError(_('%s: no node %s') % (self.indexfile, hex(node))) | |
|
218 | 218 | def linkrev(self, node): return self.index[self.rev(node)][3] |
|
219 | 219 | def parents(self, node): |
|
220 | 220 | if node == nullid: return (nullid, nullid) |
@@ -294,8 +294,8 class revlog: | |||
|
294 | 294 | for n in self.nodemap: |
|
295 | 295 | if hex(n).startswith(id): |
|
296 | 296 | c.append(n) |
|
297 | if len(c) > 1: raise RevlogError("Ambiguous identifier") | |
|
298 | if len(c) < 1: raise RevlogError("No match found") | |
|
297 | if len(c) > 1: raise RevlogError(_("Ambiguous identifier")) | |
|
298 | if len(c) < 1: raise RevlogError(_("No match found")) | |
|
299 | 299 | return c[0] |
|
300 | 300 | |
|
301 | 301 | return None |
@@ -357,7 +357,7 class revlog: | |||
|
357 | 357 | text = mdiff.patches(text, bins) |
|
358 | 358 | |
|
359 | 359 | if node != hash(text, p1, p2): |
|
360 | raise RevlogError("integrity check failed on %s:%d" | |
|
360 | raise RevlogError(_("integrity check failed on %s:%d") | |
|
361 | 361 | % (self.datafile, rev)) |
|
362 | 362 | |
|
363 | 363 | self.cache = (node, rev, text) |
@@ -629,7 +629,7 class revlog: | |||
|
629 | 629 | if node in self.nodemap: |
|
630 | 630 | # this can happen if two branches make the same change |
|
631 | 631 | # if unique: |
|
632 | # raise RevlogError("already have %s" % hex(node[:4])) | |
|
632 | # raise RevlogError(_("already have %s") % hex(node[:4])) | |
|
633 | 633 | chain = node |
|
634 | 634 | continue |
|
635 | 635 | delta = chunk[80:] |
@@ -638,7 +638,7 class revlog: | |||
|
638 | 638 | # retrieve the parent revision of the delta chain |
|
639 | 639 | chain = p1 |
|
640 | 640 | if not chain in self.nodemap: |
|
641 | raise RevlogError("unknown base %s" % short(chain[:4])) | |
|
641 | raise RevlogError(_("unknown base %s") % short(chain[:4])) | |
|
642 | 642 | |
|
643 | 643 | # full versions are inserted when the needed deltas become |
|
644 | 644 | # comparable to the uncompressed text or when the previous |
@@ -657,7 +657,7 class revlog: | |||
|
657 | 657 | text = self.patches(text, [delta]) |
|
658 | 658 | chk = self.addrevision(text, transaction, link, p1, p2) |
|
659 | 659 | if chk != node: |
|
660 | raise RevlogError("consistency error adding group") | |
|
660 | raise RevlogError(_("consistency error adding group")) | |
|
661 | 661 | measure = len(text) |
|
662 | 662 | else: |
|
663 | 663 | e = (end, len(cdelta), self.base(t), link, p1, p2, node) |
@@ -18,7 +18,7 class sshrepository(remoterepository): | |||
|
18 | 18 | |
|
19 | 19 | m = re.match(r'ssh://(([^@]+)@)?([^:/]+)(:(\d+))?(/(.*))?', path) |
|
20 | 20 | if not m: |
|
21 | raise hg.RepoError("couldn't parse destination %s" % path) | |
|
21 | raise hg.RepoError(_("couldn't parse destination %s") % path) | |
|
22 | 22 | |
|
23 | 23 | self.user = m.group(2) |
|
24 | 24 | self.host = m.group(3) |
@@ -42,7 +42,7 class sshrepository(remoterepository): | |||
|
42 | 42 | if size == 0: break |
|
43 | 43 | l = self.pipee.readline() |
|
44 | 44 | if not l: break |
|
45 | self.ui.status("remote: ", l) | |
|
45 | self.ui.status(_("remote: "), l) | |
|
46 | 46 | |
|
47 | 47 | def __del__(self): |
|
48 | 48 | try: |
@@ -50,7 +50,7 class sshrepository(remoterepository): | |||
|
50 | 50 | self.pipei.close() |
|
51 | 51 | # read the error descriptor until EOF |
|
52 | 52 | for l in self.pipee: |
|
53 | self.ui.status("remote: ", l) | |
|
53 | self.ui.status(_("remote: "), l) | |
|
54 | 54 | self.pipee.close() |
|
55 | 55 | except: |
|
56 | 56 | pass |
@@ -59,7 +59,7 class sshrepository(remoterepository): | |||
|
59 | 59 | return -1 |
|
60 | 60 | |
|
61 | 61 | def do_cmd(self, cmd, **args): |
|
62 | self.ui.debug("sending %s command\n" % cmd) | |
|
62 | self.ui.debug(_("sending %s command\n") % cmd) | |
|
63 | 63 | self.pipeo.write("%s\n" % cmd) |
|
64 | 64 | for k, v in args.items(): |
|
65 | 65 | self.pipeo.write("%s %d\n" % (k, len(v))) |
@@ -75,7 +75,7 class sshrepository(remoterepository): | |||
|
75 | 75 | try: |
|
76 | 76 | l = int(l) |
|
77 | 77 | except: |
|
78 | raise hg.RepoError("unexpected response '%s'" % l) | |
|
78 | raise hg.RepoError(_("unexpected response '%s'") % l) | |
|
79 | 79 | return r.read(l) |
|
80 | 80 | |
|
81 | 81 | def lock(self): |
@@ -90,7 +90,7 class sshrepository(remoterepository): | |||
|
90 | 90 | try: |
|
91 | 91 | return map(bin, d[:-1].split(" ")) |
|
92 | 92 | except: |
|
93 | raise hg.RepoError("unexpected response '%s'" % (d[:400] + "...")) | |
|
93 | raise hg.RepoError(_("unexpected response '%s'") % (d[:400] + "...")) | |
|
94 | 94 | |
|
95 | 95 | def branches(self, nodes): |
|
96 | 96 | n = " ".join(map(hex, nodes)) |
@@ -99,7 +99,7 class sshrepository(remoterepository): | |||
|
99 | 99 | br = [ tuple(map(bin, b.split(" "))) for b in d.splitlines() ] |
|
100 | 100 | return br |
|
101 | 101 | except: |
|
102 | raise hg.RepoError("unexpected response '%s'" % (d[:400] + "...")) | |
|
102 | raise hg.RepoError(_("unexpected response '%s'") % (d[:400] + "...")) | |
|
103 | 103 | |
|
104 | 104 | def between(self, pairs): |
|
105 | 105 | n = "\n".join(["-".join(map(hex, p)) for p in pairs]) |
@@ -108,7 +108,7 class sshrepository(remoterepository): | |||
|
108 | 108 | p = [ l and map(bin, l.split(" ")) or [] for l in d.splitlines() ] |
|
109 | 109 | return p |
|
110 | 110 | except: |
|
111 | raise hg.RepoError("unexpected response '%s'" % (d[:400] + "...")) | |
|
111 | raise hg.RepoError(_("unexpected response '%s'") % (d[:400] + "...")) | |
|
112 | 112 | |
|
113 | 113 | def changegroup(self, nodes): |
|
114 | 114 | n = " ".join(map(hex, nodes)) |
@@ -118,7 +118,7 class sshrepository(remoterepository): | |||
|
118 | 118 | def addchangegroup(self, cg): |
|
119 | 119 | d = self.call("addchangegroup") |
|
120 | 120 | if d: |
|
121 | raise hg.RepoError("push refused: %s", d) | |
|
121 | raise hg.RepoError(_("push refused: %s"), d) | |
|
122 | 122 | |
|
123 | 123 | while 1: |
|
124 | 124 | d = cg.read(4096) |
@@ -21,7 +21,7 class transaction: | |||
|
21 | 21 | |
|
22 | 22 | # abort here if the journal already exists |
|
23 | 23 | if os.path.exists(journal): |
|
24 | raise AssertionError("journal already exists - run hg recover") | |
|
24 | raise AssertionError(_("journal already exists - run hg recover")) | |
|
25 | 25 | |
|
26 | 26 | self.report = report |
|
27 | 27 | self.opener = opener |
@@ -59,17 +59,17 class transaction: | |||
|
59 | 59 | def abort(self): |
|
60 | 60 | if not self.entries: return |
|
61 | 61 | |
|
62 | self.report("transaction abort!\n") | |
|
62 | self.report(_("transaction abort!\n")) | |
|
63 | 63 | |
|
64 | 64 | for f, o in self.entries: |
|
65 | 65 | try: |
|
66 | 66 | self.opener(f, "a").truncate(o) |
|
67 | 67 | except: |
|
68 | self.report("failed to truncate %s\n" % f) | |
|
68 | self.report(_("failed to truncate %s\n") % f) | |
|
69 | 69 | |
|
70 | 70 | self.entries = [] |
|
71 | 71 | |
|
72 | self.report("rollback completed\n") | |
|
72 | self.report(_("rollback completed\n")) | |
|
73 | 73 | |
|
74 | 74 | def rollback(opener, file): |
|
75 | 75 | for l in open(file).readlines(): |
@@ -115,7 +115,7 class ui: | |||
|
115 | 115 | if re.match(pat, r): |
|
116 | 116 | return r |
|
117 | 117 | else: |
|
118 | self.write("unrecognized response\n") | |
|
118 | self.write(_("unrecognized response\n")) | |
|
119 | 119 | def status(self, *msg): |
|
120 | 120 | if not self.quiet: self.write(*msg) |
|
121 | 121 | def warn(self, *msg): |
@@ -136,7 +136,7 class ui: | |||
|
136 | 136 | os.environ.get("EDITOR", "vi")) |
|
137 | 137 | |
|
138 | 138 | os.environ["HGUSER"] = self.username() |
|
139 | util.system("%s %s" % (editor, name), errprefix="edit failed") | |
|
139 | util.system("%s %s" % (editor, name), errprefix=_("edit failed")) | |
|
140 | 140 | |
|
141 | 141 | t = open(name).read() |
|
142 | 142 | t = re.sub("(?m)^HG:.*\n", "", t) |
@@ -47,7 +47,7 def tempfilter(s, cmd): | |||
|
47 | 47 | cmd = cmd.replace('INFILE', inname) |
|
48 | 48 | cmd = cmd.replace('OUTFILE', outname) |
|
49 | 49 | code = os.system(cmd) |
|
50 | if code: raise Abort("command '%s' failed: %s" % | |
|
50 | if code: raise Abort(_("command '%s' failed: %s") % | |
|
51 | 51 | (cmd, explain_exit(code))) |
|
52 | 52 | return open(outname, 'rb').read() |
|
53 | 53 | finally: |
@@ -83,7 +83,7 def patch(strip, patchname, ui): | |||
|
83 | 83 | files.setdefault(pf, 1) |
|
84 | 84 | code = fp.close() |
|
85 | 85 | if code: |
|
86 | raise Abort("patch command failed: %s" % explain_exit(code)[0]) | |
|
86 | raise Abort(_("patch command failed: %s") % explain_exit(code)[0]) | |
|
87 | 87 | return files.keys() |
|
88 | 88 | |
|
89 | 89 | def binary(s): |
@@ -366,7 +366,7 if hasattr(os, 'link'): | |||
|
366 | 366 | os_link = os.link |
|
367 | 367 | else: |
|
368 | 368 | def os_link(src, dst): |
|
369 | raise OSError(0, "Hardlinks not supported") | |
|
369 | raise OSError(0, _("Hardlinks not supported")) | |
|
370 | 370 | |
|
371 | 371 | # Platform specific variants |
|
372 | 372 | if os.name == 'nt': |
@@ -431,7 +431,7 if os.name == 'nt': | |||
|
431 | 431 | readlock = _readlock_file |
|
432 | 432 | |
|
433 | 433 | def explain_exit(code): |
|
434 | return "exited with status %d" % code, code | |
|
434 | return _("exited with status %d") % code, code | |
|
435 | 435 | |
|
436 | 436 | else: |
|
437 | 437 | nulldev = '/dev/null' |
@@ -494,14 +494,14 else: | |||
|
494 | 494 | """return a 2-tuple (desc, code) describing a process's status""" |
|
495 | 495 | if os.WIFEXITED(code): |
|
496 | 496 | val = os.WEXITSTATUS(code) |
|
497 | return "exited with status %d" % val, val | |
|
497 | return _("exited with status %d") % val, val | |
|
498 | 498 | elif os.WIFSIGNALED(code): |
|
499 | 499 | val = os.WTERMSIG(code) |
|
500 | return "killed by signal %d" % val, val | |
|
500 | return _("killed by signal %d") % val, val | |
|
501 | 501 | elif os.WIFSTOPPED(code): |
|
502 | 502 | val = os.WSTOPSIG(code) |
|
503 | return "stopped by signal %d" % val, val | |
|
504 | raise ValueError("invalid exit code") | |
|
503 | return _("stopped by signal %d") % val, val | |
|
504 | raise ValueError(_("invalid exit code")) | |
|
505 | 505 | |
|
506 | 506 | class chunkbuffer(object): |
|
507 | 507 | """Allow arbitrary sized chunks of data to be efficiently read from an |
@@ -514,7 +514,7 class chunkbuffer(object): | |||
|
514 | 514 | self.buf = '' |
|
515 | 515 | self.targetsize = int(targetsize) |
|
516 | 516 | if self.targetsize <= 0: |
|
517 | raise ValueError("targetsize must be greater than 0, was %d" % | |
|
517 | raise ValueError(_("targetsize must be greater than 0, was %d") % | |
|
518 | 518 | targetsize) |
|
519 | 519 | self.iterempty = False |
|
520 | 520 |
General Comments 0
You need to be logged in to leave comments.
Login now