Skip to content

Commit

Permalink
Set clientname before performing p4 operations (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
ca-johnson authored Apr 21, 2020
1 parent 9f3abfa commit 9fdabaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/perforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def _setup_client(self):
if self.created_client:
return
clientname = self._get_clientname()
# must be set prior to running any commands to avoid issues with default client names
self.perforce.client = clientname
client = self.perforce.fetch_client(clientname)
if self.root:
client._root = self.root
Expand All @@ -89,7 +91,6 @@ def _setup_client(self):
client._options = self.client_opts + ' clobber'

self.perforce.save_client(client)
self.perforce.client = clientname

if not os.path.isfile(self.p4config):
self.perforce.logger.warning("p4config missing, flushing workspace to revision zero")
Expand Down

0 comments on commit 9fdabaf

Please sign in to comment.