[PATCH] repowidget: hide email patch command when patchbomb extension is disabled

5 views
Skip to first unread message

David Golub

unread,
Feb 9, 2014, 4:00:59 PM2/9/14
to thg...@googlegroups.com

# HG changeset patch
# User David Golub <gol...@gmail.com>
# Date 1391979193 18000
#      Sun Feb 09 15:53:13 2014 -0500
# Branch stable
# Node ID f596855100881364e5f5b222f742d62548a6b6ec
# Parent  9c3f447f2f55b6502eea5627c0157ec2f9f8602f
repowidget: hide email patch command when patchbomb extension is disabled

diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
--- a/tortoisehg/hgqt/repowidget.py
+++ b/tortoisehg/hgqt/repowidget.py
@@ -1330,8 +1330,9 @@
         submenu = menu.addMenu(_('E&xport'))
         entry(submenu, None, isrev, _('E&xport Patch...'), 'hg-export',
               self.exportRevisions)
-        entry(submenu, None, isrev, _('&Email Patch...'), 'mail-forward',
-              self.emailSelectedRevisions)
+        if 'patchbomb' in exs:
+            entry(submenu, None, isrev, _('&Email Patch...'), 'mail-forward',
+                  self.emailSelectedRevisions)
         entry(submenu, None, isrev, _('&Archive...'), 'hg-archive',
               self.archiveRevision)
         entry(submenu, None, isrev, _('&Bundle Rev and Descendants...'),


Yuya Nishihara

unread,
Feb 10, 2014, 8:28:43 AM2/10/14
to thg...@googlegroups.com
On Sun, 9 Feb 2014 13:00:59 -0800 (PST), David Golub wrote:
> # HG changeset patch
> # User David Golub <gol...@gmail.com>
> # Date 1391979193 18000
> # Sun Feb 09 15:53:13 2014 -0500
> # Branch stable
> # Node ID f596855100881364e5f5b222f742d62548a6b6ec
> # Parent 9c3f447f2f55b6502eea5627c0157ec2f9f8602f
> repowidget: hide email patch command when patchbomb extension is disabled

I think this change is correct, even though "email" dialog was available
without patchbomb since Gtk version.

> diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
> --- a/tortoisehg/hgqt/repowidget.py
> +++ b/tortoisehg/hgqt/repowidget.py
> @@ -1330,8 +1330,9 @@
> submenu = menu.addMenu(_('E&xport'))
> entry(submenu, None, isrev, _('E&xport Patch...'), 'hg-export',
> self.exportRevisions)
> - entry(submenu, None, isrev, _('&Email Patch...'), 'mail-forward',
> - self.emailSelectedRevisions)
> + if 'patchbomb' in exs:

see the entry() function.

def entry(menu, ext=None, func=None, desc=None, icon=None, cb=None):
if ext and ext not in exs:
return
if desc is None:

> + entry(submenu, None, isrev, _('&Email Patch...'),
> 'mail-forward',

white-space damaged?

And RepoWidget has two more "email" actions.

Regards,

Steve Borho

unread,
Feb 10, 2014, 11:01:58 AM2/10/14
to thg...@googlegroups.com
On Mon, Feb 10, 2014 at 7:28 AM, Yuya Nishihara <yu...@tcha.org> wrote:
On Sun, 9 Feb 2014 13:00:59 -0800 (PST), David Golub wrote:
> # HG changeset patch
> # User David Golub <gol...@gmail.com>
> # Date 1391979193 18000
> #      Sun Feb 09 15:53:13 2014 -0500
> # Branch stable
> # Node ID f596855100881364e5f5b222f742d62548a6b6ec
> # Parent  9c3f447f2f55b6502eea5627c0157ec2f9f8602f
> repowidget: hide email patch command when patchbomb extension is disabled

I think this change is correct, even though "email" dialog was available
without patchbomb since Gtk version.

We made the decision early on that since patchbomb doesn't monkey patch any Mercurial code (doesn't change any behavior) that it was safe to enable it on demand.  I believe that is still true.

The extension name makes it unlikely first-time users would discover that Mercurial ships with a functioning patch MTA.

--
Steve Borho

Yuya Nishihara

unread,
Feb 11, 2014, 9:18:53 AM2/11/14
to thg...@googlegroups.com
Now I see. I've wondered why patchbomb is different from other extensions.

Thanks!
Reply all
Reply to author
Forward
0 new messages