Difference between revisions of "User:Minooz/Mercurial"
(→Challenges) |
(→Challenges) |
||
Line 35: | Line 35: | ||
==Challenges== | ==Challenges== | ||
− | * 1- First challenge | + | * 1- First challenge is how to trim history of a repository. |
: We have a Mercurial repository called A. We want to clone repo A and create a new repo called B. | : We have a Mercurial repository called A. We want to clone repo A and create a new repo called B. | ||
: It's possible to use 'init' and create a new repo and just copy the files from repo A and add them. | : It's possible to use 'init' and create a new repo and just copy the files from repo A and add them. | ||
: This way the revision number will reset. And we will start repo B from the tip of the repo A. | : This way the revision number will reset. And we will start repo B from the tip of the repo A. | ||
: The problem appears if we want to clone just the tip of the repo A and keep the same revision number of the 'tip'. | : The problem appears if we want to clone just the tip of the repo A and keep the same revision number of the 'tip'. | ||
− | : Here are some links that we | + | : Here are some links that we went through, but no success yet. |
:[http://mercurial.selenic.com/wiki/EditingHistory Trimming History] | :[http://mercurial.selenic.com/wiki/EditingHistory Trimming History] | ||
:[http://www.selenic.com/mercurial/hgrc.5.html .hgrc file] | :[http://www.selenic.com/mercurial/hgrc.5.html .hgrc file] | ||
:[http://mercurial.selenic.com/wiki/TipsAndTricks mq strip changeset] | :[http://mercurial.selenic.com/wiki/TipsAndTricks mq strip changeset] |
Revision as of 10:14, 30 September 2010
Mercurial
- Main website @ http://mercurial.selenic.com/
- Mozilla Mercurial @ https://wiki.mozilla.org/Mercurial_on_Windows
- compare version controls [1]
- Understanding Mercurial @ http://mercurial.selenic.com/wiki/UnderstandingMercurial
- Tutorial-wiki @ http://mercurial.selenic.com/wiki/Tutorial
Installation
Mercurial on Eclipse
Documentation
- The Definitive Guide, is a documentation for hg (PDF or Html).
- TortoiseHg Documentation [7]
- Creating a Version Control Repository [8]
- Some Basic Terms (from The Definitive Guide)
- The .hg directory is the “real” repository, and all of the files and directories that coexist with it are said to live in the working directory. An easy way to remember the distinction is that the repository contains the history of your project, while the working directory contains a snapshot of your project at a particular point in history.
- The hg log command gives us a view of the history of changes in the repository. By default, this command prints a brief paragraph of output for each change to the project that was recorded. Each of these recorded events are called a changeset, because it can contain a record of changes to several files. Changeset is also referred to aschange, cset, revision or rev.
- Changeset field has the format of a number (identifier, which is only valid in that repository) followed by a colon, followed by a hexadecimal (or hex) string. These are identifiers for the changeset. The hex string is a unique identifier: the same hex string will always refer to the same changeset in every copy of this repository. The number is shorter and easier to type than the hex string, but it isn't unique: the same number in two different clones of a repository may identify different changesets. changeset: 0:0a04b987be5a
- Mercurial uses revision numbers purely as a convenient shorthand. If you need to discuss a changeset with someone, or make a record of a changeset for some other reason (for example, in a bug report), use the hexadecimal identifier.
- Some changesets, have a tag field. A tag is another way to identify a changeset, by giving it an easy-to-remember name. tag: tip
- To get the changeset id of the tipmost changeset of a remote repository you can do: When it changes, you have new changesets in the remote repository.[9]
> hg id -i -r tip http://www.selenic.com/repo/hello
82e55d328c8c
Challenges
- 1- First challenge is how to trim history of a repository.
- We have a Mercurial repository called A. We want to clone repo A and create a new repo called B.
- It's possible to use 'init' and create a new repo and just copy the files from repo A and add them.
- This way the revision number will reset. And we will start repo B from the tip of the repo A.
- The problem appears if we want to clone just the tip of the repo A and keep the same revision number of the 'tip'.
- Here are some links that we went through, but no success yet.
- Trimming History
- .hgrc file
- mq strip changeset