From 762d8fb447b79db7373e296e6c60c7b57d27c090 Mon Sep 17 00:00:00 2001 From: Kian Cross Date: Mon, 13 Jul 2020 04:35:33 +0100 Subject: Fixed broken file paths. --- doc/source/tutorial.rst | 96 ++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst index a96d0d99..d548f882 100644 --- a/doc/source/tutorial.rst +++ b/doc/source/tutorial.rst @@ -10,14 +10,14 @@ GitPython Tutorial GitPython provides object model access to your git repository. This tutorial is composed of multiple sections, most of which explains a real-life usecase. -All code presented here originated from `test_docs.py `_ to assure correctness. Knowing this should also allow you to more easily run the code for your own testing purposes, all you need is a developer installation of git-python. +All code presented here originated from `test_docs.py `_ to assure correctness. Knowing this should also allow you to more easily run the code for your own testing purposes, all you need is a developer installation of git-python. Meet the Repo type ****************** The first step is to create a :class:`git.Repo ` object to represent your repository. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [1-test_init_repo_object] @@ -25,7 +25,7 @@ The first step is to create a :class:`git.Repo ` object to r In the above example, the directory ``self.rorepo.working_tree_dir`` equals ``/Users/mtrier/Development/git-python`` and is my working repository which contains the ``.git`` directory. You can also initialize GitPython with a *bare* repository. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [2-test_init_repo_object] @@ -33,7 +33,7 @@ In the above example, the directory ``self.rorepo.working_tree_dir`` equals ``/U A repo object provides high-level access to your data, it allows you to create and delete heads, tags and remotes and access the configuration of the repository. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [3-test_init_repo_object] @@ -41,7 +41,7 @@ A repo object provides high-level access to your data, it allows you to create a Query the active branch, query untracked files or whether the repository data has been modified. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [4-test_init_repo_object] @@ -49,7 +49,7 @@ Query the active branch, query untracked files or whether the repository data ha Clone from existing repositories or initialize new empty ones. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [5-test_init_repo_object] @@ -57,7 +57,7 @@ Clone from existing repositories or initialize new empty ones. Archive the repository contents to a tar file. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [6-test_init_repo_object] @@ -70,7 +70,7 @@ And of course, there is much more you can do with this type, most of the followi Query relevant repository paths ... -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [7-test_init_repo_object] @@ -78,7 +78,7 @@ Query relevant repository paths ... :class:`Heads ` Heads are branches in git-speak. :class:`References ` are pointers to a specific commit or to other references. Heads and :class:`Tags ` are a kind of references. GitPython allows you to query them rather intuitively. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [8-test_init_repo_object] @@ -86,7 +86,7 @@ Query relevant repository paths ... You can also create new heads ... -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [9-test_init_repo_object] @@ -94,7 +94,7 @@ You can also create new heads ... ... and tags ... -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [10-test_init_repo_object] @@ -102,7 +102,7 @@ You can also create new heads ... You can traverse down to :class:`git objects ` through references and other objects. Some objects like :class:`commits ` have additional meta-data to query. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [11-test_init_repo_object] @@ -110,7 +110,7 @@ You can traverse down to :class:`git objects ` through :class:`Remotes ` allow to handle fetch, pull and push operations, while providing optional real-time progress information to :class:`progress delegates `. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [12-test_init_repo_object] @@ -118,7 +118,7 @@ You can traverse down to :class:`git objects ` through The :class:`index ` is also called stage in git-speak. It is used to prepare new commits, and can be used to keep results of merge operations. Our index implementation allows to stream date into the index, which is useful for bare repositories that do not have a working tree. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [13-test_init_repo_object] @@ -126,7 +126,7 @@ The :class:`index ` is also called stage in git-speak. :class:`Submodules ` represent all aspects of git submodules, which allows you query all of their related information, and manipulate in various ways. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [14-test_init_repo_object] @@ -138,7 +138,7 @@ Examining References :class:`References ` are the tips of your commit graph from which you can easily examine the history of your project. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [1-test_references_and_objects] @@ -146,7 +146,7 @@ Examining References :class:`Tags ` are (usually immutable) references to a commit and/or a tag object. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [2-test_references_and_objects] @@ -154,7 +154,7 @@ Examining References A :class:`symbolic reference ` is a special case of a reference as it points to another reference instead of a commit. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [3-test_references_and_objects] @@ -162,7 +162,7 @@ A :class:`symbolic reference ` is a special Access the :class:`reflog ` easily. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [4-test_references_and_objects] @@ -172,7 +172,7 @@ Modifying References ******************** You can easily create and delete :class:`reference types ` or modify where they point to. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [5-test_references_and_objects] @@ -180,7 +180,7 @@ You can easily create and delete :class:`reference types ` the same way except you may not change them afterwards. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [6-test_references_and_objects] @@ -188,7 +188,7 @@ Create or delete :class:`tags ` the same way except y Change the :class:`symbolic reference ` to switch branches cheaply (without adjusting the index or the working tree). -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [7-test_references_and_objects] @@ -202,7 +202,7 @@ Git only knows 4 distinct object types being :class:`Blobs ` are objects that can be put into git's index. These objects are trees, blobs and submodules which additionally know about their path in the file system as well as their mode. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [10-test_references_and_objects] @@ -226,7 +226,7 @@ Common fields are ... Access :class:`blob ` data (or any object data) using streams. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [11-test_references_and_objects] @@ -240,7 +240,7 @@ The Commit object Obtain commits at the specified revision -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [12-test_references_and_objects] @@ -248,7 +248,7 @@ Obtain commits at the specified revision Iterate 50 commits, and if you need paging, you can specify a number of commits to skip. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [13-test_references_and_objects] @@ -256,7 +256,7 @@ Iterate 50 commits, and if you need paging, you can specify a number of commits A commit object carries all sorts of meta-data -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [14-test_references_and_objects] @@ -264,7 +264,7 @@ A commit object carries all sorts of meta-data Note: date time is represented in a ``seconds since epoch`` format. Conversion to human readable form can be accomplished with the various `time module `_ methods. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [15-test_references_and_objects] @@ -272,7 +272,7 @@ Note: date time is represented in a ``seconds since epoch`` format. Conversion t You can traverse a commit's ancestry by chaining calls to ``parents`` -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [16-test_references_and_objects] @@ -285,7 +285,7 @@ The Tree object A :class:`tree ` records pointers to the contents of a directory. Let's say you want the root tree of the latest commit on the master branch -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [17-test_references_and_objects] @@ -293,7 +293,7 @@ A :class:`tree ` records pointers to the contents of a di Once you have a tree, you can get its contents -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [18-test_references_and_objects] @@ -301,7 +301,7 @@ Once you have a tree, you can get its contents It is useful to know that a tree behaves like a list with the ability to query entries by name -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [19-test_references_and_objects] @@ -309,7 +309,7 @@ It is useful to know that a tree behaves like a list with the ability to query e There is a convenience method that allows you to get a named sub-object from a tree with a syntax similar to how paths are written in a posix system -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [20-test_references_and_objects] @@ -317,7 +317,7 @@ There is a convenience method that allows you to get a named sub-object from a t You can also get a commit's root tree directly from the repository -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [21-test_references_and_objects] @@ -325,7 +325,7 @@ You can also get a commit's root tree directly from the repository As trees allow direct access to their intermediate child entries only, use the traverse method to obtain an iterator to retrieve entries recursively -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [22-test_references_and_objects] @@ -338,7 +338,7 @@ The Index Object The git index is the stage containing changes to be written with the next commit or where merges finally have to take place. You may freely access and manipulate this information using the :class:`IndexFile ` object. Modify the index with ease -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [23-test_references_and_objects] @@ -346,7 +346,7 @@ Modify the index with ease Create new indices from other trees or as result of a merge. Write that result to a new index file for later inspection. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [24-test_references_and_objects] @@ -357,7 +357,7 @@ Handling Remotes :class:`Remotes ` are used as alias for a foreign repository to ease pushing to and fetching from them -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [25-test_references_and_objects] @@ -365,7 +365,7 @@ Handling Remotes You can easily access configuration information for a remote by accessing options as if they where attributes. The modification of remote configuration is more explicit though. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [26-test_references_and_objects] @@ -399,7 +399,7 @@ Submodule Handling ****************** :class:`Submodules ` can be conveniently handled using the methods provided by GitPython, and as an added benefit, GitPython provides functionality which behave smarter and less error prone than its original c-git implementation, that is GitPython tries hard to keep your repository consistent when updating submodules recursively or adjusting the existing configuration. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [1-test_submodules] @@ -424,7 +424,7 @@ Diffs can generally be obtained by subclasses of :class:`Diffable ` command directly. It is owned by each repository instance. -.. literalinclude:: ../../git/test/test_docs.py +.. literalinclude:: ../../test/test_docs.py :language: python :dedent: 8 :start-after: # [31-test_references_and_objects] -- cgit v1.2.1