Skip to content

Commit 6569c48

Browse files
committed
Fixed some doc strings to build correctly with sphinx
Fixes #7 [ci skip]
1 parent 53e5fb3 commit 6569c48

File tree

7 files changed

+32
-32
lines changed

7 files changed

+32
-32
lines changed

‎git/cmd.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -769,10 +769,10 @@ def get_object_data(self, ref):
769769
return (hexsha, typename, size, data)
770770

771771
def stream_object_data(self, ref):
772-
"""As get_object_header, but returns the data as a stream
772+
""" As get_object_header, but returns the data as a stream
773+
773774
:return: (hexsha, type_string, size_as_int, stream)
774-
:note: This method is not threadsafe, you need one independent Command instance
775-
per thread to be safe !"""
775+
:note: This method is not threadsafe, you need one independent Command instance per thread to be safe !"""
776776
cmd = self._get_persistent_cmd("cat_file_all", "cat_file", batch=True)
777777
hexsha, typename, size = self.__get_object_header(cmd, ref)
778778
return (hexsha, typename, size, self.CatFileContentStream(size, cmd.stdout))

‎git/index/fun.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,10 @@ def entry_key(*entry):
166166
def read_cache(stream):
167167
"""Read a cache file from the given stream
168168
:return: tuple(version, entries_dict, extension_data, content_sha)
169-
* version is the integer version number
170-
* entries dict is a dictionary which maps IndexEntry instances to a path
171-
at a stage
172-
* extension_data is '' or 4 bytes of type + 4 bytes of size + size bytes
173-
* content_sha is a 20 byte sha on all cache file contents"""
169+
* version is the integer version number
170+
* entries dict is a dictionary which maps IndexEntry instances to a path at a stage
171+
* extension_data is '' or 4 bytes of type + 4 bytes of size + size bytes
172+
* content_sha is a 20 byte sha on all cache file contents"""
174173
version, num_entries = read_header(stream)
175174
count = 0
176175
entries = dict()

‎git/refs/head.py

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ class Head(Reference):
114114
@classmethod
115115
def delete(cls, repo, *heads, **kwargs):
116116
"""Delete the given heads
117+
117118
:param force:
118119
If True, the heads will be deleted even if they are not yet merged into
119120
the main development stream.

‎git/refs/remote.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def iter_items(cls, repo, common_path=None, remote=None):
2525

