3
@node Introducing replay -- An Alternative to update
4
@chapter Introducing replay -- An Alternative to update
6
@code{update} isn't the only way to catch-up with a development path.
7
Another option is @code{replay}:
11
% cd ~/wd/project-tree
19
What does that actually do?
23
@section An update Refresher
25
Let's suppose that we check out an old version of @code{hello-world}:
30
% tla get hello-world--mainline--0.1--patch-1 hw-patch-1
37
It's easy to see that the resulting tree is not up-to-date:
50
Now, let's suppose that we make some local changes in @code{hw-patch-1} and
51
then run @code{update}. What happens?
54
@strong{Local changes are computed against patch-1.} In other words,
55
a changeset is created that represents the changes from a
56
pristine copy of the @code{patch-1} revision to the current state
57
of the project tree (@code{hw-patch-1}).
60
@strong{A copy of patch-3 is checked out.} @code{update} starts with a pristine
61
copy of the @code{patch-3} revision.
64
@strong{The changeset is applied to the patch-3 tree.} The changes computed
65
in the first step are made to the new tree.
68
There's another way, though:
75
@section The replay Command
77
We have a local copy of the @code{patch-1}, perhaps with some local
91
Recall that the @code{patch-2} and @code{patch-3} revisions each correspond to a
92
specific changeset, stored in the archive (see @strong{How it Works -- commit of a New Revision} in @ref{Checking-in Changes}).
95
We could add those changes to your local tree by using @code{get-changeset}
96
to retrieve each changeset, and @code{dopatch} to apply it (see
97
@strong{get-changeset Retrieves a Changeset from an Archive} in @ref{Exploring Changesets}, and
98
@ref{dopatch}). That's a lot of tedious work, though, so @code{arch}
99
provides a more automated way to accomplish that same effect:
113
@code{replay} will do just what we've described: get patches
114
from the archive and apply them one-by-one. One word of caution,
115
though: if one of those patches generates conflicts, @code{replay} will
116
stop there and let you fix the conflicts. You can then pick up where
117
@code{replay} left off by running @code{replay} a second time.
124
@section How it Works -- replay
126
If you've followed along with the tutorial so far, the way that @code{replay}
127
works should be pretty obvious. In fact, it's just exactly how we
128
described it above. @code{replay} uses @code{missing} to find out what changes
129
your tree is missing, @code{get-changeset} to retrieve those changesets, and
130
@code{dopatch} to apply them. There's a fair amount of "bookkeeping"
131
involved in doing that -- and that bookkeeping is what @code{replay}