Difference between revisions of "Repository"

From gem5
Jump to: navigation, search
(Initial page about the repo.)
 
Line 1: Line 1:
 
The M5 Repository uses the [http://selenic.com/mercurial Mercurial] (a.k.a hg) revision control system.
 
The M5 Repository uses the [http://selenic.com/mercurial Mercurial] (a.k.a hg) revision control system.
  
The documentation on [http://selenic.com/mercurial Mercurial's] website and the [http://hgbook.red-bean.com/ hg-book] are both excellent resources for learning about the revision control system.  We promise that it is worth taking 30 minutes to read some of the documentation to get you started.  You may even decide that you really like hg and want to use it in your own projects.  We do!
 
  
We also highly encourage you to read about [http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension Mercurial Queues (MQ)] as they're a great way to follow the changes that occur in the repository while keeping your own changes separate. A good introduction is also included in chapter 12 of the hg book http://hgbook.red-bean.com/hgbookch12.html.
+
===What is it?===
 +
[http://www.selenic.com/mercurial Mercurial] (hg) is a distributed version control system. Every copy of a mercurial repository is complete---there is no one central copy of the repository---and any operation on it (committing changes, etc) without communicating with another repository. In brief it allows you to create a copy of the m5sim.org repository that is fully functional. Instead of having to manually diff/patch your changes when a new version is released simply executing a command will "pull" all changes in the m5sim.org repository into your local repository launching a merge tool whenever necessary. Additionally, sending patches to us for inclusion in the m5sim.org repository is a single command.
 +
 
  
 +
===Where can I get more information about it?===
 +
The main Mercurial website is [http://www.selenic.com/mercurial/ here]. Other good sources of information about Mercurial is the [http://hgbook.red-bean.com/ hg book] and the [http://www.ivy.fr/mercurial/ref/v1.0 HG Cheat Sheets]. We promise that it is worth taking 30 minutes to read some of the documentation to get you started.  You may even decide that you really like hg and want to use it in your own projects.  We do!
 +
 +
===How do I use it===
 +
The first thing you need to do is install hg (from either package for your OS/distribution or from source). Debian and Ubuntu have packages named mercurial that you can install, MacPorts also has a package. The next thing you should do is setup a <code>.hgrc</code>. An example <code>.hgrc</code> is provided below. It enables various extensions that come with Mercurial and allows you to mail patches to the M5 mailing list if you so choose.
 +
 +
[ui]
 +
# Set the username you will commit code with
 +
username=Your Name <your@email.address>
 +
ssh = ssh -C
 +
 +
# Always use git diffs since they contain permission changes and rename info
 +
[defaults]
 +
qrefresh = --git
 +
email = --git
 +
diff = --git
 +
 +
[extensions]
 +
# These are various extensions we find useful
 +
 +
# Mercurial Queues -- allows managing of changes as a series of patches
 +
hgext.mq =
 +
 +
# PatchBomb -- send a series of changesets as e-mailed patches
 +
hgext.patchbomb =
 +
 
 +
# External Diff tool (e.g. kdiff3, meld, vimdiff, etc)
 +
hgext.extdiff =
 +
 +
# Fetch allows for a pull/update operation to be done with one command and automatically commits a merge changeset
 +
hgext.fetch =
 +
 +
# Path to the style file for the M5 repository
 +
# This file enforces our coding style requirements
 +
style = /path/to/your/m5/util/style.py
 +
 +
[email]
 +
method = smtp
 +
from = Your Name <your@email.address>
 +
 +
[smtp]
 +
host = your.smtp.server.here
 +
 +
===Basic Commands===
 +
Here are some basic commands for Mercurial, however this is not exhaustive and you should read the Mercurial documentation.
 +
 +
Cloning creates a complete and fully functional copy of a repository. To get started you should execute:<code> hg clone http://repo.m5sim.org/m5</code>
 +
 +
Pull is used to update your repository with the latest changes on m5sim.org:<code> hg pull</code> If Mercurial downloaded any changes you'll need to update your repository with: <code>hg update</code> If you have any conflicting changes in your local repository you'll be prompted to merge them at this time. The fetch extension combines these two steps into one command as follows and we recommend you use it:<code> hg fetch</code>
 +
 +
You can see what files have been modified in your repository by executing: <code>hg status</code> and you can see a diff of the modified files by executing:<code>hg diff</code>.
 +
 +
 +
 +
===Making Your Own Changes===
 +
We highly recommend that you use Mercurial Queues(MQ) to make any changes to M5 that you personally need. There is a chapter on using MQ in the [http://hgbook.red-bean.com/hgbookch12.html HG-Book]  you should take the time to read the chapter in the book, it will make your life much easier.
 +
 +
The basic idea of MQ is to provide management commands to create and apply patches to an upstream source tree. When the underlying source tree is updated (see above), you can remove your patches, get the new changes and reapply your patches very quickly. The patches themselves can be an complete mercurial repository that is revision controlled.
 +
 +
===E-mailing Patches===
 
The [http://www.selenic.com/mercurial/wiki/index.cgi/PatchbombExtension patchbomb] extension is a great way to share patches with other users.  It adds the <tt>hg email</tt> command which allows you to send a set of changesets (or mq patches) to the m5 developer's mailing list!
 
The [http://www.selenic.com/mercurial/wiki/index.cgi/PatchbombExtension patchbomb] extension is a great way to share patches with other users.  It adds the <tt>hg email</tt> command which allows you to send a set of changesets (or mq patches) to the m5 developer's mailing list!
  
To quickly get started, you can get a copy of the m5sim.org repository for your use by using the following command
 
<pre>
 
% hg clone http://repo.m5sim.org/m5
 
</pre>
 
 
To see what files are modified from the last committed revision
 
<pre>
 
% hg status
 
</pre>
 
  
To see diffs of the outstanding changes
+
To e-mail us patches you'll need to add the following to <code>m5/.hg/hgrc</code> (or create it if it doesn't exist).
<pre>
+
[email]
% hg diff
+
to = m5-dev@m5sim.org
</pre>
+
Then to e-mail a particular changeset simply execute: <code>hg email [REV]</code>

Revision as of 23:33, 12 June 2008

The M5 Repository uses the Mercurial (a.k.a hg) revision control system.


What is it?

Mercurial (hg) is a distributed version control system. Every copy of a mercurial repository is complete---there is no one central copy of the repository---and any operation on it (committing changes, etc) without communicating with another repository. In brief it allows you to create a copy of the m5sim.org repository that is fully functional. Instead of having to manually diff/patch your changes when a new version is released simply executing a command will "pull" all changes in the m5sim.org repository into your local repository launching a merge tool whenever necessary. Additionally, sending patches to us for inclusion in the m5sim.org repository is a single command.


Where can I get more information about it?

The main Mercurial website is here. Other good sources of information about Mercurial is the hg book and the HG Cheat Sheets. We promise that it is worth taking 30 minutes to read some of the documentation to get you started. You may even decide that you really like hg and want to use it in your own projects. We do!

How do I use it

The first thing you need to do is install hg (from either package for your OS/distribution or from source). Debian and Ubuntu have packages named mercurial that you can install, MacPorts also has a package. The next thing you should do is setup a .hgrc. An example .hgrc is provided below. It enables various extensions that come with Mercurial and allows you to mail patches to the M5 mailing list if you so choose.

[ui]
# Set the username you will commit code with
username=Your Name <your@email.address> 
ssh = ssh -C

# Always use git diffs since they contain permission changes and rename info
[defaults] 
qrefresh = --git
email = --git
diff = --git

[extensions]
# These are various extensions we find useful

# Mercurial Queues -- allows managing of changes as a series of patches
hgext.mq =

# PatchBomb -- send a series of changesets as e-mailed patches
hgext.patchbomb = 
 
# External Diff tool (e.g. kdiff3, meld, vimdiff, etc)
hgext.extdiff =

# Fetch allows for a pull/update operation to be done with one command and automatically commits a merge changeset
hgext.fetch = 

# Path to the style file for the M5 repository 
# This file enforces our coding style requirements
style = /path/to/your/m5/util/style.py

[email]
method = smtp
from = Your Name <your@email.address>

[smtp]
host = your.smtp.server.here

Basic Commands

Here are some basic commands for Mercurial, however this is not exhaustive and you should read the Mercurial documentation.

Cloning creates a complete and fully functional copy of a repository. To get started you should execute: hg clone http://repo.m5sim.org/m5

Pull is used to update your repository with the latest changes on m5sim.org: hg pull If Mercurial downloaded any changes you'll need to update your repository with: hg update If you have any conflicting changes in your local repository you'll be prompted to merge them at this time. The fetch extension combines these two steps into one command as follows and we recommend you use it: hg fetch

You can see what files have been modified in your repository by executing: hg status and you can see a diff of the modified files by executing:hg diff.


Making Your Own Changes

We highly recommend that you use Mercurial Queues(MQ) to make any changes to M5 that you personally need. There is a chapter on using MQ in the HG-Book you should take the time to read the chapter in the book, it will make your life much easier.

The basic idea of MQ is to provide management commands to create and apply patches to an upstream source tree. When the underlying source tree is updated (see above), you can remove your patches, get the new changes and reapply your patches very quickly. The patches themselves can be an complete mercurial repository that is revision controlled.

E-mailing Patches

The patchbomb extension is a great way to share patches with other users. It adds the hg email command which allows you to send a set of changesets (or mq patches) to the m5 developer's mailing list!


To e-mail us patches you'll need to add the following to m5/.hg/hgrc (or create it if it doesn't exist).

[email]
to = m5-dev@m5sim.org

Then to e-mail a particular changeset simply execute: hg email [REV]