Mercurial > hg
view contrib/dockerrpm @ 21405:dcf20f244c2a
cmdutil: introduce "getcommiteditor()" to simplify code paths to choose editor
"getcommiteditor()" can simplify code paths to choose commit editor
according to '--edit' option as below:
before:
editor = cmdutil.commiteditor # or editor = None/False
if opts.get('edit'):
editor = cmdutil.commitforceeditor
after:
editor = cmdutil.getcommiteditor(**opts)
"getcommiteditor()" accepts option arguments not in "opts" style but
in "**opts" style, because some code paths want to invoke it with just
explicit "edit=True" argument (building dictionary is redundant).
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sun, 11 May 2014 00:49:35 +0900 |
parents | 62a2749895e4 |
children | f1bcc33a5c52 |
line wrap: on
line source
#!/bin/bash BUILDDIR=$(dirname $0) ROOTDIR=$(cd $BUILDDIR/..; pwd) if which docker >> /dev/null ; then DOCKER=docker elif which docker.io >> /dev/null ; then DOCKER=docker.io fi $DOCKER build --tag "hg-dockerrpm-$1" - < $BUILDDIR/docker/$1 $DOCKER run --rm -v $ROOTDIR:/hg "hg-dockerrpm-$1" bash -c \ "cp -a hg hg-build; cd hg-build; make clean local $1; cp build/$1/* /hg/build/$1/"