diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Tools/Scripts/webkitpy/common/checkout/scm/scm.py | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Tools/Scripts/webkitpy/common/checkout/scm/scm.py')
-rw-r--r-- | Tools/Scripts/webkitpy/common/checkout/scm/scm.py | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/scm.py b/Tools/Scripts/webkitpy/common/checkout/scm/scm.py index 7d6e1804d..b005ea239 100644 --- a/Tools/Scripts/webkitpy/common/checkout/scm/scm.py +++ b/Tools/Scripts/webkitpy/common/checkout/scm/scm.py @@ -90,26 +90,6 @@ class SCM: def script_path(self, script_name): return self._filesystem.join(self.scripts_directory(), script_name) - def ensure_clean_working_directory(self, force_clean): - if self.working_directory_is_clean(): - return - if not force_clean: - print self.run(self.status_command(), error_handler=Executive.ignore_error, cwd=self.checkout_root) - raise ScriptError(message="Working directory has modifications, pass --force-clean or --no-clean to continue.") - _log.info("Cleaning working directory") - self.clean_working_directory() - - def ensure_no_local_commits(self, force): - if not self.supports_local_commits(): - return - commits = self.local_commits() - if not len(commits): - return - if not force: - _log.error("Working directory has local commits, pass --force-clean to continue.") - sys.exit(1) - self.discard_local_commits() - def run_status_and_extract_filenames(self, status_command, status_regexp): filenames = [] # We run with cwd=self.checkout_root so that returned-paths are root-relative. @@ -147,19 +127,13 @@ class SCM: def commit_success_regexp(): SCM._subclass_must_implement() - def working_directory_is_clean(self): - self._subclass_must_implement() - - def clean_working_directory(self): - self._subclass_must_implement() - def status_command(self): self._subclass_must_implement() - def add(self, path, return_exit_code=False): - self.add_list([path], return_exit_code) + def add(self, path): + self.add_list([path]) - def add_list(self, paths, return_exit_code=False): + def add_list(self, paths): self._subclass_must_implement() def delete(self, path): @@ -193,6 +167,10 @@ class SCM: return self.svn_revision(self.checkout_root) def svn_revision(self, path): + """Returns the latest svn revision found in the checkout.""" + self._subclass_must_implement() + + def timestamp_of_revision(self, path, revision): self._subclass_must_implement() def create_patch(self, git_commit=None, changed_files=None): @@ -231,12 +209,28 @@ class SCM: def svn_blame(self, path): self._subclass_must_implement() + def has_working_directory_changes(self): + self._subclass_must_implement() + + def discard_working_directory_changes(self): + self._subclass_must_implement() + + #-------------------------------------------------------------------------- # Subclasses must indicate if they support local commits, # but the SCM baseclass will only call local_commits methods when this is true. @staticmethod def supports_local_commits(): SCM._subclass_must_implement() + def local_commits(self): + return [] + + def has_local_commits(self): + return len(self.local_commits()) > 0 + + def discard_local_commits(self): + return + def remote_merge_base(self): SCM._subclass_must_implement() @@ -244,8 +238,12 @@ class SCM: _log.error("Your source control manager does not support local commits.") sys.exit(1) - def discard_local_commits(self): - pass + def local_changes_exist(self): + return (self.supports_local_commits() and self.has_local_commits()) or self.has_working_directory_changes() - def local_commits(self): - return [] + def discard_local_changes(self): + if self.has_working_directory_changes(): + self.discard_working_directory_changes() + + if self.has_local_commits(): + self.discard_local_commits() |