843 ui.status(_("Checking encoding (%s)...\n") % util._encoding) |
843 ui.status(_("Checking encoding (%s)...\n") % util._encoding) |
844 try: |
844 try: |
845 util.fromlocal("test") |
845 util.fromlocal("test") |
846 except util.Abort, inst: |
846 except util.Abort, inst: |
847 ui.write(" %s\n" % inst) |
847 ui.write(" %s\n" % inst) |
|
848 ui.write(_(" (check that your locale is properly set)\n")) |
848 problems += 1 |
849 problems += 1 |
849 |
850 |
850 # compiled modules |
851 # compiled modules |
851 ui.status(_("Checking extensions...\n")) |
852 ui.status(_("Checking extensions...\n")) |
852 try: |
853 try: |
853 import bdiff, mpatch, base85 |
854 import bdiff, mpatch, base85 |
854 except Exception, inst: |
855 except Exception, inst: |
855 ui.write(" %s\n" % inst) |
856 ui.write(" %s\n" % inst) |
856 ui.write(_(" One or more extensions could not be found," |
857 ui.write(_(" One or more extensions could not be found")) |
857 " check your build.\n")) |
858 ui.write(_(" (check that you compiled the extensions)\n")) |
858 problems += 1 |
859 problems += 1 |
859 |
860 |
860 # templates |
861 # templates |
861 ui.status(_("Checking templates...\n")) |
862 ui.status(_("Checking templates...\n")) |
862 try: |
863 try: |
863 import templater |
864 import templater |
864 t = templater.templater(templater.templatepath("map-cmdline.default")) |
865 t = templater.templater(templater.templatepath("map-cmdline.default")) |
865 except Exception, inst: |
866 except Exception, inst: |
866 ui.write(" %s\n" % inst) |
867 ui.write(" %s\n" % inst) |
|
868 ui.write(_(" (templates seem to have been installed incorrectly)\n")) |
867 problems += 1 |
869 problems += 1 |
868 |
870 |
869 # patch |
871 # patch |
870 ui.status(_("Checking patch...\n")) |
872 ui.status(_("Checking patch...\n")) |
871 path = os.environ.get('PATH', '') |
873 path = os.environ.get('PATH', '') |
872 patcher = util.find_in_path('gpatch', path, |
874 patcher = util.find_in_path('gpatch', path, |
873 util.find_in_path('patch', path, None)) |
875 util.find_in_path('patch', path, None)) |
874 if not patcher: |
876 if not patcher: |
875 ui.write(_(" Can't find patch or gpatch in PATH\n")) |
877 ui.write(_(" Can't find patch or gpatch in PATH\n")) |
|
878 ui.write(_(" (specify a patch utility in your .hgrc file)\n")) |
876 problems += 1 |
879 problems += 1 |
877 else: |
880 else: |
878 # actually attempt a patch here |
881 # actually attempt a patch here |
879 a = "1\n2\n3\n4\n" |
882 a = "1\n2\n3\n4\n" |
880 b = "1\n2\n3\ninsert\n4\n" |
883 b = "1\n2\n3\ninsert\n4\n" |
909 cmdpath = util.find_in_path(cmd.split()[0], path) |
914 cmdpath = util.find_in_path(cmd.split()[0], path) |
910 if not cmdpath: |
915 if not cmdpath: |
911 if cmd == 'hgmerge': |
916 if cmd == 'hgmerge': |
912 ui.write(_(" No merge helper set and can't find default" |
917 ui.write(_(" No merge helper set and can't find default" |
913 " hgmerge script in PATH\n")) |
918 " hgmerge script in PATH\n")) |
|
919 ui.write(_(" (specify a merge helper in your .hgrc file)\n")) |
914 else: |
920 else: |
915 ui.write(_(" Can't find merge helper '%s' in PATH\n") % cmd) |
921 ui.write(_(" Can't find merge helper '%s' in PATH\n") % cmd) |
|
922 ui.write(_(" (specify a merge helper in your .hgrc file)\n")) |
916 problems += 1 |
923 problems += 1 |
917 else: |
924 else: |
918 # actually attempt a patch here |
925 # actually attempt a patch here |
919 fa = writetemp("1\n2\n3\n4\n") |
926 fa = writetemp("1\n2\n3\n4\n") |
920 fl = writetemp("1\n2\n3\ninsert\n4\n") |
927 fl = writetemp("1\n2\n3\ninsert\n4\n") |
940 if not cmdpath: |
949 if not cmdpath: |
941 cmdpath = util.find_in_path(editor.split()[0], path) |
950 cmdpath = util.find_in_path(editor.split()[0], path) |
942 if not cmdpath: |
951 if not cmdpath: |
943 if cmd == 'vi': |
952 if cmd == 'vi': |
944 ui.write(_(" No commit editor set and can't find vi in PATH\n")) |
953 ui.write(_(" No commit editor set and can't find vi in PATH\n")) |
|
954 ui.write(_(" (specify a commit editor in your .hgrc file)\n")) |
945 else: |
955 else: |
946 ui.write(_(" Can't find editor '%s' in PATH\n") % editor) |
956 ui.write(_(" Can't find editor '%s' in PATH\n") % editor) |
|
957 ui.write(_(" (specify a commit editor in your .hgrc file)\n")) |
947 problems += 1 |
958 problems += 1 |
|
959 |
|
960 # check username |
|
961 ui.status(_("Checking username...\n")) |
|
962 user = os.environ.get("HGUSER") |
|
963 if user is None: |
|
964 user = ui.config("ui", "username") |
|
965 if user is None: |
|
966 user = os.environ.get("EMAIL") |
|
967 if not user: |
|
968 ui.warn(" ") |
|
969 ui.username() |
|
970 ui.write(_(" (specify a username in your .hgrc file)\n")) |
948 |
971 |
949 if not problems: |
972 if not problems: |
950 ui.status(_("No problems detected\n")) |
973 ui.status(_("No problems detected\n")) |
951 else: |
974 else: |
952 ui.write(_("%s problems detected," |
975 ui.write(_("%s problems detected," |