Patchwork [stable] extensions: don't quit loading extensions in the middle if traceback is on

login
register
mail settings
Submitter Siddharth Agarwal
Date Jan. 24, 2015, 4:37 a.m.
Message ID <a1cccdcea24a3967e0c2.1422074223@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/7552/
State Accepted
Commit af73c05e735aecf8c863ceb57a31ae1bc8487412
Headers show

Comments

Siddharth Agarwal - Jan. 24, 2015, 4:37 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1422073849 28800
#      Fri Jan 23 20:30:49 2015 -0800
# Branch stable
# Node ID a1cccdcea24a3967e0c248327bd5f9bd82228804
# Parent  ea61e278ae9201d4b66146285bde689b4f26868e
extensions: don't quit loading extensions in the middle if traceback is on

This was introduced way back in 2006 (rev 1f6d520557ec) as sys.exit(0) if
loading an extension failed when --traceback was on, then at some point morphed
into a 'return 1' in a function that otherwise returns nothing.

At this point, if ui.traceback is enabled and if loading an extension fails for
whatever reason, including one as innocent as it not being present, we leave
any extensions loaded so far in a bogus half-initialized state. That doesn't
really make any sense.
Matt Mackall - Jan. 25, 2015, 11:39 p.m.
On Fri, 2015-01-23 at 20:37 -0800, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1422073849 28800
> #      Fri Jan 23 20:30:49 2015 -0800
> # Branch stable
> # Node ID a1cccdcea24a3967e0c248327bd5f9bd82228804
> # Parent  ea61e278ae9201d4b66146285bde689b4f26868e
> extensions: don't quit loading extensions in the middle if traceback is on

Queued for stable, thanks.

Patch

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -107,8 +107,6 @@ 
             else:
                 ui.warn(_("*** failed to import extension %s: %s\n")
                         % (name, inst))
-            if ui.traceback():
-                return 1
 
     for name in _order[newindex:]:
         uisetup = getattr(_extensions[name], 'uisetup', None)