polishing.
diff --git a/Readme.org b/Readme.org --- a/Readme.org +++ b/Readme.org @@ -14,8 +14,11 @@ This test uses the mutable-hg extension :noweb: yes :END: -#+BEGIN_SRC sh :shebang #!/bin/sh :exports both :results output verbatim +#+BEGIN_SRC sh :shebang #!/bin/sh :exports both :results output verbatim :session test-hg-evolve # Tests for refactoring history with the evolve extension +export LANG=C # to get rid of localized strings +export PS1="$ " +rm -r testmy testother testpublic #+END_SRC ** Init @@ -24,7 +27,7 @@ This test uses the mutable-hg extension We have one public repo and 2 nonpublishing repos. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve # Initialize the test repo hg init testpublic # a public repo hg init testmy # my repo @@ -44,7 +47,7 @@ done /Prepare the content of the repos./ -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy echo "Hello World" > hello.txt hg ci -Am "Hello World" @@ -56,15 +59,17 @@ cd .. /Add a bad change and amend it./ -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy sed -i s/World/Evoluton/ hello.txt hg ci -m "Hello Evolution" +echo hg log -G cat hello.txt -echo FIX this up +# FIX this up sed -i s/Evoluton/Evolution/ hello.txt hg amend -m "Hello Evolution" # pass the message explicitely again to avoid having the editor pop up +echo hg log -G cd .. #+END_SRC @@ -79,7 +84,7 @@ Now we change the format to planning a r First I do my own change. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy # Now we add the bad change echo "Wishes: @@ -89,6 +94,7 @@ echo "Wishes: " >> plan.txt hg ci -Am "What the players want" # show what we did +echo hg log -G -r tip # and the good change echo "Places: @@ -96,7 +102,8 @@ echo "Places: - The researchers cave " >> plan.txt hg ci -m "The places" -hg log -G +echo +hg log -G -r 1: cd .. #+END_SRC @@ -104,23 +111,24 @@ No my file contains the wishes of the pl Now we pull the changes into the repo of another game master with whom we plan this game. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve hg -R testother pull -u testmy -hg log -G +hg -R testother log -G -r 1: #+END_SRC /note: the revisions numbers are different because the other repo only gets those obsolete revisions which are ancestors to non-obsolete revisions. That way evolve slowly cleans out obsolete revisions from the history without breaking repositories which already have them (but giving them a clear and easy path for evolution)./ He then adds the important people: -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testother echo "People: - The Lost - The Specter " >> plan.txt hg ci -m "The people" -hg log -G +echo +hg log -G -r 1: cd .. #+END_SRC @@ -128,12 +136,12 @@ cd .. And I realize too late, that my estimate of the wishes of the players was wrong. So I simply amend it. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy hg up -r -2 sed -i "s/The Solek wants Action/The Solek wants emotionally intense situations/" plan.txt hg amend -m "The wishes of the players" -hg log -G +hg log -G -r 1: cd .. #+END_SRC @@ -141,10 +149,10 @@ Now I amended my commit, but my history Changeset evolution allows us to evolve our repository to get rid of dependencies on obsolete changes. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy hg evolve -hg log -G +hg log -G -r 1: cd .. #+END_SRC @@ -154,14 +162,14 @@ Now I have nice looking history without But I rewrote history. What happens if my collegue pulls this? -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve hg -R testother pull testmy hg -R testother log -G #+END_SRC As you can see, he is told that his changes became unstable, since they depend on obsolete history. No need to panic: He can just evolve his repo to be state of the art again. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve hg -R testother evolve #+END_SRC @@ -169,7 +177,7 @@ But the unstable change is the current w /note: that message might be a candidate for cleanup./ -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve hg -R testother evolve --any hg -R testother log -G #+END_SRC @@ -182,7 +190,7 @@ And as you can see, everything looks nic Now I go into a bit of a planning spree. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy echo "Scenes:" >> plan.txt hg ci -m "we need scenes" @@ -201,7 +209,7 @@ Yes, I tend to do that… But we actually only need one change, so make it one by folding the last 4 changes changes into a single commit. Since fold does not take -m, yet, we will stop here for now. -#+BEGIN_SRC sh :tangle no :exports both :results output verbatim +#+BEGIN_SRC sh :tangle no :exports both :results output verbatim :session test-hg-evolve cd testmy # hg fold -r "-1:-4" # hg log -G -r 9: @@ -214,7 +222,7 @@ cd .. Now I apply the scenes to wishes, places and people. Which is not useful: First I should apply them to the wishes and check if all wishes are fullfilled. But while writing I forgot that, and anxious to show my co-gamemaster, I just did one big commit. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy sed -i "s/The Judicator wants Action/The Judicator wants Action - portals/" plan.txt sed -i "s/The village/The village - lost, vanish, portals/" plan.txt @@ -225,7 +233,7 @@ cd .. Let’s fix that: uncommit it and Normally I would just use `hg record` to interactively select changes to record. Since this is a non-interactive test, I manually undo and redo changes instead. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy hg uncommit --all # to undo all changes, not just those for specified files hg diff @@ -245,7 +253,7 @@ Let’s get the changes from our co-game First get the changes: -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy hg pull ../testother hg merge --tool internal:merge tip # the new head from our co-gamemaster @@ -261,7 +269,7 @@ cd .. Now we have all changes in our repo. We begin to apply people to wishes, places and scenes. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy sed -i "s/The Solek wants emotionally intense situations/The Solek wants emotionally intense situations | specter, Lost/" plan.txt sed -i "s/Lost appears/Lost appears | Lost/" plan.txt @@ -276,7 +284,7 @@ As you can see, the specter only applies Let’s fix that. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy sed -i "s/- The Specter/- The Specter\n- Wild Memories/" plan.txt sed -i "s/- Portals during dreamtime/- Portals during dreamtime\n- Unconnected Memories/" plan.txt @@ -288,7 +296,7 @@ cd .. Now split the big change into applying people first to wishes, then to places and scenes. -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy # go back to the big change hg up -r -2 @@ -313,7 +321,7 @@ You can see the additional commit sticki /note: We seem to have the workdir on the new changeset instead of on the one we did before the evolve. I assume that’s a bug to fix./ -#+BEGIN_SRC sh :exports both :results output verbatim +#+BEGIN_SRC sh :exports both :results output verbatim :session test-hg-evolve cd testmy hg up splitchanges hg graft -O tip