Skip to content

Commit

Permalink
Clarify in docstrings that Client.{fetch_pack,fetch} returns all remote
Browse files Browse the repository at this point in the history
refs, not just those fetched.
  • Loading branch information
jelmer committed Dec 3, 2015
1 parent 826d050 commit 152faba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dulwich/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def fetch(self, path, target, determine_wants=None, progress=None):
:param determine_wants: Optional function to determine what refs
to fetch
:param progress: Optional progress function
:return: remote refs as dictionary
:return: Dictionary with all remote refs (not just those fetched)
"""
if determine_wants is None:
determine_wants = target.object_store.determine_wants_all
Expand Down Expand Up @@ -262,6 +262,7 @@ def fetch_pack(self, path, determine_wants, graph_walker, pack_data,
:param graph_walker: Object with next() and ack().
:param pack_data: Callback called for each bit of data in the pack
:param progress: Callback for progress reports (strings)
:return: Dictionary with all remote refs (not just those fetched)
"""
raise NotImplementedError(self.fetch_pack)

Expand Down Expand Up @@ -549,6 +550,7 @@ def fetch_pack(self, path, determine_wants, graph_walker, pack_data,
:param graph_walker: Object with next() and ack().
:param pack_data: Callback called for each bit of data in the pack
:param progress: Callback for progress reports (strings)
:return: Dictionary with all remote refs (not just those fetched)
"""
proto, can_read = self._connect(b'upload-pack', path)
with proto:
Expand Down Expand Up @@ -791,7 +793,7 @@ def fetch(self, path, target, determine_wants=None, progress=None):
:param determine_wants: Optional function to determine what refs
to fetch
:param progress: Optional progress function
:return: remote refs as dictionary
:return: Dictionary with all remote refs (not just those fetched)
"""
from dulwich.repo import Repo
with closing(Repo(path)) as r:
Expand All @@ -806,6 +808,7 @@ def fetch_pack(self, path, determine_wants, graph_walker, pack_data,
:param graph_walker: Object with next() and ack().
:param pack_data: Callback called for each bit of data in the pack
:param progress: Callback for progress reports (strings)
:return: Dictionary with all remote refs (not just those fetched)
"""
from dulwich.repo import Repo
with closing(Repo(path)) as r:
Expand Down Expand Up @@ -1059,7 +1062,7 @@ def fetch_pack(self, path, determine_wants, graph_walker, pack_data,
:param graph_walker: Object with next() and ack().
:param pack_data: Callback called for each bit of data in the pack
:param progress: Callback for progress reports (strings)
:return: Dictionary with the refs of the remote repository
:return: Dictionary with all remote refs (not just those fetched)
"""
url = self._get_url(path)
refs, server_capabilities = self._discover_references(
Expand Down

0 comments on commit 152faba

Please sign in to comment.