vcs.py
Utilities related to VCS.
checkout_latest_tag(local_repo, use_prereleases=False)
¶
Checkout latest git tag and check it out, sorted by PEP 440.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
local_repo |
StrOrPath
|
A git repository in the local filesystem. |
required |
use_prereleases |
OptBool
|
If |
False
|
Source code in copier/vcs.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
clone(url, ref=None)
¶
Clone repo into some temporary destination.
Includes dirty changes for local templates by copying into a temp directory and applying a wip commit there.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
Git-parseable URL of the repo. As returned by get_repo. |
required |
ref |
OptStr
|
Reference to checkout. For Git repos, defaults to |
None
|
Source code in copier/vcs.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|
get_git(context_dir=None)
¶
Gets git
command, or fails if it's not available.
Source code in copier/vcs.py
19 20 21 22 23 24 |
|
get_git_version()
¶
Get the installed git version.
Source code in copier/vcs.py
27 28 29 30 31 |
|
get_repo(url)
¶
Transform url
into a git-parseable origin URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
Valid examples:
|
required |
Source code in copier/vcs.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
is_git_bundle(path)
¶
Indicate if a path is a valid git bundle.
Source code in copier/vcs.py
73 74 75 76 77 78 79 80 |
|
is_git_repo_root(path)
¶
Indicate if a given path is a git repo root directory.
Source code in copier/vcs.py
44 45 46 47 48 49 50 |
|
is_git_shallow_repo(path)
¶
Indicate if a given path is a git shallow repo directory.
Source code in copier/vcs.py
62 63 64 65 66 67 68 69 70 |
|
is_in_git_repo(path)
¶
Indicate if a given path is in a git repo directory.
Source code in copier/vcs.py
53 54 55 56 57 58 59 |
|
valid_version(version_)
¶
Tell if a string is a valid PEP 440 version specifier.
Source code in copier/vcs.py
212 213 214 215 216 217 218 219 220 221 |
|