From 2b5c97328b4b24ff129966b8ee33cac07c560cc1 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sun, 22 May 2011 11:45:27 +0100 Subject: [PATCH] prepare-pristine: stage deleted files too, and update upgrade docs. Signed-off-by: Edward Z. Yang --- doc/upgrade.rst | 43 +++++++++++++++++++++--------- wizard/command/prepare_pristine.py | 4 +++ 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/doc/upgrade.rst b/doc/upgrade.rst index 259577d..5768c96 100644 --- a/doc/upgrade.rst +++ b/doc/upgrade.rst @@ -25,7 +25,7 @@ First you prepare the pristine copy:: git checkout pristine wizard prepare-pristine $APP-$VERSION - git commit -asm "$APPLICATION $VERSION" + git commit -sm "$APPLICATION $VERSION" git tag $APP-$VERSION Next, you merge those changes to the scriptsified ``master`` copy:: @@ -33,35 +33,52 @@ Next, you merge those changes to the scriptsified ``master`` copy:: git checkout master git merge pristine --no-commit # resolve conflicts - git commit -asm "$APPLICATION $VERSION-scripts" + git commit -sm "$APPLICATION $VERSION-scripts" .. note:: If you are creating a fix for a previous scripts version, you should bump the version to ``$VERSION-scripts2``. -Then, on a scripts server with Wizard pointed at the latest version, run:: +If the files associated with installation (for example, the install +script) have changed, we need to double check that the configuration +files are in order. On a scripts server with Wizard pointed at the +latest version, run:: cd tests - env WIZARD_NO_COMMIT=1 ./test-install-$APP.sh - cd testdir_install_$APP_head + env WIZARD_NO_COMMIT=1 ./$APP-install-test.sh + cd testdir_$APP_install_head wizard prepare-config -With any luck, there will be no differences; if there are -manually restore any custom changes we may have made to the configuration -file, make sure that no upstream changes broke our regular expressions -for matching. Then amend your commit and push back:: +With any luck, there will be no differences. However, if there are +changes, manually restore any custom changes we may have made to the +configuration file (a ``git checkout -p`` should allow you to +selectively back out the relevant bits). Furthermore, make sure that no +upstream changes broke our regular expressions for matching. The merge +your changes back (preferably via your local machine, since you probably +don't have appropriate author credentials setup to be accessible +on Scripts):: git commit --amend -a git tag $APP-$VERSION-scripts git push --force git push --force --tags -On any other copies that have the older commit, run the following commands -while on the ``master`` branch to grab the new version:: +.. note:: - git fetch --tags $REMOTE - git reset --hard $REMOTE/master + If you have a split AFS and local Wizard setup, you may prefer to + instead create a dummy commit and do the merging in your local copy. + The flow looks like:: + + # from the scripts copy + git commit -asm "Dummy" + git push + # from your copy + git pull + git reset HEAD~ + git commit --amend -a + git tag $APP-$VERSION-scripts + git push -f Be sure to verify that your commit is the correct one; you can check with ``git show``, which should show the changes you made when amending the diff --git a/wizard/command/prepare_pristine.py b/wizard/command/prepare_pristine.py index b628a42..d4c9233 100644 --- a/wizard/command/prepare_pristine.py +++ b/wizard/command/prepare_pristine.py @@ -33,7 +33,11 @@ def main(argv, baton): if "/.git" in dirpath: continue if not filenames and not dirnames: open(os.path.join(dirpath, ".preserve-dir"), "w").write("") + # stage all changes shell.call("git", "add", ".") + for f in shell.call("git", "ls-files", "-d", "-z")[0].split("\0"): + if f != "": + shell.call("git", "rm", "--", f) def parse_args(argv, baton): usage = """usage: %prog prepare-pristine APP-VERSION -- 2.44.0