diff options
-rw-r--r-- | git/cmd.py | 6 | ||||
-rw-r--r-- | git/index/fun.py | 9 | ||||
-rw-r--r-- | git/refs/head.py | 1 | ||||
-rw-r--r-- | git/refs/remote.py | 3 | ||||
-rw-r--r-- | git/remote.py | 12 | ||||
-rw-r--r-- | git/repo/base.py | 26 | ||||
-rw-r--r-- | git/util.py | 7 |
7 files changed, 32 insertions, 32 deletions
@@ -769,10 +769,10 @@ class Git(LazyMixin): return (hexsha, typename, size, data) def stream_object_data(self, ref): - """As get_object_header, but returns the data as a stream + """ As get_object_header, but returns the data as a stream + :return: (hexsha, type_string, size_as_int, stream) - :note: This method is not threadsafe, you need one independent Command instance - per thread to be safe !""" + :note: This method is not threadsafe, you need one independent Command instance per thread to be safe !""" cmd = self._get_persistent_cmd("cat_file_all", "cat_file", batch=True) hexsha, typename, size = self.__get_object_header(cmd, ref) return (hexsha, typename, size, self.CatFileContentStream(size, cmd.stdout)) diff --git a/git/index/fun.py b/git/index/fun.py index 38ad843b..f07cf7dc 100644 --- a/git/index/fun.py +++ b/git/index/fun.py @@ -166,11 +166,10 @@ def entry_key(*entry): def read_cache(stream): """Read a cache file from the given stream :return: tuple(version, entries_dict, extension_data, content_sha) - * version is the integer version number - * entries dict is a dictionary which maps IndexEntry instances to a path - at a stage - * extension_data is '' or 4 bytes of type + 4 bytes of size + size bytes - * content_sha is a 20 byte sha on all cache file contents""" + * version is the integer version number + * entries dict is a dictionary which maps IndexEntry instances to a path at a stage + * extension_data is '' or 4 bytes of type + 4 bytes of size + size bytes + * content_sha is a 20 byte sha on all cache file contents""" version, num_entries = read_header(stream) count = 0 entries = dict() diff --git a/git/refs/head.py b/git/refs/head.py index 750d15b6..18dac349 100644 --- a/git/refs/head.py +++ b/git/refs/head.py @@ -114,6 +114,7 @@ class Head(Reference): @classmethod def delete(cls, repo, *heads, **kwargs): """Delete the given heads + :param force: If True, the heads will be deleted even if they are not yet merged into the main development stream. diff --git a/git/refs/remote.py b/git/refs/remote.py index b692e6df..1f256b75 100644 --- a/git/refs/remote.py +++ b/git/refs/remote.py @@ -25,7 +25,8 @@ class RemoteReference(Head): @classmethod def delete(cls, repo, *refs, **kwargs): - """Delete the given remote references. + """Delete the given remote references + :note: kwargs are given for compatability with the base class method as we should not narrow the signature.""" diff --git a/git/remote.py b/git/remote.py index 746a7819..541f3c9e 100644 --- a/git/remote.py +++ b/git/remote.py @@ -398,8 +398,9 @@ class Remote(LazyMixin, Iterable): return hash(self.name) def exists(self): - """:return: True if this is a valid, existing remote. - Valid remotes have an entry in the repository's configuration""" + """ + :return: True if this is a valid, existing remote. + Valid remotes have an entry in the repository's configuration""" try: self.config_reader.get('url') return True @@ -429,7 +430,7 @@ class Remote(LazyMixin, Iterable): :return: 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')""" + remote.refs.master # yields RemoteReference('/refs/remotes/origin/master')""" out_refs = IterableList(RemoteReference._id_attribute_, "%s/" % self.name) out_refs.extend(RemoteReference.list_items(self.repo, remote=self.name)) assert out_refs, "Remote %s did not have any references" % self.name @@ -463,11 +464,8 @@ class Remote(LazyMixin, Iterable): :param repo: Repository instance that is to receive the new remote :param name: Desired name of the remote :param url: URL which corresponds to the remote's name - :param kwargs: - Additional arguments to be passed to the git-remote add command - + :param kwargs: Additional arguments to be passed to the git-remote add command :return: New Remote instance - :raise GitCommandError: in case an origin with that name already exists""" repo.git.remote("add", name, url, **kwargs) return cls(repo, name) diff --git a/git/repo/base.py b/git/repo/base.py index afff9471..6d9af6d4 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -461,7 +461,8 @@ class Repo(object): return Commit.iter_items(self, rev, paths, **kwargs) def merge_base(self, *rev, **kwargs): - """Find the closest common ancestor for the given revision (e.g. Commits, Tags, References, etc). + """Find the closest common ancestor for the given revision (e.g. Commits, Tags, References, etc) + :param rev: At least two revs to find the common ancestor for. :param kwargs: Additional arguments to be passed to the repo.git.merge_base() command which does all the work. :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 @@ class Repo(object): def clone(self, path, progress=None, **kwargs): """Create a clone from this repository. - :param path: - is the full path of the new repo (traditionally ends with ./<name>.git). + :param path: is the full path of the new repo (traditionally ends with ./<name>.git). :param progress: See 'git.remote.Remote.push'. - :param kwargs: - odbt = ObjectDatabase Type, allowing to determine the object database - implementation used by the returned Repo instance - - All remaining keyword arguments are given to the git-clone command + * odbt = ObjectDatabase Type, allowing to determine the object database + implementation used by the returned Repo instance + * All remaining keyword arguments are given to the git-clone command :return: ``git.Repo`` (the newly cloned repo)""" return self._clone(self.git, self.git_dir, path, type(self.odb), progress, **kwargs) @@ -840,16 +838,16 @@ class Repo(object): def archive(self, ostream, treeish=None, prefix=None, **kwargs): """Archive the tree at the given revision. + :parm ostream: file compatible stream object to which the archive will be written as bytes :parm treeish: is the treeish name/id, defaults to active branch :parm prefix: is the optional prefix to prepend to each filename in the archive - :parm kwargs: - Additional arguments passed to git-archive - NOTE: Use the 'format' argument to define the kind of format. Use - specialized ostreams to write any format supported by python. + :parm kwargs: Additional arguments passed to git-archive - You may specify the special 'path' keyword, which may either be a repository-relative - path to a directory or file to place into the archive, or a list or tuple of multipe paths. + * Use the 'format' argument to define the kind of format. Use + specialized ostreams to write any format supported by python. + * You may specify the special **path** keyword, which may either be a repository-relative + path to a directory or file to place into the archive, or a list or tuple of multipe paths. :raise GitCommandError: in case something went wrong :return: self""" diff --git a/git/util.py b/git/util.py index b1f3b38d..010130cb 100644 --- a/git/util.py +++ b/git/util.py @@ -40,6 +40,7 @@ __all__ = ("stream_copy", "join_path", "to_native_path_windows", "to_native_path def rmtree(path): """Remove the given recursively. + :note: we use shutil rmtree but adjust its behaviour to see whether files that couldn't be deleted are read-only. Windows will not remove them in that case""" def onerror(func, path, exc_info): @@ -251,8 +252,10 @@ class RemoteProgress(object): return failed_lines def new_message_handler(self): - """:return: a progress handler suitable for handle_process_output(), passing lines on to this Progress - handler in a suitable format""" + """ + :return: + a progress handler suitable for handle_process_output(), passing lines on to this Progress + handler in a suitable format""" def handler(line): return self._parse_progress_line(line.rstrip()) # end |