Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions svn/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,29 @@ def remove(self, rel_path, do_keep_local=False, do_force=False):
self.run_command(
'rm',
args)

def lock(self, rel_filepaths=[], do_force=False):
args = []

if do_force is True:
args.append('--force')

args += rel_filepaths

self.run_command(
'lock',
args,
wd=self.path)

def unlock(self, rel_filepaths=[], do_force=False):
args = []

if do_force is True:
args.append('--force')

args += rel_filepaths

self.run_command(
'unlock',
args,
wd=self.path)
2 changes: 2 additions & 0 deletions svn/resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Functions currently implemented:
- update
- cleanup
- remove (i.e. rm, del, delete)
- lock
- unlock

In addition, there is also an "admin" class (`svn.admin.Admin`) that provides a
`create` method with which to create repositories.
Expand Down
7 changes: 7 additions & 0 deletions tests/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,10 @@ def test_cleanup(self):
with svn.test_support.temp_repo():
with svn.test_support.temp_checkout() as (_, lc):
lc.cleanup()

def test_lock(self):
with svn.test_support.temp_repo():
with svn.test_support.temp_checkout() as (_, lc):
svn.test_support.populate_bigger_file_changes1()
lc.lock(['committed_unchanged'])
lc.unlock(['committed_unchanged'])