9

I'm trying fossil as my new VCS, since I'm a lone developer working on small projects. I started testing fossil but I encountered a (probably major newbie) problem. How does one push or pull to another directory (which is easy on Hg). Fossil pull or push commands expect a URL and not a directory. When I start a server in one directory and try to push from another directory I get the "server loop" error message. Any ideas?

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
Mosh
  • 2,458
  • 3
  • 18
  • 19
  • I forgot to say that I circumvented the URL problem on the "clone" command by copying the repository file. – Mosh Aug 30 '09 at 07:57

3 Answers3

18

When I tried this, clone and pull worked just as expected WITHOUT running a fossil server.

Create a master repository

>mkdir master

>cd master

>fossil new master_repos.fsl
project-id: dbcb1863865d7d3ed74f873df6daf07c5853df5e
server-id:  ea7a2e2496cc9c958cb7cc50bf48c0810b25a0a0
admin-user: james (initial password is "89ef88")

>fossil open master_repos.fsl


>echo "hello world" > a.a

>fossil add a.a
ADDED  a.a

>fossil ci -m "add a.a"
New_Version: 80b67a84ff276e559328f373008ff3014a869170

Clone the master repository

>cd ..

>mkdir trial

>cd trial

>fossil clone ../master/master_repos.fsl trail_repos.fsl
Repository cloned into trail_repos.fsl
Rebuilding repository meta-data...
3 (100%)...
project-id: dbcb1863865d7d3ed74f873df6daf07c5853df5e
server-id:  24da0b614d1a1d6cd8ac5a86200390b47b87ee27
admin-user: james (password is "89ef88")

>fossil open trail_repos.fsl
a.a
project-name: <unnamed>
repository:   C:/Documents and Settings/james/My Documents/code/test/trial/trail
_repos.fsl
local-root:   C:/Documents and Settings/james/My Documents/code/test/trial/
project-code: dbcb1863865d7d3ed74f873df6daf07c5853df5e
server-code:  24da0b614d1a1d6cd8ac5a86200390b47b87ee27
checkout:     80b67a84ff276e559328f373008ff3014a869170 2009-11-12 15:19:51 UTC
parent:       b04cc7533753a8a8a1f8a92b1be8b73cbc368660 2009-11-12 15:18:11 UTC
tags:         trunk


>type a.a
"hello world"

Modify the master

>cd ../master

>echo "hello #2" > b.b

>fossil add b.b
ADDED  b.b

>fossil ci -m "add b.b"
New_Version: 863e2501037e9f215ff3ec08a1d7802315151e7b

Pull from the modified master

>cd ../trial

>fossil pull ../master/master_repos.fsl
                Bytes      Cards  Artifacts     Deltas
Send:             130          1          0          0
Received:         230          6          0          0
Send:             224          2          0          0
Received:         590          8          2          0
Total network traffic: 649 bytes sent, 806 bytes received

>fossil update
Autosync:  file://C:/Documents and Settings/james/My Documents/code/test/master/
master_repos.fsl
                Bytes      Cards  Artifacts     Deltas
Send:             130          1          0          0
Received:         230          6          0          0
Total network traffic: 295 bytes sent, 337 bytes received
ADD b.b


>type b.b
"hello #2"
ravenspoint
  • 19,093
  • 6
  • 57
  • 103
7

According to this fossil ticket, cloning, pushing and pulling require a fossil server to be running. You can't just use the repo, you'll have to start a server, then refer to http://localhost/whatever and you should be golden.

  1. Run fossil server in the original repository
  2. Go to the destination directory and run fossil clone http://localhost:8080 <repository name> (or push or pull)
Josh Matthews
  • 12,816
  • 7
  • 36
  • 39
  • Thanks for your reply. I tried it and I still get the following reply: "2fossil: server says: server loop". Any ideas? – Mosh Aug 31 '09 at 10:07
  • Hurrah! It works. Just in case someone else stumbles on the same problem. Open "fossil server" in the original directory. Go to the destination directory and fossil clone (or push or pull) http://localhost:8080 Seems rather obvious now, thanks again. – Mosh Aug 31 '09 at 18:14
  • Notice that in the previous comment, Stackoverflow took the http address literally. Can someone with editing privileges fix this? – Mosh Aug 31 '09 at 18:17
  • 1
    @Mosh Use backticks ``` to quote code: `fossil clone (or push or pull) http://localhost:8080 ` – Tobias Kienzler Sep 26 '12 at 08:19
-1

If the content is the same, I use the same fossil file.(You don't require pull/push) eg.

fossil new ~/fs/prj1.fossil
(mkdir prj1 ; fossil open ~/fs/prj1.fossil)
(mkdir prj1_feature1 ; fossil open ~/fs/prj1.fossil)

In some case(prj1 is full, prj2 is subset of prj1), I use safer method 'fossil ui'. eg.

fossil new ~/fs/prj1.fossil
(mkdir prj1 ; fossil open ~/fs/prj1.fossil; fossil ui &) 
mkdir prj1_subset
fossil clone http://localhost:8080 prj1_subset.fossil
fossil open prj1_subset.fossil
Daniel YC Lin
  • 15,050
  • 18
  • 63
  • 96