##// END OF EJS Templates
Merge pull request #1759 from Carreau/mpr...
Merge pull request #1759 from Carreau/mpr Add git-mpr, to merge PR(s) from github just by number(s). Inspired by git-mrb and test_pr, I thougth it would be usefull to be able to merge PR only by giving their number. Hence `git merge-pull-request`or `git-mpr`. usage: ```bash $ git mpr -h ~/ipython/tools usage: git-mpr [-h] [-l | -a | -m [pr-number [pr-number ...]]] Merge (one|many) github pull request by their number. If pull request can't be merge as is, cancel merge, and continue to the next if any. optional arguments: -h, --help show this help message and exit -l, --list list PR, their number and their mergeability -a, --merge-all try to merge as many PR as possible, one by one -m [pr-number [pr-number ...]], --merge [pr-number [pr-number ...]] The pull request numbers ``` examples : ```bash $ git mpr --list * #1758 [√]: test_pr, fallback on http if git protocol fail, and SSL errors... * #1755 [√]: test for pygments before running qt tests * #1715 [√]: Fix for #1688, traceback-unicode issue [...] * #1493 [√]: Selenium web tests proof-of-concept * #1471 [ ]: simplify IPython.parallel connections and enable Controller Resume * #1343 [ ]: Add prototype shutdown button to Notebook dashboard * #1285 [√]: Implementation of grepping the input history using several patterns * #1215 [√]: updated %quickref to show short-hand for %sc and %sx ``` PR number, mergeability and title Quite slow, as it does 1 api call by PR, since api does not give mergeability anymore if you ask for the list of all PRs at once. merge one or more PR (skip the ones with conflict and present a nice list to copy and past to do it by hand) ```bash $ git mpr --merge [pr-number [pr-number ...]]] [...] ************************************************************************************* the following branch have not been merged automatically, considere doing it by hand : PR 1630: git pull https://github.com/minrk/ipython.git mergekernel PR 1343: git pull https://github.com/takluyver/ipython.git notebook-shutdown PR 1715: git pull https://github.com/jstenar/ipython.git ultratb-pycolorize-unicode PR 1732: git pull https://github.com/fperez/ipython.git cellmagics PR 1471: git pull https://github.com/minrk/ipython.git connection PR 1674: git pull https://github.com/mdboom/ipython.git notebook-carriage-return ************************************************************************************* ``` And last, ``` git mpr --merge-all ``` That is pretty self explainatory

File last commit:

r5214:d05b9909
r7531:029bbad1 merge
Show More
iploggerapp.py
103 lines | 3.0 KiB | text/x-python | PythonLexer
#!/usr/bin/env python
# encoding: utf-8
"""
A simple IPython logger application
Authors:
* MinRK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import os
import sys
import zmq
from IPython.core.profiledir import ProfileDir
from IPython.utils.traitlets import Bool, Dict, Unicode
from IPython.parallel.apps.baseapp import (
BaseParallelApplication,
base_aliases,
catch_config_error,
)
from IPython.parallel.apps.logwatcher import LogWatcher
#-----------------------------------------------------------------------------
# Module level variables
#-----------------------------------------------------------------------------
#: The default config file name for this application
default_config_file_name = u'iplogger_config.py'
_description = """Start an IPython logger for parallel computing.
IPython controllers and engines (and your own processes) can broadcast log messages
by registering a `zmq.log.handlers.PUBHandler` with the `logging` module. The
logger can be configured using command line options or using a cluster
directory. Cluster directories contain config, log and security files and are
usually located in your ipython directory and named as "profile_name".
See the `profile` and `profile-dir` options for details.
"""
#-----------------------------------------------------------------------------
# Main application
#-----------------------------------------------------------------------------
aliases = {}
aliases.update(base_aliases)
aliases.update(dict(url='LogWatcher.url', topics='LogWatcher.topics'))
class IPLoggerApp(BaseParallelApplication):
name = u'iplogger'
description = _description
config_file_name = Unicode(default_config_file_name)
classes = [LogWatcher, ProfileDir]
aliases = Dict(aliases)
@catch_config_error
def initialize(self, argv=None):
super(IPLoggerApp, self).initialize(argv)
self.init_watcher()
def init_watcher(self):
try:
self.watcher = LogWatcher(config=self.config, log=self.log)
except:
self.log.error("Couldn't start the LogWatcher", exc_info=True)
self.exit(1)
self.log.info("Listening for log messages on %r"%self.watcher.url)
def start(self):
self.watcher.start()
try:
self.watcher.loop.start()
except KeyboardInterrupt:
self.log.critical("Logging Interrupted, shutting down...\n")
def launch_new_instance():
"""Create and run the IPython LogWatcher"""
app = IPLoggerApp.instance()
app.initialize()
app.start()
if __name__ == '__main__':
launch_new_instance()