self._check_repo_status(os.path.dirname(recipefile), expected_status)
result = runCmd(cleanup_cmd)
self._check_repo_status(os.path.dirname(recipefile), [])
+ # Now try the same passing --initial-rev: the recorded initial
+ # revision must give the same result as not passing the option, and a
+ # later revision must export only the commits after it
+ result = runCmd('git rev-parse devtool-base', cwd=tempdir)
+ initial_rev = result.output.strip()
+ result = runCmd('devtool update-recipe --initial-rev %s %s' % (initial_rev, testrecipe))
+ result = runCmd('git add minicom', cwd=os.path.dirname(recipefile))
+ expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
+ ('A ', '.*/0001-Change-the-README.patch$'),
+ ('A ', '.*/0002-Add-a-new-file.patch$')]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+ result = runCmd(cleanup_cmd)
+ self._check_repo_status(os.path.dirname(recipefile), [])
+ result = runCmd('git rev-parse HEAD~1', cwd=tempdir)
+ midpoint_rev = result.output.strip()
+ result = runCmd('devtool update-recipe --initial-rev %s %s' % (midpoint_rev, testrecipe))
+ result = runCmd('git add minicom', cwd=os.path.dirname(recipefile))
+ expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
+ ('A ', '.*/0001-Add-a-new-file.patch$')]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+ result = runCmd(cleanup_cmd)
+ self._check_repo_status(os.path.dirname(recipefile), [])
def test_devtool_update_recipe_git(self):
# Check preconditions