2626
@classmethod
2727
def delete(cls, repo, *refs, **kwargs):
28-
"""Delete the given remote references.
28+
"""Delete the given remote references
29+
2930
:note:
3031
kwargs are given for compatability with the base class method as we
3132
should not narrow the signature."""

‎git/remote.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,9 @@ def __hash__(self):
398398
return hash(self.name)
399399

400400
def exists(self):
401-
""":return: True if this is a valid, existing remote.
402-
Valid remotes have an entry in the repository's configuration"""
401+
"""
402+
:return: True if this is a valid, existing remote.
403+
Valid remotes have an entry in the repository's configuration"""
403404
try:
404405
self.config_reader.get('url')
405406
return True
@@ -429,7 +430,7 @@ def refs(self):
429430
:return:
430431
IterableList of RemoteReference objects. It is prefixed, allowing
431432
you to omit the remote path portion, i.e.::
432-
remote.refs.master # yields RemoteReference('/refs/remotes/origin/master')"""
433+
remote.refs.master # yields RemoteReference('/refs/remotes/origin/master')"""
433434
out_refs = IterableList(RemoteReference._id_attribute_, "%s/" % self.name)
434435
out_refs.extend(RemoteReference.list_items(self.repo, remote=self.name))
435436
assert out_refs, "Remote %s did not have any references" % self.name
@@ -463,11 +464,8 @@ def create(cls, repo, name, url, **kwargs):
463464
:param repo: Repository instance that is to receive the new remote
464465
:param name: Desired name of the remote
465466
:param url: URL which corresponds to the remote's name
466-
:param kwargs:
467-
Additional arguments to be passed to the git-remote add command
468-
467+
:param kwargs: Additional arguments to be passed to the git-remote add command
469468
:return: New Remote instance
470-
471469
:raise GitCommandError: in case an origin with that name already exists"""
472470
repo.git.remote("add", name, url, **kwargs)
473471
return cls(repo, name)

‎git/repo/base.py

+12-14
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ def iter_commits(self, rev=None, paths='', **kwargs):
461461
return Commit.iter_items(self, rev, paths, **kwargs)
462462

463463
def merge_base(self, *rev, **kwargs):
464-
"""Find the closest common ancestor for the given revision (e.g. Commits, Tags, References, etc).
464+
"""Find the closest common ancestor for the given revision (e.g. Commits, Tags, References, etc)
465+
465466
:param rev: At least two revs to find the common ancestor for.
466467
:param kwargs: Additional arguments to be passed to the repo.git.merge_base() command which does all the work.
467468
:return: A list of Commit objects. If --all was not specified as kwarg, the list will have at max one Commit,
@@ -814,16 +815,13 @@ def _clone(cls, git, url, path, odb_default_type, progress, **kwargs):
814815

815816
def clone(self, path, progress=None, **kwargs):
816817
"""Create a clone from this repository.
817-
:param path:
818-
is the full path of the new repo (traditionally ends with ./<name>.git).
819818
819+
:param path: is the full path of the new repo (traditionally ends with ./<name>.git).
820820
:param progress: See 'git.remote.Remote.push'.
821-
822821
:param kwargs:
823-
odbt = ObjectDatabase Type, allowing to determine the object database
824-
implementation used by the returned Repo instance
825-
826-
All remaining keyword arguments are given to the git-clone command
822+
* odbt = ObjectDatabase Type, allowing to determine the object database
823+
implementation used by the returned Repo instance
824+
* All remaining keyword arguments are given to the git-clone command
827825
828826
:return: ``git.Repo`` (the newly cloned repo)"""
829827
return self._clone(self.git, self.git_dir, path, type(self.odb), progress, **kwargs)
@@ -840,16 +838,16 @@ def clone_from(cls, url, to_path, progress=None, **kwargs):
840838

841839
def archive(self, ostream, treeish=None, prefix=None, **kwargs):
842840
"""Archive the tree at the given revision.
841+
843842
:parm ostream: file compatible stream object to which the archive will be written as bytes
844843
:parm treeish: is the treeish name/id, defaults to active branch
845844
:parm prefix: is the optional prefix to prepend to each filename in the archive
846-
:parm kwargs:
847-
Additional arguments passed to git-archive
848-
NOTE: Use the 'format' argument to define the kind of format. Use
849-
specialized ostreams to write any format supported by python.
845+
:parm kwargs: Additional arguments passed to git-archive
850846
851-
You may specify the special 'path' keyword, which may either be a repository-relative
852-
path to a directory or file to place into the archive, or a list or tuple of multipe paths.
847+
* Use the 'format' argument to define the kind of format. Use
848+
specialized ostreams to write any format supported by python.
849+
* You may specify the special **path** keyword, which may either be a repository-relative
850+
path to a directory or file to place into the archive, or a list or tuple of multipe paths.
853851
854852
:raise GitCommandError: in case something went wrong
855853
:return: self"""

‎git/util.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
def rmtree(path):
4242
"""Remove the given recursively.
43+
4344
:note: we use shutil rmtree but adjust its behaviour to see whether files that
4445
couldn't be deleted are read-only. Windows will not remove them in that case"""
4546
def onerror(func, path, exc_info):
@@ -251,8 +252,10 @@ def _parse_progress_line(self, line):
251252
return failed_lines
252253

253254
def new_message_handler(self):
254-
""":return: a progress handler suitable for handle_process_output(), passing lines on to this Progress
255-
handler in a suitable format"""
255+
"""
256+
:return:
257+
a progress handler suitable for handle_process_output(), passing lines on to this Progress
258+
handler in a suitable format"""
256259
def handler(line):
257260
return self._parse_progress_line(line.rstrip())
258261
# end

0 commit comments

Comments
 (0)