Skip to content

Commit

Permalink
Revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalemink committed Mar 18, 2024
1 parent 5948574 commit 6a00bdf
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/pmr2/wfctrl/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ def set_committer(self, name, email, **kw):
# TODO persist config.
self._committer = '%s <%s>' % (name, email)

def clone(self, workspace, username=None, password=None, **kw):
target = self.get_remote(workspace, target_remote=self.remote, username=username, password=password)
return self.execute('clone', target, workspace.working_dir)
def clone(self, workspace, **kw):
return self.execute('clone', self.remote, workspace.working_dir)

def init_new(self, workspace, **kw):
return self.execute('init', workspace.working_dir)
Expand Down Expand Up @@ -148,9 +147,8 @@ def _args(self, workspace, *args):
def set_committer(self, name, email, **kw):
self._committer = (name, email)

def clone(self, workspace, username=None, password=None, **kw):
target = self.get_remote(workspace, target_remote=self.remote, username=username, password=password)
return self.execute('clone', target, workspace.working_dir)
def clone(self, workspace, **kw):
return self.execute('clone', self.remote, workspace.working_dir)

def init_new(self, workspace, **kw):
return self.execute('init', workspace.working_dir)
Expand Down Expand Up @@ -237,11 +235,10 @@ def available(cls):
def set_committer(self, name, email, **kw):
self._committer = (name, email)

def clone(self, workspace, username=None, password=None, **kw):
def clone(self, workspace, **kw):
out_stream = BytesIO()
err_stream = BytesIO()
target = self.get_remote(workspace, target_remote=self.remote, username=username, password=password)
porcelain.clone(target, workspace.working_dir, outstream=out_stream, errstream=err_stream)
porcelain.clone(self.remote, workspace.working_dir, outstream=out_stream, errstream=err_stream)
return out_stream.getvalue(), err_stream.getvalue(), 0

def init_new(self, workspace, **kw):
Expand All @@ -262,12 +259,9 @@ def commit(self, workspace, message, **kw):
return output, b'', 0 if output else 1

def read_remote(self, workspace, target_remote=None, **kw):
try:
with porcelain.open_repo_closing(workspace.working_dir) as repo:
_, name = porcelain.get_remote_repo(repo, target_remote)
return name
except NotGitRepository:
return None
with porcelain.open_repo_closing(workspace.working_dir) as repo:
_, name = porcelain.get_remote_repo(repo, target_remote)
return name

def write_remote(self, workspace, target_remote=None, **kw):
target_remote = target_remote or self.default_remote
Expand Down

0 comments on commit 6a00bdf

Please sign in to comment.