Changeset 56032 in webkit


Ignore:
Timestamp:
Mar 15, 2010 9:15:20 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-03-15 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

webkit-patch rollout should error out on conflicts
https://bugs.webkit.org/show_bug.cgi?id=36151

Instead of blindingly plowing ahead, we now throw an exception if there
are conflicts after applying a reverse diff.

  • Scripts/webkitpy/scm.py:
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r56026 r56032  
     12010-03-15  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        webkit-patch rollout should error out on conflicts
     6        https://bugs.webkit.org/show_bug.cgi?id=36151
     7
     8        Instead of blindingly plowing ahead, we now throw an exception if there
     9        are conflicts after applying a reverse diff.
     10
     11        * Scripts/webkitpy/scm.py:
     12
    1132010-03-15  Chris Fleizach  <cfleizach@apple.com>
    214
  • trunk/WebKitTools/Scripts/webkitpy/scm.py

    r55204 r56032  
    211211        raise NotImplementedError, "subclasses must implement"
    212212
     213    def conflicted_files(self):
     214        raise NotImplementedError, "subclasses must implement"
     215
    213216    def display_name(self):
    214217        raise NotImplementedError, "subclasses must implement"
     
    335338        return self.run_status_and_extract_filenames(self.status_command(), status_regexp)
    336339
     340    def conflicted_files(self):
     341        if self.svn_version() > "1.6":
     342            status_regexp = "^(?P<status>[C]).{6} (?P<filename>.+)$"
     343        else:
     344            status_regexp = "^(?P<status>[C]).{5} (?P<filename>.+)$"
     345        return self.run_status_and_extract_filenames(self.status_command(), status_regexp)
     346
    337347    @staticmethod
    338348    def supports_local_commits():
     
    433443        status_regexp = '^(?P<status>[ADM])\t(?P<filename>.+)$'
    434444        return self.run_status_and_extract_filenames(status_command, status_regexp)
    435    
     445
     446    def conflicted_files(self):
     447        status_command = ['git', 'diff', '--name-status', '-C', '-M', '--diff-filter=U']
     448        status_regexp = '^(?P<status>[U])\t(?P<filename>.+)$'
     449        return self.run_status_and_extract_filenames(status_command, status_regexp)
     450
    436451    @staticmethod
    437452    def supports_local_commits():
     
    460475
    461476        # I think this will always fail due to ChangeLogs.
    462         # FIXME: We need to detec specific failure conditions and handle them.
    463477        run_command(['git', 'revert', '--no-commit', git_commit], error_handler=Executive.ignore_error)
    464478
     
    467481        if len(changelog_paths):
    468482            run_command([self.script_path('resolve-ChangeLogs')] + changelog_paths)
     483
     484        conflicts = self.conflicted_files()
     485        if len(conflicts):
     486            raise ScriptError(message="Failed to apply reverse diff for revision %s because of the following conflicts:\n%s" % (revision, "\n".join(conflicts)))
    469487
    470488    def revert_files(self, file_paths):
Note: See TracChangeset for help on using the changeset viewer.