[PATCH 05 of 21] lowercase abort output

Martin Geisler mg at daimi.au.dk
Sat Jan 3 10:40:03 CST 2009


# HG changeset patch
# User Martin Geisler <mg at daimi.au.dk>
# Date 1230999320 -3600
# Node ID d71410db61667fa80397ef0214831aa6942d3993
# Parent  373fbee022e07cdd3d0a22ed81c9854e80c402b1
lowercase abort output

Makes the messages passed to util.Abort begin with a lowercase word.

It is possible that a script could have been grepping for these
errors, but it should instead look for the exit code of -1 returned.
We could add a note to the upgrade notes if this is a concern.

diff --git a/hgext/gpg.py b/hgext/gpg.py
--- a/hgext/gpg.py
+++ b/hgext/gpg.py
@@ -229,7 +229,7 @@
         data = node2txt(repo, n, sigver)
         sig = mygpg.sign(data)
         if not sig:
-            raise util.Abort(_("Error while signing"))
+            raise util.Abort(_("error while signing"))
         sig = binascii.b2a_base64(sig)
         sig = sig.replace("\n", "")
         sigmessage += "%s %s %s\n" % (hexnode, sigver, sig)
diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1911,7 +1911,7 @@
     if not files:
         raise util.Abort(_('qfold requires at least one patch name'))
     if not q.check_toppatch(repo):
-        raise util.Abort(_('No patches applied'))
+        raise util.Abort(_('no patches applied'))
 
     message = cmdutil.logmessage(opts)
     if opts['edit']:
@@ -1937,7 +1937,7 @@
         pf = q.join(p)
         (patchsuccess, files, fuzz) = q.patch(repo, pf)
         if not patchsuccess:
-            raise util.Abort(_('Error folding patch %s') % p)
+            raise util.Abort(_('error folding patch %s') % p)
         patch.updatedir(ui, repo, files)
 
     if not message:
@@ -2120,7 +2120,7 @@
         raise util.Abort(_('%s already exists') % absdest)
 
     if name in q.series:
-        raise util.Abort(_('A patch named %s already exists in the series file') % name)
+        raise util.Abort(_('a patch named %s already exists in the series file') % name)
 
     if ui.verbose:
         ui.write('Renaming %s to %s\n' % (patch, name))
diff --git a/hgext/transplant.py b/hgext/transplant.py
--- a/hgext/transplant.py
+++ b/hgext/transplant.py
@@ -231,7 +231,7 @@
                 p2 = node
                 self.log(user, date, message, p1, p2, merge=merge)
                 self.ui.write(str(inst) + '\n')
-                raise util.Abort(_('Fix up the merge and run hg transplant --continue'))
+                raise util.Abort(_('fix up the merge and run hg transplant --continue'))
         else:
             files = None
         if merge:
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -661,7 +661,7 @@
         lookup = r.lookup
     elif len(args) == 2:
         if not repo:
