最近写了个PPT,帮助新同事熟悉MySQL的代码。现在将一部分整理到博客上。
用英文写的,没时间翻译了。英语水平有限,感兴趣的朋友,凑合着看吧。有
问题的朋友直接回复我,我尽快回复。
* Where Is MySQL Source Code
- Launchpad
- MySQL Website
http://dev.mysql.com/downloads
Both Binaries and Source Code can be found there.Launchpad is recommended, as its code is in a bazaar repository.
A few fantastic benefits are there.
* Extra Informations are in code repository
Many useful information is stored in bazaar repository. it can help
us to understand the code well.
- Revision Log
Every commit creates a new revision and lots of information is logged.
For each patch, we can find who committed it, when it was committed,
which branch it merged from and what the commit message is.
- Commit Message
MySQL has a strict policy for commit messages. The message has to record
related bug IDs or worklog IDs, give a clear description about the
problem or the new feature and clarify how the problem is solved or the
new feature is implemented.
- The Origin Of Each Line
Bazaar can show us the revision of each line in current work tree.
It means the line was introduced in the revision. So it is very helpful
for finding extra informations related to the code.
* Easy to setup new branches
- Bazaar is a distributed VC tool. it is very easy to clone a new MySQL
branch for ourself from launchpad. And develop your own code separately.
- The new branch keeps all information of the old version, so we can
retrieve the code of old versions easily.
* MySQL Projects On Launchpad
- MySQL is more than just a database server. This Launchpad project
acts as an umbrella for all projects related to (and including)
the MySQL Server.
- Dozens Projects for MySQL are there. E.g. MySQL Connector,
MySQL Proxy etc. The most important one is MySQL Server project.
It implements MySQL server. So we mainly focus on MySQL Server code.
* Branches of MySQL Server
- 5.1
It is the branch of MySQL-5.1
- 5.5
It is the branch of MySQL-5.5.
- trunk
It is for unreleased new features.
- cluster-*
Cluster branches include the code of NDB Cluster.
* Clone New Branches From Launchpad
- Clone the code from launchpad repository
- bzr branch lp:mysql-server/5.5
-
bzr branch lp:mysql-server/trunk
- Update your local branch if new patches are put in launchpad
- bzr pull
-
bzr pull lp:mysql-server/5.5
Now, you have created mirrors of MySQL server code. You can write
your own code and commit it to your branches.
Note: you could not use 'bzr pull' to update your branches if you
have committed your own patches into the local branches. But you
can do it by using 'bzr merge'.
阅读(894) | 评论(0) | 转发(0) |