Patchwork [5,of,5,wc] fetch: use an abort hint where appropriate

login
register
mail settings
Submitter Yuya Nishihara
Date March 17, 2015, 3:09 p.m.
Message ID <9ea3d264bbf98d4c34a1.1426604966@mimosa>
Download mbox | patch
Permalink /patch/8122/
State Accepted
Commit 55fd99a23fdcfd8fbd4a62cd05fc0887249fba90
Headers show

Comments

Yuya Nishihara - March 17, 2015, 3:09 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1426592193 -32400
#      Tue Mar 17 20:36:33 2015 +0900
# Node ID 9ea3d264bbf98d4c34a1c3946575559fa224a735
# Parent  355103cf45a656b7f6341518c1a412969fe9a3fa
fetch: use an abort hint where appropriate
Matt Mackall - March 18, 2015, 9:35 p.m.
On Wed, 2015-03-18 at 00:09 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1426592193 -32400
> #      Tue Mar 17 20:36:33 2015 +0900
> # Node ID 9ea3d264bbf98d4c34a1c3946575559fa224a735
> # Parent  355103cf45a656b7f6341518c1a412969fe9a3fa
> fetch: use an abort hint where appropriate

These are queued for default, thanks. Congratulations, you are now the
fetch maintainer!

Patch

diff --git a/hgext/fetch.py b/hgext/fetch.py
--- a/hgext/fetch.py
+++ b/hgext/fetch.py
@@ -56,8 +56,8 @@  def fetch(ui, repo, source='default', **
     except error.RepoLookupError:
         branchnode = None
     if parent != branchnode:
-        raise util.Abort(_('working directory not at branch tip '
-                           '(use "hg update" to check out branch tip)'))
+        raise util.Abort(_('working directory not at branch tip'),
+                         hint=_('use "hg update" to check out branch tip'))
 
     wlock = lock = None
     try:
diff --git a/tests/test-fetch.t b/tests/test-fetch.t
--- a/tests/test-fetch.t
+++ b/tests/test-fetch.t
@@ -339,7 +339,8 @@  pull in change on different branch than 
   marked working directory as branch topic
   (branches are permanent and global, did you want a bookmark?)
   $ hg -R n2 fetch -m merge n1
-  abort: working directory not at branch tip (use "hg update" to check out branch tip)
+  abort: working directory not at branch tip
+  (use "hg update" to check out branch tip)
   [255]
 
 parent should be 0 (fetch did not update or merge anything)