D 2008-10-20T09:40:04
L Branching
P 264ae066468eecf307e8a410887f29c33a1947e3
U anonymous
W 3219
We probably need some notes on branching.
For now, here is a response to ticket [f90265fc83]:
# create testing branch
fossil tag branch testing uuid1
# where uuid1 is the point at which you want to branch
# Note that the above command creates a new checkin which is a
# sibling of uuid1 and identical to it.
# You still need to tell fossil to use it in the working directory
fossil update testing
# do some experimental work
...
# back to main branch
fossil update uuid1
fossil update
# The second update is needed because the main branch may have
# moved on from uuid1.
Note that fossil has no concept of a default branch, and in the presence of multiple forks and branches you are usually safer to give an explicit argument to fossil update.
Because fossil supports distributed operation, forks which are not deliberate branches can be quite common, and there is probably no safe algorithm for "the latest non-branch UUID".
fossil tag branch testing `fossil info|sed -n '/checkout: */s///p'`
As for going back to the main branch, there is nothing stopping you from tagging that with the name "default", though the best time to do it is when you create a new repository. And that doesn't solve the problem of which fork to choose, or does it mean going back to where you were on that branch?