Ubuntu10.10 bazaar Installation notes

Source: Internet
Author: User

Bazaar is an open-source distributed version control tool. Distributed version control system (distributed version control system) is a method that does not require the central server to manage the file version. It can also use the central server. Changes to the version can be merged into versions of other users using the distributed version control system for flexible control. In addition, most of its operations are performed locally on the client without network connection, so it is much faster than the centralized server operation. Mainstream distributed version control tools include git, bazaar, and mercurial. Centralized version control tools include SVN, CVS, and VSS.
Bazaar (bzr) is fully developed using python, so it must be supported by python. Download link: wiki.bazaar.canonical.com/download

1. Change the update source
I have tried many update sources, and Netease's speed and stability are very good.
First, back up and update the source table:
Sudo CP/etc/APT/sources. LIST/etc/APT/sources. list_backup
Then open Edit
Sudo Vim/etc/APT/sources. List
Add the following lines and comment out other lines.
Deb http://mirrors.163.com/ubuntu/ maverick main restricted universe multiverse
Deb http://mirrors.163.com/ubuntu/ Maverick-security main restricted universe multiverse
Deb http://mirrors.163.com/ubuntu/ Maverick-Updates main restricted universe multiverse
Deb http://mirrors.163.com/ubuntu/ maverick-proposed main restricted universe multiverse
Deb http://mirrors.163.com/ubuntu/ maverick-backports main restricted universe multiverse
Deb-src http://mirrors.163.com/ubuntu/ maverick main restricted universe multiverse
Deb-src http://mirrors.163.com/ubuntu/ maverick-security main restricted universe multiverse
Deb-src http://mirrors.163.com/ubuntu/ maverick-updates main restricted universe multiverse
Deb-src http://mirrors.163.com/ubuntu/ maverick-proposed main restricted universe multiverse
Deb-src http://mirrors.163.com/ubuntu/ maverick-backports main restricted universe multiverse
Then run refresh list (Be sure to refresh)
Sudo apt-get update

2. Check the required software package
(1) Check the Python version
SHELL> python-v
... Python 2.6.6...
(2) Check the required Python Module

Shell> Python-c "Import crypto" # If no message is displayed, the module is loaded successfully.
Shell> Python-c "Import paramiko" # the error message "cannot be found"
Shell> Python-c "Import celementtree" # the error message "cannot be found"
Shell> Python-c "Import XML. etree. celementtree" # This module is successfully loaded.
Paramiko is an open-source module that enables secure (authentication and encryption) connection to remote computers. It is downloaded at http://www.python.org/pypi/paramiko.
The celementtree module is the c implementation of the elementtree API. Elementtree is the XML library of Python. Download link effbot.org/downloads/javascelementtree.
Download and decompress the package, go to the directory, and run the python installation script.
Shell> Python setup. py install
# If the prompt "python. H" is not found and GCC cannot be compiled, it indicates that python-Dev is not installed.
Install the following package in ubuntu10.10:

Libssl0.9.8 _ 0.9.8o-4_i386.deb
Http://linux.cdpa.nsysu.edu.tw/debian/pool/main/o/openssl/libssl0.9.8_0.9.8o-4_i386.deb
Libssl-dev_0.9.8o-4_i386.deb
Http://ftp.debian.org/debian/pool/main/o/openssl/libssl-dev_0.9.8o-4_i386.deb
Python2.6-dev_2.6.6-5ubuntu1_i386.deb
Http://ftp.isu.edu.tw/pub/Linux/Ubuntu/ubuntu/pool/main/p/python2.6/libpython2.6_2.6.6-5ubuntu1_i386.deb
Then execute again
Shell> sudo Python setup. py install
Compiled and installed successfully.
(3). Check whether the SSH tool is installed. (SSH connection is required for publishing via launchpad.net)
Shell> which SSH
Shell> sudo apt-Get install OpenSSH-Client

3. Install bazaar

Shell> sudo apt-Get install bzr
Wait until installation is complete

4. Basic use

(1). Registered User Information
Shell> bzr whoami "Luffy <xiaoluffy@gmail.com>"
At this time, the following information is written to the configuration file ~ /. Bazaar/bazaar. conf
[Default]
Email = Luffy <xiaoluffy@gmail.com>
You can enter to view the current user information
Shell> bzr whoami
(2) test bazaar
Shell> mkdir bazaar_home
Shell> Cd bazaar_home
Shell> mkdir dir_test # create a test folder
Shell> touch w1.txt w2.txt dir_test/w3.txt # Generate several test files
Shell> bzr init # initialize the project
Shell> bzr add # Add the files in the current folder to the project.
Shell> bzr commit-M "Initial import" # submit the project to the project news and add some comments.
# If you do not need to add-M "comment", an editor will appear to add
Then use viedit to modify w1.txt content, such as adding this is someting added! This sentence
Shell> bzr diff # view project Changes
=== Modified file 'w1.txt'
--- W1.txt2011-01-02 06:09:21 + 0000
++ W1.txt2011-01-02 06:11:04 + 0000
@-+ @@
+ This is someting added!
# Submit again
Shell> bzr commit-M "added first line of w1.txt"
Committing to:/home/Luffy/documents/bazaar_home/
Modified w1.txt
Committed revision 2.
(3) view version logs
Shell> bzr log
------------------------------------------------------------
Revno: 2
Committer: Luffy <xiaoluffy@gmail.com>
Branch NICK: bazaar_home
Timestamp: Sun 14:12:28 + 0800
Message:
Added first line of w1.txt
------------------------------------------------------------
Revno: 1
Committer: Luffy <xiaoluffy@gmail.com>
Branch NICK: bazaar_home
Timestamp: Sun 14:09:21 + 0800
Message:
First committed

(4) query historical versions
Shell> bzr log-R 1 # query version 1
Shell> bzr log-R 1 .. # query 1 to the latest version
Shell> bzr log-R .. 4 # query the earliest version to date
Shell> bzr log-R 1 .. 4 # query versions 1 to 4
View which version of a file has been changed
Shell> bzr log filename
(5). Access History
Shell> bzr cat-r X File> file_in_ver_x
(6). manage files
Shell> bzr add [file name or directory name]
Shell> bzr remove-V [file name or directory name]
Shell> bzr status # query the status of recent changes
(7). Roll Back to all operations submitted last time
Shell> bzr revert
Shell> bzr revert Foo. py
(8). Roll Back A commit
Shell> bzr uncommit
Shell> bzr uncommit-r-3 # Roll Back to version 3

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.