-            raise util.Abort(_("There is no Mercurial repository here "
+            raise util.Abort(_("there is no Mercurial repository here "
                                "(.hg not found)"))
         rev1, rev2 = args
         r = repo.changelog
@@ -1504,7 +1504,7 @@
     """
 
     if not repo and not source:
-        raise util.Abort(_("There is no Mercurial repository here "
+        raise util.Abort(_("there is no Mercurial repository here "
                            "(.hg not found)"))
 
     hexfunc = ui.debugflag and hex or short
@@ -2165,7 +2165,7 @@
         try:
             revs = [other.lookup(rev) for rev in revs]
         except NoCapability:
-            error = _("Other repository doesn't support revision lookup, "
+            error = _("other repository doesn't support revision lookup, "
                       "so a rev cannot be specified.")
             raise util.Abort(error)
 
diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -302,12 +302,12 @@
     cmd, func, args, options, cmdoptions = _parse(lui, args)
 
     if options["config"]:
-        raise util.Abort(_("Option --config may not be abbreviated!"))
+        raise util.Abort(_("option --config may not be abbreviated!"))
     if options["cwd"]:
-        raise util.Abort(_("Option --cwd may not be abbreviated!"))
+        raise util.Abort(_("option --cwd may not be abbreviated!"))
     if options["repository"]:
         raise util.Abort(_(
-            "Option -R has to be separated from other options (i.e. not -qR) "
+            "option -R has to be separated from other options (i.e. not -qR) "
             "and --repository may only be abbreviated as --repo!"))
 
     if options["encoding"]:
diff --git a/mercurial/hbisect.py b/mercurial/hbisect.py
--- a/mercurial/hbisect.py
+++ b/mercurial/hbisect.py
@@ -52,7 +52,7 @@
         badrev, ancestors = buildancestors(state['good'], state['bad'])
     bad = changelog.node(badrev)
     if not ancestors: # now we're confused
-        raise util.Abort(_("Inconsistent state, %s:%s is good and bad")
+        raise util.Abort(_("inconsistent state, %s:%s is good and bad")
                          % (badrev, short(bad)))
 
     # build children dict
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1476,7 +1476,7 @@
                 cg = remote.changegroup(fetch, 'pull')
             else:
                 if not remote.capable('changegroupsubset'):
-                    raise util.Abort(_("Partial pull cannot be done because other repository doesn't support changegroupsubset."))
+                    raise util.Abort(_("partial pull cannot be done because other repository doesn't support changegroupsubset."))
                 cg = remote.changegroupsubset(fetch, heads, 'pull')
             return self.addchangegroup(cg, 'pull', remote.url())
         finally:
@@ -2077,7 +2077,7 @@
             resp = int(l)
         except ValueError:
             raise util.UnexpectedOutput(
-                _('Unexpected response from remote server:'), l)
+                _('unexpected response from remote server:'), l)
         if resp == 1:
             raise util.Abort(_('operation forbidden by server'))
         elif resp == 2:
@@ -2090,7 +2090,7 @@
             total_files, total_bytes = map(int, l.split(' ', 1))
         except (ValueError, TypeError):
             raise util.UnexpectedOutput(
-                _('Unexpected response from remote server:'), l)
+                _('unexpected response from remote server:'), l)
         self.ui.status(_('%d files to transfer, %s of data\n') %
                        (total_files, util.bytecount(total_bytes)))
         start = time.time()
@@ -2102,7 +2102,7 @@
                 size = int(size)
             except (ValueError, TypeError):
                 raise util.UnexpectedOutput(
-                    _('Unexpected response from remote server:'), l)
+                    _('unexpected response from remote server:'), l)
             self.ui.debug(_('adding %s (%s)\n') % (name, util.bytecount(size)))
             ofp = self.sopener(name, 'w')
             for chunk in util.filechunkiter(fp, limit=size):
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -348,7 +348,7 @@
             except KeyError:
                 pass
         if not user:
-            raise util.Abort(_("Please specify a username."))
+            raise util.Abort(_("please specify a username."))
         if "\n" in user:
             raise util.Abort(_("username %s contains a newline\n") % repr(user))
         return user
diff --git a/tests/test-bisect.out b/tests/test-bisect.out
--- a/tests/test-bisect.out
+++ b/tests/test-bisect.out
@@ -237,7 +237,7 @@
 date:        Thu Jan 01 00:00:01 1970 +0000
 summary:     msg 1
 
-abort: Inconsistent state, 31:58c80a7c8a40 is good and bad
+abort: inconsistent state, 31:58c80a7c8a40 is good and bad
 error
 Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
 5cd978ea5149
diff --git a/tests/test-committer.out b/tests/test-committer.out
--- a/tests/test-committer.out
+++ b/tests/test-committer.out
@@ -22,5 +22,5 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     commit-1
 
-abort: Please specify a username.
+abort: please specify a username.
 No username found, using user at host instead
diff --git a/tests/test-globalopts.out b/tests/test-globalopts.out
--- a/tests/test-globalopts.out
+++ b/tests/test-globalopts.out
@@ -56,12 +56,12 @@
 %% earlygetopt short option without following space
 0:b6c483daf290
 %% earlygetopt with illegal abbreviations
-abort: Option --config may not be abbreviated!
-abort: Option --cwd may not be abbreviated!
-abort: Option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
-abort: Option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
-abort: Option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
-abort: Option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
+abort: option --config may not be abbreviated!
+abort: option --cwd may not be abbreviated!
+abort: option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
+abort: option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
+abort: option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
+abort: option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
 %% --cwd
 changeset:   0:8580ff50825a
 tag:         tip
diff --git a/tests/test-transplant.out b/tests/test-transplant.out
--- a/tests/test-transplant.out
+++ b/tests/test-transplant.out
@@ -112,14 +112,14 @@
 Hunk #1 FAILED at 0
 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
 patch failed to apply
-abort: Fix up the merge and run hg transplant --continue
+abort: fix up the merge and run hg transplant --continue
 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
 applying a1e30dd1b8e7
 patching file foo
 Hunk #1 FAILED at 0
 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
 patch failed to apply
-abort: Fix up the merge and run hg transplant --continue
+abort: fix up the merge and run hg transplant --continue
 a1e30dd1b8e7 transplanted as f1563cf27039
 skipping already applied revision 1:a1e30dd1b8e7
 applying 1739ac5f6139


More information about the Mercurial-devel mailing list