Mercurial > hg > config
changeset 406:38dd72d72086
fix
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 31 Jul 2013 14:25:02 -0700 |
parents | 815eb5c796e9 |
children | a8982ae84a9b |
files | .fluxbox/keys python/setup_repo.py python/url2txt.py |
diffstat | 3 files changed, 17 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/.fluxbox/keys Tue Jul 30 18:43:53 2013 -0700 +++ b/.fluxbox/keys Wed Jul 31 14:25:02 2013 -0700 @@ -76,6 +76,7 @@ Control Mod1 s :ExecCommand /home/jhammel/bin/smartopen "$(xclip -o)" # smartopen Control Mod1 t :ExecCommand gnome-terminal # terminal Control Mod1 x :ExecCommand xkill +Control Mod1 y :ExecCommand xclip -o | /home/jhammel/python/pypi.py | xclip -i # pypi package summary Control Mod1 0 :ExecCommand xclip -o | sed 's/^[-+]//' | xclip -i # strip leading +s Control Shift / :ExecCommand /home/jhammel/bin/keyshelp.sh # hotkeys help
--- a/python/setup_repo.py Tue Jul 30 18:43:53 2013 -0700 +++ b/python/setup_repo.py Wed Jul 31 14:25:02 2013 -0700 @@ -23,6 +23,20 @@ call(['hg', 'add', '-R', directory]) call(['hg', 'commit', '-m', options.message, '-R', directory]) +def write_hgrc(directory, host, repo, name): + """write hgrc file""" + + HGRC="""[paths] +default = http://%(host)s/%(repo)s/%(name)s +default-push = ssh://%(host)s/%(repo)s/%(remote_path)s +""" + + path = os.path.join(directory, '.hg', 'hgrc') + # TODO: use ConfigParser + with file(os.path.join(directory, '.hg', 'hgrc'), 'w') as f: + print >> f, HGRC % { 'host': host, 'repo': repo, 'name': name} + + def setup_remote(local_repo, remote_url, push='ssh', remote_path=None): """ setup a remote repository for local_repo @@ -44,19 +58,6 @@ remote_dir = '%s/%s' % (path, name) call(['ssh', host, "mkdir -p %s && cd %s && hg init" % (remote_dir, remote_dir)]) -def write_hgrc(directory, host, repo, name): - """write hgrc file""" - - HGRC="""[paths] -default = http://%(host)s/%(repo)s/%(name)s -default-push = ssh://%(host)s/%(repo)s/%(name)s -""" - - path = os.path.join(directory, '.hg', 'hgrc') - # TODO: use ConfigParser - with file(os.path.join(directory, '.hg', 'hgrc'), 'w') as f: - print >> f, HGRC % { 'host': host, 'repo': repo, 'name': name} - def main(args=sys.argv[1:]):