diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-28 12:00:58 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-28 12:00:58 +0100 |
commit | 146a6fe18da94e12aa46ec74582db640e3bbb3a9 (patch) | |
tree | 8c26d4903de1002acb40ec5cead52e30363a95b5 /lib/git/remote.py | |
parent | 87afd252bd11026b6ba3db8525f949cfb62c90fc (diff) | |
download | gitpython-146a6fe18da94e12aa46ec74582db640e3bbb3a9.tar.gz |
IterableList: added support for prefix allowing remote.refs.master constructs, previously it was remote.refs['%s/master'%remote]
Added first simple test for push support, which shows that much more work is needed on that side to allow just-in-time progress information
Diffstat (limited to 'lib/git/remote.py')
-rw-r--r-- | lib/git/remote.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/git/remote.py b/lib/git/remote.py index 02a955b0..47743913 100644 --- a/lib/git/remote.py +++ b/lib/git/remote.py @@ -256,9 +256,11 @@ class Remote(LazyMixin, Iterable): def refs(self): """ Returns - IterableList of RemoteReference objects + IterableList of RemoteReference objects. It is prefixed, allowing + you to omit the remote path portion, i.e.:: + remote.refs.master # yields RemoteReference('/refs/remotes/origin/master') """ - out_refs = IterableList(RemoteReference._id_attribute_) + out_refs = IterableList(RemoteReference._id_attribute_, "%s/" % self.name) for ref in RemoteReference.list_items(self.repo): if ref.remote_name == self.name: out_refs.append(ref) @@ -274,8 +276,11 @@ class Remote(LazyMixin, Iterable): IterableList RemoteReference objects that do not have a corresponding head in the remote reference anymore as they have been deleted on the remote side, but are still available locally. + + The IterableList is prefixed, hence the 'origin' must be omitted. See + 'refs' property for an example. """ - out_refs = IterableList(RemoteReference._id_attribute_) + out_refs = IterableList(RemoteReference._id_attribute_, "%s/" % self.name) for line in self.repo.git.remote("prune", "--dry-run", self).splitlines()[2:]: # expecting # * [would prune] origin/new_branch @@ -357,7 +362,6 @@ class Remote(LazyMixin, Iterable): def _get_fetch_info_from_stderr(self, stderr): # skip first line as it is some remote info we are not interested in - print stderr output = IterableList('name') err_info = stderr.splitlines()[1:] @@ -426,7 +430,12 @@ class Remote(LazyMixin, Iterable): Returns self """ - self.repo.git.push(self, refspec, **kwargs) + proc = self.repo.git.push(self, refspec, porcelain=True, as_process=True, **kwargs) + print "stdout"*10 + print proc.stdout.read() + print "stderr"*10 + print proc.stderr.read() + proc.wait() return self @property |