| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -107,6 +107,19 @@ Refs | |||
| 107 | 107 | * Will dynmically retrieve their object at the time of query to assure the information | |
| 108 | 108 | is actual. Recently objects would be cached, hence ref object not be safely kept | |
| 109 | 109 | 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 | ||
| 110 | 123 | ||
| 111 | 124 | 0.1.6 | |
| 112 | 125 | ===== | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -115,6 +115,20 @@ def remotes(self): | |||
| 115 | 115 | A list of Remote objects allowing to access and manipulate remotes | |
| 116 | 116 | """ | |
| 117 | 117 | return Remote.list_items(self) | |
| 118 | + | ||
| 119 | + def remote(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 | + for remote in Remote.iter_items(self): | ||
| 128 | + if remote.name == name: | ||
| 129 | + return remote | ||
| 130 | + # END for each existing remote | ||
| 131 | + raise ValueError( "Remote named %s does not exist" % name ) | ||
| 118 | 132 | ||
| 119 | 133 | # alias heads | |
| 120 | 134 | branches = heads | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,6 +67,7 @@ def test_base(self): | |||
| 67 | 67 | assert num_remotes | |
| 68 | 68 | assert num_remotes == len(remote_set) | |
| 69 | 69 | ||
| 70 | + origin = self.repo.remote('origin') | ||
| 70 | 71 | ||
| 71 | 72 | def test_creation_and_removal(self): | |
| 72 | 73 | new_name = "test_new_one" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments