Bazaar for ClearCase users

Core tasks

Getting a view of a branch in Bazaar doesn’t require a Configuration Specification, all that is needed is to request a copy of the branch from the server where it exists. For example, if there is a branch located at sftp://server.example.com/bzr/project1/trunk, then that branch can be checked out using bzr checkout sftp://server.example.com/bzr/project1/trunk project1. This will create a directory called project1 containing the files in the latest revision of that project, along with a local copy of the history of that project.

All of the files in that project are available for editing at this time. So, to add a new file called myfile one can do

$ cd project1
$ echo "test content" > myfile
$ bzr add myfile
adding myfile

as an equivalent of

$ cleartool checkout -c "adding file myfile" .
Checked out "." from version "\main\17".
$ cleartool mkelem -nco -c "test content" myfile
Created element "myfile" (type "compressed_file").

Once the file has been added, it can be checked-in or committed using

$ bzr checkin -m "checkin after creating the new file"
Committing to sftp://server.example.com/bzr/project1/trunk
added myfile
Committed revision 1.

as an equivalent of ClearCase’s

$ cleartool checkin -c "checkin after creating the new file" .
Checked in "." version "\main\18".

To repeat the change process, you do not need to checkout anything again. So, the Bazaar equivalent of

$ echo change1 > myfile
Access is denied.
$ cleartool checkout -c change1 myfile
Checked out "myfile" from version "\main\0".
$ echo change1 > myfile
$ cleartool checkin -c "checkin change1" myfile
Checked in "myfile" version "\main\1".

is just

$ echo change1 > myfile
$ bzr ci -m "checkin change1" myfile
Committing to sftp://server.example.com/bzr/project1/trunk
modified myfile
Committed revision 2.

Network protocols

ClearCase uses a proprietary network protocol for communicating between clients and servers, both VOB (Versioned Object Base) and View servers. By contrast, Bazaar can communicate with its server using a variety of standard network protocols, including FTP, HTTP, SSH and SFTP and also using a proprietary protocol. The particular network protocol to be used by Bazaar is indicated by the URL of a branch. For more on the possible URL prefixes, see bzr help urlspec.

Revisions

In ClearCase, each file has its own revision history. These files are then collected into branches that keep track of the revisions of each of the files in the branch. Bazaar works differently, in that the fundamental object that is versioned is the branch, which contains all of its files. Thus, revisions in Bazaar refer to the entire branch and files are considered to have the revision that the entire branch has. For example, a very simple Bazaar project can be generated wit the following commands:

$ bzr init new-project
Created a standalone tree (format: 2a)
$ cd new-project
$ echo "Welcome to my project" > file1
$ echo "This is another file" > file2
$ bzr add
adding file1
adding file2
$ bzr commit -m "Create a first revision"
Committing to: /Users/nmb/tmp/new-project/
added file1
added file2
Committed revision 1.
$ echo "This sentence provides more information." >> file1
$ bzr commit -m "Update file1"
Committing to: /Users/nmb/tmp/new-project/
modified file1
Committed revision 2.

In this situation, we say that the branch new-project is at revision 2 and both files are at revision 2. Note that this sort of global revision numbering means that revisions 1 and 2 of file2 have the same contents. A different revision number is not sufficient to determine if a file has changed. To know if a file has changed between two revisions, use the diff command:

$ bzr diff -r1..2 file2
$ bzr diff -r1..2 file1
=== modified file 'file1'
--- file1   2009-10-22 15:30:48 +0000
+++ file1   2009-10-22 15:31:46 +0000
@@ -1,1 +1,2 @@
 Welcome to my project
+This sentence provides more information

Other commands

“How are the more advanced cleartool commands done in Bazaar?”

To be completed ...

Notes

“What else is worth knowing to get up to speed?”

To be completed ...

Feedback and edits

See Improving these documents.

Table Of Contents

Previous topic

Bazaar for Visual SourceSafe users

Next topic

Bazaar for Perforce users

This Page