Labs/Bespin/DeveloperGuide/UsingMercurial: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
We have had some pain working with Mercurial, so thought it best to write up the best practices on how to work with it as relating to the Bespin project.
Here are some tips about using Mercurial, based on our experiences managing the Bespin project with it.
 
For now I will put up some notes, and then we will groom these more:


==== Getting Started ====
==== Getting Started ====


Our main code repository is hosted at http://hg.mozilla.org/labs/bespin. You can pull from that by:
Our main code repository is hosted at http://hg.mozilla.org/labs/bespinclient. You can pull from that by:


* [http://www.selenic.com/mercurial/wiki/ Downloading Mercurial]
* [http://www.selenic.com/mercurial/wiki/ Downloading Mercurial]
Line 14: Line 12:
   
   
  [extensions]
  [extensions]
  fetch =
  rebase =
  hgext.extdiff =
  hgext.extdiff =
   
   
Line 33: Line 31:
==== Best Practices ====
==== Best Practices ====


* Use "hg fetch"
* Use "hg pull --rebase"
** You need the "fetch =" line in your config
** You need the "rebase =" line in your config
** It will automatically handle merging, so instead of manually doing hg pull / hg merge, just do hg fetch and let it do its job
** It will automatically handle merging, so instead of manually doing hg pull / hg merge, just do hg pull --rebase and let it do its job. By rebasing, we don't end up with lots of merge commits in the history.
 
* Do not use branches
** hg is poor with branches, so we have learned to instead create other cloned repos for large chunks of work, and merge from repo to repo


* Look ahead
* Look ahead
Line 45: Line 40:
* Eek, broken! How do I get back!
* Eek, broken! How do I get back!
** If you do a fetch/pull and something messes up (or any operation) you can do a "hg rollback" to revert back
** If you do a fetch/pull and something messes up (or any operation) you can do a "hg rollback" to revert back
* When checking in, use the bug number at the beginning of the message and then the web view will auto link to the bug.
** E.g. hg ci -m "487459: Fixes the selection bug in Safari with -webkit-user-select: none;"


==== Contributing Back ====
==== Contributing Back ====


When you are ready to get code back to the main repo, consider the following:
When you are ready to send code back to the main repository, please take a look at [[Labs/Bespin/Contributing|Contributing to Bespin]].
 
* First, fetch from the main repo and merge the latest with your own code
* Test your code (we need automated tests!)
* Send us a pull request:
** Update a bug saying "I am ready for a pull on changeset XXXX on my repo at http://bitbucket.org/...."
** Ping us on IRC
** Optionally, you could attach a bundle, but we *much* prefer a pull request
canmove, Confirmed users, Bureaucrats and Sysops emeriti
1,093

edits