Hg repo usage notes.
Hi all,
I have been trying to get my head around how to use Hg repo e.g. get latest code, fix something, make a patch etc. Perhaps something like the following would be useful on the download page? I'm a total newbie to Hg, so please step in and set me right about the correct/desirable/easier ways to do this.
# Get a copy of the repository
cd alsa-hg
hg clone http://hg-mirror.alsa-project.org/alsa-driver alsa-driver hg clone http://hg-mirror.alsa-project.org/alsa-kernel alsa-kernel
# Get latest
hg pull -u
# Create a working copy
hg clone alsa-driver alsa-driver-fixbug1
cd alsa-driver-fixbug1
./cvscompile
do { code; test;} until finished;
hg commit -m"Fixed the foo in bar"
# What to do about sending the changes back ?
hg outgoing ../alsa-driver
hg outgoing -p ../alsa-driver > foobar.patch
#OR bundle (which is preferred)
hg bundle foobar.hg ../alsa-driver
#OR
hg export (?what?) > foobar.patch
# email foobar.[hg,patch] to alsa-devel?
# Other notes
add to .hg/hgrc to avoid having to spec the path for hg [incoming,outgoing,bundle]:
default-push= /path/to/alsa-driver
cheers
--
Eliot
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
At Fri, 12 May 2006 13:07:40 +1200,
Quoted 7 lines · Eliot Blennerhassett
Hi all,
I have been trying to get my head around how to use Hg repo e.g. get latest code, fix something, make a patch etc. Perhaps something like the following would be useful on the download page? I'm a total newbie to Hg, so please step in and set me right about the correct/desirable/easier ways to do this.
It's a nice documentation.
Quoted 9 lines
# Get a copy of the repository
cd alsa-hghg clone http://hg-mirror.alsa-project.org/alsa-driver alsa-driver hg clone http://hg-mirror.alsa-project.org/alsa-kernel alsa-kernel
# Get latest
hg pull -u
Quoted 6 lines
# Create a working copy
hg clone alsa-driver alsa-driver-fixbug1
cd alsa-driver-fixbug1
./cvscompile
do { code; test;} until finished;
hg commit -m"Fixed the foo in bar"
Use the following style for a commit log:
A short summary of your change in a single line
Changelog details....
....
It's required especially for alsa-kernel tree since it's pushed to the standard linux kernel tree later.
Quoted 2 lines
# What to do about sending the changes back ?
hg outgoing ../alsa-driver
It can be "hg outgoing default", too.
Quoted 7 lines
hg outgoing -p ../alsa-driver > foobar.patch
#OR bundle (which is preferred)
hg bundle foobar.hg ../alsa-driver
#OR
hg export (?what?) > foobar.patch# email foobar.[hg,patch] to alsa-devel?
The bundle file is unsuitable for submission.
Please use always a patch file.
Quoted 5 lines
# Other notes
add to .hg/hgrc to avoid having to spec the path for hg [incoming,outgoing,bundle]:default-push= /path/to/alsa-driver
One thing to care is the sync with upstream.
When the upstream is changed while you already modified and committed on your local repo, the pull and "update -m" will require a new merge commit. If you do export or bundle from this repo, it will contain the commit for that merge, too. It's not good for the patch submission.
For avoiding this, a cherry-picking is necessary. On Hg, you can do it by exporting and importing the changes.
- Get changes via hg export on your local repo
% cd /my/own/alsa-driver
% hg export ORIGINAL-STATE:tip > my-patch
- On a master repo, you can "pull -u"
% cd /upstream/alsa-driver
% hg pull -u
Then you can apply the patch
% hg import /my/own/alsa-driver/my-patch
Takashi
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Quoted 80 lines · Takashi Iwai
At Fri, 12 May 2006 13:07:40 +1200,
Quoted 7 lines · Eliot Blennerhassett
Hi all,
I have been trying to get my head around how to use Hg repo e.g. get latest code, fix something, make a patch etc. Perhaps something like the following would be useful on the download page? I'm a total newbie to Hg, so please step in and set me right about the correct/desirable/easier ways to do this.
It's a nice documentation.
Quoted 9 lines
# Get a copy of the repository
cd alsa-hghg clone http://hg-mirror.alsa-project.org/alsa-driver alsa-driver hg clone http://hg-mirror.alsa-project.org/alsa-kernel alsa-kernel
# Get latest
hg pull -uQuoted 6 lines
# Create a working copy
hg clone alsa-driver alsa-driver-fixbug1
cd alsa-driver-fixbug1
./cvscompile
do { code; test;} until finished;
hg commit -m"Fixed the foo in bar"Use the following style for a commit log:
A short summary of your change in a single line
Changelog details....
....Signed-off-by Foo Bar <[email protected]>It's required especially for alsa-kernel tree since it's pushed to the standard linux kernel tree later.
Quoted 2 lines
# What to do about sending the changes back ?
hg outgoing ../alsa-driverIt can be "hg outgoing default", too.
Quoted 7 lines
hg outgoing -p ../alsa-driver > foobar.patch
#OR bundle (which is preferred)
hg bundle foobar.hg ../alsa-driver
#OR
hg export (?what?) > foobar.patch# email foobar.[hg,patch] to alsa-devel?The bundle file is unsuitable for submission.
Please use always a patch file.Quoted 5 lines
# Other notes
add to .hg/hgrc to avoid having to spec the path for hg [incoming,outgoing,bundle]:default-push= /path/to/alsa-driver
One thing to care is the sync with upstream.
When the upstream is changed while you already modified and committed on your local repo, the pull and "update -m" will require a new merge commit. If you do export or bundle from this repo, it will contain the commit for that merge, too. It's not good for the patch submission.
For avoiding this, a cherry-picking is necessary. On Hg, you can do it by exporting and importing the changes.
- Get changes via hg export on your local repo
% cd /my/own/alsa-driver
% hg export ORIGINAL-STATE:tip > my-patch
Quoted 8 lines
- On a master repo, you can "pull -u"
% cd /upstream/alsa-driver
% hg pull -uThen you can apply the patch
% hg import /my/own/alsa-driver/my-patch
Could you do a small text document from these e-mails? I'll place it to the ALSA website.
Thanks,
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642