Skip to content

Commit 3d882af

Browse files
committed
chore(git,hg,svn): Make obtain, update_repo accept any args
1 parent 234a272 commit 3d882af

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

libvcs/git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def set_remotes(self, overwrite: bool = False):
241241
if not existing_remote or existing_remote.fetch_url != url:
242242
self.set_remote(name=remote_name, url=url, overwrite=overwrite)
243243

244-
def obtain(self):
244+
def obtain(self, *args, **kwargs):
245245
"""Retrieve the repository, clone if doesn't exist."""
246246
self.ensure_dir()
247247

@@ -264,7 +264,7 @@ def obtain(self):
264264

265265
self.set_remotes()
266266

267-
def update_repo(self, set_remotes: bool = False):
267+
def update_repo(self, set_remotes: bool = False, *args, **kwargs):
268268
self.ensure_dir()
269269

270270
if not os.path.isdir(os.path.join(self.path, ".git")):

libvcs/hg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class MercurialRepo(BaseRepo):
2323
def __init__(self, url, repo_dir, **kwargs):
2424
BaseRepo.__init__(self, url, repo_dir, **kwargs)
2525

26-
def obtain(self):
26+
def obtain(self, *args, **kwargs):
2727
self.ensure_dir()
2828

2929
# Double hyphens between [OPTION]... -- SOURCE [DEST] prevent command injections
@@ -34,7 +34,7 @@ def obtain(self):
3434
def get_revision(self):
3535
return self.run(["parents", "--template={rev}"])
3636

37-
def update_repo(self):
37+
def update_repo(self, *args, **kwargs):
3838
self.ensure_dir()
3939
if not os.path.isdir(os.path.join(self.path, ".hg")):
4040
self.obtain()

libvcs/svn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def get_revision(self, location=None):
120120
revision = max(revision, localrev)
121121
return revision
122122

123-
def update_repo(self, dest=None):
123+
def update_repo(self, dest=None, *args, **kwargs):
124124
self.ensure_dir()
125125
if os.path.isdir(os.path.join(self.path, ".svn")):
126126
dest = self.path if not dest else dest

0 commit comments

Comments
 (0)