-include README MANIFEST.in AUTHORS COPYING INSTALL ChangeLog TODO stgitrc
-include examples/*.tmpl
+include README MANIFEST.in AUTHORS COPYING INSTALL ChangeLog TODO
include templates/*.tmpl
+include examples/*.tmpl
+include examples/stgitrc
+# StGIT configuration file. Copy it to any of /etc/stgitrc, ~/.stgitrc
+# or .git/stgitrc and modify as needed. Note that the latter overrides
+# the former.
+
[stgit]
# Default author/committer details
#authname: Your Name
--- /dev/null
+[install]
+prefix: ~
long_description = 'Push/pop utility on top of GIT',
scripts = ['stg', 'gitmergeonefile.py'],
packages = ['stgit', 'stgit.commands'],
- data_files = [('/etc', ['stgitrc']),
- ('share/stgit/templates', glob.glob('templates/*.tmpl')),
- ('share/stgit/examples', glob.glob('examples/*.tmpl'))]
+ data_files = [('share/stgit/templates', glob.glob('templates/*.tmpl')),
+ ('share/stgit/examples', glob.glob('examples/*.tmpl')),
+ ('share/stgit/examples', ['examples/stgitrc'])]
)
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
+import sys, os
+
+# Try to detect where it is run from and set prefix and the search path.
+# It is assumed that the user installed StGIT using the --prefix= option
+prefix, bin = os.path.split(sys.path[0])
+
+if bin == 'bin' and prefix != sys.prefix:
+ sys.prefix = prefix
+ sys.exec_prefix = prefix
+
+ major, minor = sys.version_info[0:2]
+ sys.path += [os.path.join(prefix, 'lib', 'python'),
+ os.path.join(prefix, 'lib', 'python%s.%s' % (major, minor)),
+ os.path.join(prefix, 'lib', 'python%s.%s' % (major, minor),
+ 'site-packages')]
+
from stgit.main import main
main()
config = ConfigParser.RawConfigParser()
-config.readfp(file('/etc/stgitrc'))
+# Set the defaults
+config.add_section('stgit')
+config.set('stgit', 'autoresolved', 'no')
+config.set('stgit', 'smtpserver', 'localhost:25')
+
+config.add_section('gitmergeonefile')
+config.set('gitmergeonefile', 'merger',
+ 'diff3 -L local -L older -L remote -m -E ' \
+ '"%(branch1)s" "%(ancestor)s" "%(branch2)s" > "%(output)s"')
+config.set('gitmergeonefile', 'keeporig', 'yes')
+
+# Read the configuration files (if any) and override the default settings
+config.read('/etc/stgitrc')
config.read(os.path.expanduser('~/.stgitrc'))
config.read(os.path.join(__git_dir, 'stgitrc'))