Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2a9b2f2

Browse files
committed
Rename 'environment' and 'set_environment'
1 parent34c0831 commit2a9b2f2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

‎git/cmd.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -618,16 +618,16 @@ def as_text(stdout_value):
618618
defenvironment(self):
619619
returnself._environment
620620

621-
defset_environment(self,**kwargs):
621+
defupdate_environment(self,**kwargs):
622622
"""
623623
Set environment variables for future git invocations. Return all changed
624624
values in a format that can be passed back into this function to revert
625625
the changes:
626626
627627
``Examples``::
628628
629-
old_env = self.set_environment(PWD='/tmp')
630-
self.set_environment(**old_env)
629+
old_env = self.update_environment(PWD='/tmp')
630+
self.update_environment(**old_env)
631631
632632
:param kwargs: environment variables to use for git processes
633633
:return: dict that maps environment variables to their old values
@@ -648,23 +648,23 @@ def set_environment(self, **kwargs):
648648
returnold_env
649649

650650
@contextmanager
651-
defenvironment(self,**kwargs):
651+
defwith_environment(self,**kwargs):
652652
"""
653-
A context manager around the aboveset_environment to restore the
653+
A context manager around the aboveupdate_environment to restore the
654654
environment back to its previous state after operation.
655655
656656
``Examples``::
657657
658-
with self.environment(GIT_SSH='/bin/ssh_wrapper'):
658+
with self.with_environment(GIT_SSH='/bin/ssh_wrapper'):
659659
repo.remotes.origin.fetch()
660660
661-
:param kwargs: seeset_environment
661+
:param kwargs: seeupdate_environment
662662
"""
663-
old_env=self.set_environment(**kwargs)
663+
old_env=self.update_environment(**kwargs)
664664
try:
665665
yield
666666
finally:
667-
self.set_environment(**old_env)
667+
self.update_environment(**old_env)
668668

669669
@contextmanager
670670
defsshkey(self,sshkey_file):
@@ -682,7 +682,7 @@ def sshkey(self, sshkey_file):
682682
this_dir=os.path.dirname(__file__)
683683
ssh_wrapper=os.path.join(this_dir,'..','scripts','ssh_wrapper.py')
684684

685-
withself.environment(GIT_SSH_KEY_FILE=sshkey_file,GIT_SSH=ssh_wrapper):
685+
withself.with_environment(GIT_SSH_KEY_FILE=sshkey_file,GIT_SSH=ssh_wrapper):
686686
yield
687687

688688
deftransform_kwargs(self,split_single_char_options=False,**kwargs):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp