Commit 017f1f2c authored by eric@webkit.org's avatar eric@webkit.org

2010-05-28 Adam Barth <abarth@webkit.org>

        Reviewed by David Levin.

        webkit-patch should support CHANGE_LOG_EDIT_APPLICATION
        https://bugs.webkit.org/show_bug.cgi?id=39546

        One sublty is that we want to wait for the user to finish editing the
        ChangeLog before moving on to the next step.  That means we want to pass
        -W to open.  However, if the user is using Xcode to edit the ChangeLog,
        we don't want them to have to exit the Xcode application.  For this reason,
        we create a new instance of the application with -n.

        Overall, xed seems like a better solution, so we recommend that too.

        * Scripts/webkitpy/common/system/user.py:
        * Scripts/webkitpy/tool/mocktool.py:
        * Scripts/webkitpy/tool/steps/editchangelog.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 34d21a8a
2010-05-28 Adam Barth <abarth@webkit.org>
Reviewed by David Levin.
webkit-patch should support CHANGE_LOG_EDIT_APPLICATION
https://bugs.webkit.org/show_bug.cgi?id=39546
One sublty is that we want to wait for the user to finish editing the
ChangeLog before moving on to the next step. That means we want to pass
-W to open. However, if the user is using Xcode to edit the ChangeLog,
we don't want them to have to exit the Xcode application. For this reason,
we create a new instance of the application with -n.
Overall, xed seems like a better solution, so we recommend that too.
* Scripts/webkitpy/common/system/user.py:
* Scripts/webkitpy/tool/mocktool.py:
* Scripts/webkitpy/tool/steps/editchangelog.py:
2010-05-21 Dirk Pranke <dpranke@chromium.org>
Reviewed by Ojan Vafai.
......
......@@ -76,6 +76,19 @@ class User(object):
# Note: Not thread safe: http://bugs.python.org/issue2320
subprocess.call(args + files)
def edit_changelog(self, files):
edit_application = os.environ.get("CHANGE_LOG_EDIT_APPLICATION")
if edit_application and sys.platform == "darwin":
# On Mac we support editing ChangeLogs using an application.
args = shlex.split(edit_application)
print "Using editor in the CHANGE_LOG_EDIT_APPLICATION environment variable."
print "Please quit the editor application when done editing."
if edit_application.find("Xcode.app"):
print "Instead of using Xcode.app, consider using EDITOR=\"xed --wait\"."
subprocess.call(["open", "-W", "-n", "-a"] + args + files)
return
self.edit(files)
def page(self, message):
pager = os.environ.get("PAGER") or "less"
try:
......
......@@ -444,6 +444,9 @@ class MockUser(object):
def edit(self, files):
pass
def edit_changelog(self, files):
pass
def page(self, message):
pass
......
......@@ -34,4 +34,4 @@ from webkitpy.tool.steps.abstractstep import AbstractStep
class EditChangeLog(AbstractStep):
def run(self, state):
os.chdir(self._tool.scm().checkout_root)
self._tool.user.edit(self.cached_lookup(state, "changelogs"))
self._tool.user.edit_changelog(self.cached_lookup(state, "changelogs"))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment