Preserve uncommitted changes.
This commit is contained in:
parent
043c93abcf
commit
348d623b07
|
@ -8,7 +8,7 @@ TripleO (or other gerrit based projects).
|
|||
- some example inputs for doing rack testing of tripleo in the rack-testing
|
||||
subdir
|
||||
|
||||
To use:
|
||||
## Usage
|
||||
|
||||
* create a repo_refs.yaml in your TRIPLEO_ROOT (see the one in the root of this
|
||||
repository for inspiration).
|
||||
|
@ -18,7 +18,10 @@ To use:
|
|||
|
||||
* run prep_source_repos $YOUR\_REFS\_FILE $TRIPLEO\_ROOT to checkout and update
|
||||
the repositories specified by the refs file. Note that local edits are saved
|
||||
via git stash whenever you refresh your source repos.
|
||||
via git stash whenever you refresh your source repos, and restored after the
|
||||
update (which may, of course, fail). This provides a convenient way to use
|
||||
local edits / work in progress for repositories that are used directly (vs
|
||||
e.g. those that are cloned into images).
|
||||
|
||||
* source YOUR_REFS_FILE.variables to configure TripleO scripts to use your
|
||||
freshly integrated branches
|
|
@ -81,7 +81,9 @@ def main():
|
|||
else:
|
||||
components.append(ref)
|
||||
branch_name = 'rollup_' + '_'.join(components)
|
||||
check_call(['git', 'stash'], cwd=rd)
|
||||
dirty = check_output(['git', 'status', '-z', '-uno'], cwd=rd)
|
||||
if dirty:
|
||||
check_call(['git', 'stash'], cwd=rd)
|
||||
branches = check_output(['git', 'branch', '-a'], cwd=rd)
|
||||
if ' ' + branch_name in branches:
|
||||
print 'Resetting existing branch %s...' % branch_name
|
||||
|
@ -93,6 +95,8 @@ def main():
|
|||
if len(ref.split('/')) == 3:
|
||||
ref = 'refs/changes/%s' % ref
|
||||
check_call(['git', 'merge', '--no-edit', ref], cwd=rd)
|
||||
if dirty:
|
||||
check_call(['git', 'stash', 'pop'], cwd=rd)
|
||||
normalised_repo = re.sub('[^A-Za-z0-9_]', '_', repo)
|
||||
if repo not in CONF['gerrit_refs']:
|
||||
print 'no refs for %s' % repo
|
||||
|
|
Loading…
Reference in New Issue