gitclone: refuse deleting a working copy with local commits or changes (test).

parent 3053f0f3
......@@ -205,6 +205,22 @@ and branch parameter is ignored::
>>> print system('git branch')
* master
Setup a "develop" repository
----------------------------
If you need to setup a repository that will be manually alterated over time for
development purposes, you need to make sure buildout will NOT alter it and NOT
erase your local modifications by specifying the "develop" flag::
[buildout]
parts = git-clone
[git-clone]
recipe = slapos.recipe.build:gitclone
repository = https://example.net/example.git/
develop = true
Specific git binary
-------------------
......@@ -212,13 +228,61 @@ The default git command is `git`, if for a any reason you don't
have git in your path, you can specify git binary path with `git-command`
option::
[buildout]
parts = git-clone
>>> cd(sample_buildout)
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = git-clone
...
... [git-clone]
... recipe = slapos.recipe.build:gitclone
... repository = http://git.erp5.org/repos/slapos.recipe.build.git
... develop = true
... """)
[git-clone]
recipe = slapos.recipe.build:gitclone
repository = http://example.net/example.git/
git-executable = /usr/local/git/bin/git
>>> print system(buildout)
Uninstalling git-clone.
Running uninstall recipe.
Installing git-clone.
Cloning into '/sample-buildout/parts/git-clone'...
Buildout will then keep local modifications, instead of resetting the
repository::
>>> cd(sample_buildout, 'parts', 'git-clone')
>>> print system('echo foo > setup.py')
>>> cd(sample_buildout)
>>> print system(buildout)
Updating git-clone.
Fetching origin
>>> cd(sample_buildout, 'parts', 'git-clone')
>>> print system('cat setup.py')
foo
In case of uninstall, buildout will keep the repository directory::
>>> cd(sample_buildout)
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = git-clone
...
... [git-clone]
... recipe = slapos.recipe.build:gitclone
... repository = http://git.erp5.org/repos/slapos.recipe.build.git
... develop = true
... # Triggers uninstall/install because of section signature change
... foo = bar
... """)
>>> print system(buildout)
Uninstalling git-clone.
Running uninstall recipe.
You have uncommited changes in /sample-buildout/parts/git-clone. This folder will be left as is.
Installing git-clone.
destination directory already exists.
Ignore SSL certificate
----------------------
......@@ -236,7 +300,6 @@ boolean option::
repository = https://example.net/example.git/
ignore-ssl-certificate = true
Full example
------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment