Step by Step: Version Control with Fossil Part 3

PART 3 of 4


Alice is going to share her code to Bob. Fossil has built-in server that can serve in many ways. The simple way to serve is though stand-alone HTTP server.


Sharing the Repository

Before starting web server, let change your password by clicking the “Admin” tab and select “Users”. Click “Alice” and change the password of Alice. Follows the step below to start the web service.
Admin view

User management view


1. Start the server with these command and leave this console open.

C:\Tutorial\AliceDocument>fossil serve -P 9999
Listening for HTTP requests on TCP port 9999
Type Ctrl-C to stop the HTTP server



2. Check the result of the started server via web browser. Open the bowser and navigate to http:\\yourlocalIp:9999. How to know your local IP?

Accessing web service


3. Login in as Alice. Name your repository by clicking at Admin tab> Configuraion> Project Name. Then, name it to “Timer” and click apply.
Add new user “Bob” by clicking the add

Adding new user


4. Give Bob’s capabilities to “setup” which is the highest capabilities. In case that you need this repository to be private, uncheck all capabilities of anonymous, reader, nobody, and developer.


Cloning the Repository

When the repository has been published. The code can be committed on different user/computer. As you notice in this tutorial, the repository is shared though the internal network via LAN or Wireless LAN. Follows the steps below to clone the code to Bob computer.

1. On bob’s computer (or Alice’s computer on difference directory), Download and install the tool in the same way as you did in Alice’s computer.

2. Create a directory and run the commands below. The “timer” is the name of repository that has been named by Alice.

For convenience, while cloning the repository, please choose to remember password.

C:\Tutorial\BobDocument>fossil clone http://Bob@192.168.1.38:9999 timer
password for Bob: *
remember password (Y/n)? Y
Round-trips: 2   Artifacts sent: 0  received: 24
Clone done, sent: 536  received: 43865  ip: 192.168.1.38
Rebuilding repository meta-data...
  100.0% complete...
Extra delta compression...
Vacuuming the database...
project-id: 9d1c631ddafdecd97984be744c0db97a01618122
server-id:  d60b642b7c5ef5e48b9063668b401aae3db42868
admin-user: Bob (password is "eedc37")

3. Similar to the init command, you have to run the open to extract the compressed file.

C:\Tutorial\BobDocument>fossil open timer
build.xml
manifest.mf
nbproject/build-impl.xml
nbproject/configs/Run_as_WebStart.properties
nbproject/configs/Run_in_Browser.properties
nbproject/genfiles.properties
nbproject/jfx-impl.xml
nbproject/project.properties
nbproject/project.xml
src/timer/CountDownTimer.java
src/timer/FXMLDocument.fxml
src/timer/FXMLDocumentController.java
src/timer/Timer.java
test/CountDownTimerTest.java
project-name: Timer
repository:   C:/Tutorial/BobDocument/timer
local-root:   C:/Tutorial/BobDocument/
config-db:    C:/Users/Apivan/AppData/Local/_fossil
project-code: 9d1c631ddafdecd97984be744c0db97a01618122
checkout:     e78a32eab019a0254bdd1f680b386797944ab992 2015-05-30 07:13:26 UTC
parent:       87f6910d9820518888c0d45a553a6d7bd939a252 2015-05-30 06:38:41 UTC
leaf:         open
tags:         trunk
comment:      Implement unit test (user: Alice)
check-ins:    3


 

Committing the changes to remote repository.

Now, Bob will edit the code. On the Bob computer, follow the step below

1. Copy the Iteration\Iteration2 to the BobDocument.
2. Open the fuel and click file>open. Navigate to the BobDocument\_Fossil_.
3. Click the refersh button to see the edited file. Then, commit the change.



Update the local repository


On Alice computer (AliceDocument), open the Fuel. Click refresh, and observe the timeline. You will see the artifact from Bob.
Alice got artifact from Bob, but Alice's checkout is not the latest.


 Run the “update” to pull the artifact from Bob.

C:\Tutorial\AliceDocument>fossil update
UPDATE src/timer/FXMLDocument.fxml
-------------------------------------------------------------------------------
updated-to:   94b9fc266a68d4e706f63db6e51cae3baccb167f 2015-05-30 08:54:25 UTC
leaf:         open
tags:         trunk
comment:      Implement the Fxml (user: Bob)
changes:      1 file modified.                                   
 "fossil undo" is available to undo changes to the working checkout.



Click the timeline button again. You will see that the current checkout is now move to the top

Alice' checkout is now moved to the top.

 


 Travel Though the Timeline


In the last step, the command “update” will update you project to the latest version. If you wish to go back to exact moment in the timeline. You can use the “checkout VERSION” as follows. The VERSION is the ID of check-in which can be viewed from UI or fossil timeline.

C:\Tutorial\BobDocument>fossil timeline
=== 2015-05-30 ===
08:54:25 [94b9fc266a] *CURRENT* Implement the Fxml (user: Bob tags: trunk)
07:13:26 [e78a32eab0] Implement unit test (user: Alice tags: trunk)
06:38:41 [87f6910d98] Add file (user: Alice tags: trunk)
05:50:21 [9c0ad66ac7] initial empty check-in (user: Alice tags: trunk)
+++ no more data (4) +++
C:\Tutorial\BobDocument>fossil checkout e78a32eab0
build.xml
manifest.mf
nbproject/build-impl.xml
nbproject/configs/Run_as_WebStart.properties
nbproject/configs/Run_in_Browser.properties
nbproject/genfiles.properties
nbproject/jfx-impl.xml
nbproject/project.properties
nbproject/project.xml
src/timer/CountDownTimer.java
src/timer/FXMLDocument.fxml
src/timer/FXMLDocumentController.java
src/timer/Timer.java
test/CountDownTimerTest.java
C:\Tutorial\BobDocument>fossil timeline
=== 2015-05-30 ===
08:54:25 [94b9fc266a] Implement the Fxml (user: Bob tags: trunk)
07:13:26 [e78a32eab0] *CURRENT* Implement unit test (user: Alice tags: trunk)
06:38:41 [87f6910d98] Add file (user: Alice tags: trunk)
05:50:21 [9c0ad66ac7] initial empty check-in (user: Alice tags: trunk)
+++ no more data (4) +++

Continue to part 4

No comments:

Post a Comment