# HG changeset patch # User Ludovic Chabant # Date 1428375791 25200 # Node ID bdfc8a4a335d3e625dc1b465d3b2f9e6a8bef0f0 # Parent 455043eb436a0dd75b161e03983e6430d9eeb77c Expose more information to the command formatting. diff -r 455043eb436a -r bdfc8a4a335d september.py --- a/september.py Sat Mar 28 15:51:21 2015 -0700 +++ b/september.py Mon Apr 06 20:03:11 2015 -0700 @@ -139,6 +139,7 @@ # Parse arguments. res = parser.parse_args() repo_dir = res.repo or os.getcwd() + work_dir = os.getcwd() # Guess the repo type. repo_type = res.scm @@ -153,11 +154,13 @@ sys.exit(1) # Find the configuration file. + config_file_dir = None config_file = res.config or os.path.join(repo_dir, '.september.cfg') config = configparser.ConfigParser(interpolation=None) if os.path.exists(config_file): logger.info("Loading configuration file: %s" % config_file) config.read(config_file) + config_file_dir = os.path.dirname(config_file) # Validate the configuration. if not config.has_section('september'): @@ -259,6 +262,8 @@ command = config_sec['command'] % { 'rev_id': ti['id'], 'root_dir': clone_dir, + 'config_dir': config_file_dir, + 'work_dir': work_dir, 'tag': tn} logger.info("Running: %s" % command) subprocess.check_call(command, shell=use_shell)