| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 53e5fb3 commit 6569c48
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -769,10 +769,10 @@ def get_object_data(self, ref): | |||
| 769 | 769 | return (hexsha, typename, size, data) | |
| 770 | 770 | ||
| 771 | 771 | 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 | + | ||
| 773 | 774 | :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 !""" | ||
| 776 | 776 | cmd = self._get_persistent_cmd("cat_file_all", "cat_file", batch=True) | |
| 777 | 777 | hexsha, typename, size = self.__get_object_header(cmd, ref) | |
| 778 | 778 | return (hexsha, typename, size, self.CatFileContentStream(size, cmd.stdout)) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -166,11 +166,10 @@ def entry_key(*entry): | |||
| 166 | 166 | def read_cache(stream): | |
| 167 | 167 | """Read a cache file from the given stream | |
| 168 | 168 | :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""" | ||
| 174 | 173 | version, num_entries = read_header(stream) | |
| 175 | 174 | count = 0 | |
| 176 | 175 | entries = dict() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -114,6 +114,7 @@ class Head(Reference): | |||
| 114 | 114 | @classmethod | |
| 115 | 115 | def delete(cls, repo, *heads, **kwargs): | |
| 116 | 116 | """Delete the given heads | |
| 117 | + | ||
| 117 | 118 | :param force: | |
| 118 | 119 | If True, the heads will be deleted even if they are not yet merged into | |
| 119 | 120 | the main development stream. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,8 @@ def iter_items(cls, repo, common_path=None, remote=None): | |||
| 25 | 25 | ||
| 26 | 26 | @classmethod | |
| 27 | 27 | def delete(cls, repo, *refs, **kwargs): | |
| 28 | - """Delete the given remote references. | ||
| 28 | + """Delete the given remote references | ||
| 29 | + | ||
| 29 | 30 | :note: | |
| 30 | 31 | kwargs are given for compatability with the base class method as we | |
| 31 | 32 | should not narrow the signature.""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -398,8 +398,9 @@ def __hash__(self): | |||
| 398 | 398 | return hash(self.name) | |
| 399 | 399 | ||
| 400 | 400 | 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""" | ||
| 403 | 404 | try: | |
| 404 | 405 | self.config_reader.get('url') | |
| 405 | 406 | return True | |
@@ -429,7 +430,7 @@ def refs(self): | |||
| 429 | 430 | :return: | |
| 430 | 431 | IterableList of RemoteReference objects. It is prefixed, allowing | |
| 431 | 432 | 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')""" | ||
| 433 | 434 | out_refs = IterableList(RemoteReference._id_attribute_, "%s/" % self.name) | |
| 434 | 435 | out_refs.extend(RemoteReference.list_items(self.repo, remote=self.name)) | |
| 435 | 436 | assert out_refs, "Remote %s did not have any references" % self.name | |
@@ -463,11 +464,8 @@ def create(cls, repo, name, url, **kwargs): | |||
| 463 | 464 | :param repo: Repository instance that is to receive the new remote | |
| 464 | 465 | :param name: Desired name of the remote | |
| 465 | 466 | :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 | ||
| 469 | 468 | :return: New Remote instance | |
| 470 | - | ||
| 471 | 469 | :raise GitCommandError: in case an origin with that name already exists""" | |
| 472 | 470 | repo.git.remote("add", name, url, **kwargs) | |
| 473 | 471 | return cls(repo, name) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -461,7 +461,8 @@ def iter_commits(self, rev=None, paths='', **kwargs): | |||
| 461 | 461 | return Commit.iter_items(self, rev, paths, **kwargs) | |
| 462 | 462 | ||
| 463 | 463 | 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 | + | ||
| 465 | 466 | :param rev: At least two revs to find the common ancestor for. | |
| 466 | 467 | :param kwargs: Additional arguments to be passed to the repo.git.merge_base() command which does all the work. | |
| 467 | 468 | :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): | |||
| 814 | 815 | ||
| 815 | 816 | def clone(self, path, progress=None, **kwargs): | |
| 816 | 817 | """Create a clone from this repository. | |
| 817 | - :param path: | ||
| 818 | - is the full path of the new repo (traditionally ends with ./<name>.git). | ||
| 819 | 818 | ||
| 819 | + :param path: is the full path of the new repo (traditionally ends with ./<name>.git). | ||
| 820 | 820 | :param progress: See 'git.remote.Remote.push'. | |
| 821 | - | ||
| 822 | 821 | :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 | ||
| 827 | 825 | ||
| 828 | 826 | :return: ``git.Repo`` (the newly cloned repo)""" | |
| 829 | 827 | 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): | |||
| 840 | 838 | ||
| 841 | 839 | def archive(self, ostream, treeish=None, prefix=None, **kwargs): | |
| 842 | 840 | """Archive the tree at the given revision. | |
| 841 | + | ||
| 843 | 842 | :parm ostream: file compatible stream object to which the archive will be written as bytes | |
| 844 | 843 | :parm treeish: is the treeish name/id, defaults to active branch | |
| 845 | 844 | :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 | ||
| 850 | 846 | ||
| 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. | ||
| 853 | 851 | ||
| 854 | 852 | :raise GitCommandError: in case something went wrong | |
| 855 | 853 | :return: self""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,6 +40,7 @@ | |||
| 40 | 40 | ||
| 41 | 41 | def rmtree(path): | |
| 42 | 42 | """Remove the given recursively. | |
| 43 | + | ||
| 43 | 44 | :note: we use shutil rmtree but adjust its behaviour to see whether files that | |
| 44 | 45 | couldn't be deleted are read-only. Windows will not remove them in that case""" | |
| 45 | 46 | def onerror(func, path, exc_info): | |
@@ -251,8 +252,10 @@ def _parse_progress_line(self, line): | |||
| 251 | 252 | return failed_lines | |
| 252 | 253 | ||
| 253 | 254 | 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""" | ||
| 256 | 259 | def handler(line): | |
| 257 | 260 | return self._parse_progress_line(line.rstrip()) | |
| 258 | 261 | # end | |
| Back | FazBrowse Home | New Git URL |
0 commit comments