Skip to content
Permalink
Browse files
2010-10-25 Eric Seidel <eric@webkit.org>
        Reviewed by Adam Barth.

        webkit-patch should clean up svn locks when passed --force-clean
        https://bugs.webkit.org/show_bug.cgi?id=48269

        * Scripts/webkitpy/common/checkout/scm.py:

Canonical link: https://commits.webkit.org/61036@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eseidel committed Oct 25, 2010
1 parent 695cabd commit a865623dd7ac055fc1c6e3d9516070617585f0b7
Showing 3 changed files with 25 additions and 0 deletions.
@@ -1,3 +1,12 @@
2010-10-25 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

webkit-patch should clean up svn locks when passed --force-clean
https://bugs.webkit.org/show_bug.cgi?id=48269

* Scripts/webkitpy/common/checkout/scm.py:

2010-10-25 Anders Carlsson <andersca@apple.com>

Reviewed by Adam Roben.
@@ -379,6 +379,12 @@ def working_directory_is_clean(self):
return self.run(["svn", "diff"], cwd=self.checkout_root, decode_output=False) == ""

def clean_working_directory(self):
# Make sure there are no locks lying around from a previously aborted svn invocation.
# This is slightly dangerous, as it's possible the user is running another svn process
# on this checkout at the same time. However, it's much more likely that we're running
# under windows and svn just sucks (or the user interrupted svn and it failed to clean up).
self.run(["svn", "cleanup"], cwd=self.checkout_root)

# svn revert -R is not as awesome as git reset --hard.
# It will leave added files around, causing later svn update
# calls to fail on the bots. We make this mirror git reset --hard
@@ -432,6 +438,7 @@ def changed_files_for_revision(self, revision):

def revisions_changing_file(self, path, limit=5):
revisions = []
# svn log will exit(1) (and thus self.run will raise) if the path does not exist.
log_command = ['svn', 'log', '--quiet', '--limit=%s' % limit, path]
for line in self.run(log_command, cwd=self.checkout_root).splitlines():
match = re.search('^r(?P<revision>\d+) ', line)
@@ -760,6 +760,15 @@ def test_diff_for_file_with_missing_bogus_dir(self):
self.do_test_diff_for_file()
self.assertFalse(os.path.exists(self.bogus_dir))

def test_svn_lock(self):
svn_root_lock_path = ".svn/lock"
write_into_file_at_path(svn_root_lock_path, "", "utf-8")
# webkit-patch uses a Checkout object and runs update-webkit, just use svn update here.
self.assertRaises(ScriptError, run_command, ['svn', 'update'])
self.scm.clean_working_directory()
self.assertFalse(os.path.exists(svn_root_lock_path))
run_command(['svn', 'update']) # Should succeed and not raise.


class GitTest(SCMTest):

0 comments on commit a865623

Please sign in to comment.