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

Commit11b1f6e

Browse files
committed
repo.remote method added
CHANGES updated to carry information about remotes and config
1 parent985093b commit11b1f6e

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

‎CHANGES‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,19 @@ Refs
107107
* Will dynmically retrieve their object at the time of query to assure the information
108108
is actual. Recently objects would be cached, hence ref object not be safely kept
109109
persistent.
110+
111+
Remote
112+
------
113+
* Added Remote object allowing easy access to remotes
114+
* Repo.remotes lists all remotes
115+
* Repo.remote returns a remote of the specified name if it exists
116+
117+
Config
118+
------
119+
* The git configuration can now be read and manipulated directly from within python
120+
using the GitConfigParser
121+
* Repo.config_reader returns a read-only parser
122+
* Repo.config_writer returns a read-write parser
110123

111124
0.1.6
112125
=====

‎lib/git/repo.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,20 @@ def remotes(self):
115115
A list of Remote objects allowing to access and manipulate remotes
116116
"""
117117
returnRemote.list_items(self)
118+
119+
defremote(self,name='origin'):
120+
"""
121+
Return
122+
Remote with the specified name
123+
124+
Raise
125+
ValueError if no remote with such a name exists
126+
"""
127+
forremoteinRemote.iter_items(self):
128+
ifremote.name==name:
129+
returnremote
130+
# END for each existing remote
131+
raiseValueError("Remote named %s does not exist"%name )
118132

119133
# alias heads
120134
branches=heads

‎test/git/test_remote.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def test_base(self):
6767
assertnum_remotes
6868
assertnum_remotes==len(remote_set)
6969

70+
origin=self.repo.remote('origin')
7071

7172
deftest_creation_and_removal(self):
7273
new_name="test_new_one"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp