On Tue, Apr 14, 2009 at 6:01 PM, Mads Kiilerich <[email protected]> wrote:
> # HG changeset patch
> # User Mads Kiilerich <[email protected]>
> # Date 1239748414 -7200
> # Node ID ee7293383d6bec98567ac26c2dbf9b1956852a0c
> # Parent e651a0fdbb5ee40d7a4d844d77136549739d2b32
> Fix launch of vdiff from nautilus
>
> hgtk has no "diff" subcommand but a fine "vdiff" subcommand.
>
> The "not diffcmd" branch was never reached because of the default value.
A user could set [tortoisehg] vdiff= in their hgrc file, so the fall
back case could be
called, but as you noticed the fall back is broken.
Actually, with the new visdiff dialog on crew, there is no reason to
even look at
the configuration here. We should just pass the vdiff command on to hgtk and
let it deal with the configuration issues.
Can you resubmit this as two patches: one with the variable cleanups, and
another to remove the entire vdiff special case?
Thanks.
> diff --git a/contrib/nautilus-thg.py b/contrib/nautilus-thg.py
> --- a/contrib/nautilus-thg.py
> +++ b/contrib/nautilus-thg.py
> @@ -124,9 +124,9 @@
> print e
> return None
>
> - def run_dialog(self, menuitem, hgcmd, cwd = None):
> + def run_dialog(self, menuitem, hgtkcmd, cwd = None):
> '''
> - hgcmd - hgproc subcommand
> + hgtkcmd - hgtk subcommand
> '''
> if cwd: #bg
> self.files = []
> @@ -134,19 +134,17 @@
> cwd = self.cwd
> repo = self.get_repo_for_path(cwd)
>
> - if hgcmd == 'vdiff':
> - diffcmd = repo.ui.config('tortoisehg', 'vdiff', 'vdiff')
> - if not diffcmd:
> - hgcmd = 'diff'
> - else:
> + if hgtkcmd == 'vdiff':
> + diffcmd = repo.ui.config('tortoisehg', 'vdiff')
> + if diffcmd:
> cmdline = ['hg', diffcmd]
> cmdline.extend(self.files)
> subprocess.Popen(cmdline, shell=False, env=self.env, cwd=cwd)
> return
>
> - cmdopts = [sys.executable, self.hgproc, hgcmd]
> + cmdopts = [sys.executable, self.hgproc, hgtkcmd]
>
> - if hgcmd not in nofilecmds and self.files:
> + if hgtkcmd not in nofilecmds and self.files:
> # Use stdin to pass file list (avoid shell command
> # line limitations)
> pipe = subprocess.PIPE
> @@ -160,7 +158,7 @@
> stdin.write('\n'.join(self.files))
> stdin.close()
>
> - if hgcmd not in nocachecmds:
> + if hgtkcmd not in nocachecmds:
> # Remove cached repo object, dirstate may change
> self.cacherepo = None
> self.cacheroot = None
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> Tortoisehg-develop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop
>
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop