User:VladVukicevic/Mercurial Testing: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
How I use hg with cvs.
== How I use hg with cvs. ==
 
=== Setting up your cvs master ===


I assume that you're doing everything in some dir where you keep your moz stuff.
I assume that you're doing everything in some dir where you keep your moz stuff.
Line 31: Line 33:
Note: hg add should add all the files into the repo; if it doesn't, try '''hg add .'''
Note: hg add should add all the files into the repo; if it doesn't, try '''hg add .'''


=== Old misc notes. ===
=== Creating a working dir ===
 
Now, you create a working dir by cloning the cvs repo.
 
<pre>
hg clone cvssrc/mozilla mozilla
</pre>
 
Note that the directories have to be called "mozilla" for client.mk to work, which is why it sits in a separate cvssrc dir.
 
Now do all your hacking in the new mozilla dir (sibling to cvssrc).
 
=== Updating from CVS ===
 
In the cvssrc/mozilla dir:
 
<pre>
... MOZ_CO_PROJECT... pull_all ...
hg addremove
hg commit -m "cvs sync"
</pre>
 
Now in your working dir:
 
<pre>
hg pull ../cvssrc/mozilla
hg update
</pre>
 
=== Committing changes ===
 
First, make your working dir up to date with CVS by doing the above instructions.  This will make things easier.  Resolve merge conflicts normally.
 
Then, in your working dir:
 
<pre>
(hg add/remove new files as necessary)
hg commit -m "b=123456, implement cool feature, r=bob"
</pre>
 
Then in the cvssrc/mozilla dir:
 
<pre>
hg pull ../../mozilla
hg update
(cvs add/remove any added/removed files)
cvs commit -m "b=123456, implement cool feature, r=bob"
</pre>
 
If you have mutliple patches to commit:
 
<pre>
hg pull ../../mozilla
hg log -l 5  (show only the 5 latest log entries)
hg update 59  (the first revision number since the last cvs sync)
cvs commit ...
hg update 60
cvs commit ...
etc.
</pre>
 
=== Using MQ ===
 
I suggest using mq to manage multiple patches in your working dir.  See http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension.  Generally, I make sure to qpop all my patches off my working tree before I pull from the cvs tree, because that way parts of your patches don't end up being in merge commits.  Then I qush each patch and fix any conflicts along the way.
 
== Old misc notes. ==


'''hg import''' took a while; didn't time.  Just imported a CVS checkout, ignoring CVS dirs.
'''hg import''' took a while; didn't time.  Just imported a CVS checkout, ignoring CVS dirs.
Confirmed users, Bureaucrats and Sysops emeriti
792

edits

Navigation menu