The thing that gives me pause is that fossil would not jump branches 
just for fun. Perhaps you had accidentally opened trunk in your stable 
directory and didn't notice? (I usually run `fossil status` before I 
commit, in part to avoid such errors.) Or else is it possible you've 
come from SVN, and you actually have only opened your repository once 
(in ~/project) and are trying to use the two directories withing a 
single checkout as branches? If the latter, fossil (like most everything 
that isn't SVN) doesn't work that way. To work in two different 
branches, you'd do something like:

     $ fossil new ~/myrepo.fossil
     $ mkdir -p ~/project/trunk ~/project/stable
     $ cd ~/project/trunk
     $ fossil open ~/myrepo.fossil
     $ # add some files
     $ fossil commit -m "my first checkin"
     $ cd ~/project/stable
     $ fossil open ~/myrepo.fossil
     $ # change something
     $ fossil commit -m "a stable bugfix" --branch stable

If you've gotten started in the SVN style, with both branches in 
separate directories of a single checkout, I don't think there's any way 
to correct it other than to start over. If, however, you just 
accidentally ended up on the wrong branch:

`fossil undo` only works on update/merge/revert. You can effectively 
cancel a check-in by using `fossil ui`, going to the timeline, clicking 
on the commit, clicking on 'edit' (by 'Other Links:'), and using the 
checkbox and textbox by 'Branching' to move it to another branch (e.g., 
'oops') and marking the Leaf Closure checkbox as well. I don't know what 
happens if you try to use the branching section to try to move a commit 
to trunk or another existing branch. If your changes are not easy to 
recreate, follow these steps after the above fiddling in fossil ui:

     $ fossil checkout branch-you-were-accidentally-on --keep
     $ fossil status
     > You should see that you're on trunk with a list of changed files
     $ fossil extras
     > you should see the new files that aren't yet added to the repo
     $ fossil update branch-you-meant-to-be-on
     $ fossil status
     $ fossil extras
     > these should show the same files as before, but should indicate
       that you're on stable
     $ fossil add all-the-new-files-you-wanted-to-add
     $ fossil commit -m "hey, now these changes are on the right branch"

-- 
Joshua Paine
LetterBlock: Web applications built with joy
http://letterblock.com/
301-576-1920
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to