Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

Make forking configurable in config.py and disable it by default on Posix.

The new default value can be overruled with the config setting
tortoisehg.hgtkfork = 1.

Unix has shell commands for running processes in the background, so the
built-in forking support isn't necessary. Very few Unix gui commands without
MDI or tabs forks, so hgtk will be more predictable and tradition-compliant if
it also doesn't fork.

Changeset 0b4e5b9eed32

Parent b51c60a7f6e0

by Mads Kiilerich

Changes to 3 files · Browse files at 0b4e5b9eed32 Showing diff from parent b51c60a7f6e0 Diff from another changeset...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}  # Pure python package  %define debug_package %{nil}    Name: tortoisehg  Version: hg  Release: hg  Summary: Mercurial GUI command line tool hgtk  Group: Development/Tools  License: GPLv2  # Few files are under the more permissive GPLv2+  URL: http://bitbucket.org/tortoisehg/stable/wiki/  Source0: %{name}-%{version}.tar.gz  BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)  # This package should be noarch, but we can't do it because the nautilus  # subpackage has to be arch-specific (because of lib64)  # BuildArch: noarch  BuildRequires: python, python-devel, gettext, python-sphinx  Requires: python >= 2.4, python-iniparse, mercurial >= 1.3, gnome-python2-gconf  Requires: gnome-python2-gtksourceview, pycairo, pygobject2, pygtk2 >= 2.10    %description  This package contains the hgtk command line tool which provides a  graphical user interface to the Mercurial distributed revision control system.    %package nautilus  Summary: Mercurial GUI plugin to Nautilus file manager  Group: Development/Tools  Requires: %{name} = %{version}-%{release}, nautilus-python    %description nautilus  This package contains the TortoiseHg Gnome/Nautilus extension,  which makes the Mercurial distributed revision control  system available in the file manager with a graphical interface.    %prep  %setup -q    # Fedora Nautilus python extensions lives in lib64 on x86_64 (https://bugzilla.redhat.com/show_bug.cgi?id=509633) ...  %{__sed} -i "s,lib/nautilus,%{_lib}/nautilus,g" setup.py    cat > tortoisehg/util/config.py << EOT  bin_path = "%{_bindir}"  license_path = "%{_docdir}/%{name}-%{version}/COPYING.txt"  locale_path = "%{_datadir}/locale"  icon_path = "%{_datadir}/pixmaps/tortoisehg/icons" +nofork = True  EOT    %build  %{__python} setup.py build    (cd doc && make html)  rm doc/build/html/.buildinfo    %install  rm -rf $RPM_BUILD_ROOT    %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT    install -m 644 -D contrib/_hgtk $RPM_BUILD_ROOT/%{_datadir}/zsh/site-functions/_hgtk    %find_lang %{name}    %clean  rm -rf $RPM_BUILD_ROOT    %files -f %{name}.lang    %defattr(-,root,root,-)  %doc COPYING.txt ReleaseNotes.txt doc/build/html/  %{_bindir}/hgtk  %{python_sitelib}/tortoisehg/  %{python_sitelib}/tortoisehg-*.egg-info  %{_datadir}/pixmaps/tortoisehg/    # /usr/share/zsh/site-functions/ is owned by zsh package which we don't want to  # require. We also don't want to create a sub-package just for this dependency.  # Instead we just claim ownership of the zsh top folder ...  %{_datadir}/zsh    %files nautilus  %defattr(-,root,root,-)  %{_libdir}/nautilus/extensions-2.0/python/nautilus-thg.py*    %changelog
Change 1 of 1 Show Entire File setup.py Stacked
 
145
146
147
 
148
149
150
 
145
146
147
148
149
150
151
@@ -145,6 +145,7 @@
  f.write('license_path = "/usr/share/doc/tortoisehg/Copying.txt.gz"\n')   f.write('locale_path = "/usr/share/locale"\n')   f.write('icon_path = "/usr/share/pixmaps/tortoisehg/icons"\n') + f.write('nofork = True\n')   f.close()     return _scripts, _packages, _data_files, _extra
 
25
26
27
 
 
 
 
28
29
30
 
72
73
74
75
 
 
76
77
78
79
 
 
 
 
80
81
82
 
25
26
27
28
29
30
31
32
33
34
 
76
77
78
 
79
80
81
 
 
 
82
83
84
85
86
87
88
@@ -25,6 +25,10 @@
 from tortoisehg.util.i18n import agettext as _  from tortoisehg.util import hglib, paths, shlib  from tortoisehg.util import version as thgversion +try: + from tortoisehg.util.config import nofork as config_nofork +except ImportError: + config_nofork = None    nonrepo_commands = '''userconfig clone debugcomplete init about help  version thgstatus serve''' @@ -72,11 +76,13 @@
  gtkrun(run, u, **opts)    def portable_fork(ui, opts): - if 'THG_HGTK_SPAWN' in os.environ: + if 'THG_HGTK_SPAWN' in os.environ or \ + opts.get('nofork') or opts.get('repository'):   return - if opts.get('nofork') or opts.get('repository'): - return - if not ui.configbool('tortoisehg', 'hgtkfork', True): + elif ui.configbool('tortoisehg', 'hgtkfork', None) is not None: + if not ui.configbool('tortoisehg', 'hgtkfork'): + return + elif config_nofork:   return   # Spawn background process and exit   if hasattr(sys, "frozen"):