Confirmed users
566
edits
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
Hints around building, testing and using the new NSS code layout, which involves separate HG (Mercurial) repositories for NSPR and NSS. | Hints around building, testing and using the new NSS code layout, which involves separate HG (Mercurial) repositories for NSPR and NSS. | ||
=One-time preparation= | =One-time preparation= | ||
| Line 20: | Line 18: | ||
hgext.mq = | hgext.mq = | ||
rebase = | rebase = | ||
=Checkout= | =Checkout= | ||
Prepare a new directory, which will be the common parent directory for multiple trees. Then use multiple commands for the initial checkout code. | Prepare a new directory, which will be the common parent directory for multiple trees. Then use multiple commands for the initial checkout code. | ||
mkdir workarea | mkdir workarea | ||
| Line 29: | Line 25: | ||
hg clone https://hg.mozilla.org/projects/nspr | hg clone https://hg.mozilla.org/projects/nspr | ||
hg clone https://hg.mozilla.org/projects/nss | hg clone https://hg.mozilla.org/projects/nss | ||
# optional: get jss | # optional: get jss | ||
hg clone https://hg.mozilla.org/projects/jss | hg clone https://hg.mozilla.org/projects/jss | ||
=Building= | =Building= | ||
| Line 40: | Line 35: | ||
cd workarea/nss | cd workarea/nss | ||
make nss_build_all | make nss_build_all | ||
# optional: jss | # optional: jss | ||
cd workarea/jss | cd workarea/jss | ||
make | make | ||
=Output files= | =Output files= | ||
| Line 67: | Line 61: | ||
perl all.pl dist $DISTDIR/$PLATFORM | perl all.pl dist $DISTDIR/$PLATFORM | ||
=Updating= | |||
In order to retrieve new updates from the central HG repository, you can use | |||
hg pull -u | |||
in each of the subdirectories that you have cloned. However, for two reasons it's helpful to use a small script that can be placed into your workarea directory: | |||
* it's inconvenient running the command multiple times in each subdirectory | |||
* it's likely that you'll sooner or later appreciate the MQ extension, which enables you to work with queues of patches. | |||
= | You could create a file workarea/fetch.sh with the following contents: | ||
cd nspr | |||
QAP=`hg qapplied | wc -l` | |||
if [ "$QAP" -ne "0" ] ; then | |||
echo "You have mq patches applied! Better qpop them before fetching, to avoid chaos!!! Exiting." | |||
exit 0 | |||
fi | |||
cd .. | |||
cd nss | |||
QAP=`hg qapplied | wc -l` | |||
if [ "$QAP" -ne "0" ] ; then | |||
echo "You have mq patches applied! Better qpop them before fetching, to avoid chaos!!! Exiting." | |||
exit 0 | |||
fi | |||
cd .. | |||
# remove if you don't use jss | |||
cd jss | |||
QAP=`hg qapplied | wc -l` | |||
if [ "$QAP" -ne "0" ] ; then | |||
echo "You have mq patches applied! Better qpop them before fetching, to avoid chaos!!! Exiting." | |||
exit 0 | |||
fi | |||
cd .. | |||
echo "no mq patches applied, proceeding..." | |||
cd nspr | |||
hg pull -u -v | tee ../pull-nspr.log | |||
cd .. | |||
cd nss | |||
hg pull -u -v | tee ../pull-nss.log | |||
cd .. | |||
# remove if you don't use jss | |||
cd jss | |||
hg pull -u -v | tee ../pull-jss.log | |||
cd .. | |||
=Commit/Push= | |||
Before you can push your commits back to the central repository, you must manually configure (once) the .hg/hgrc file inside each repository. While you have cloned using https, and you will pull updates using https, you will push using ssh. | |||
[paths] | |||
default = http://hg.mozilla.org/projects/nspr/ | |||
default-push = ssh://your.email@address.domain@hg.mozilla.org/nspr/ | |||
[paths] | |||
default = http://hg.mozilla.org/projects/nss/ | |||
default-push = ssh://your.email@address.domain@hg.mozilla.org/nss/ | |||
[paths] | |||
default = http://hg.mozilla.org/projects/jss/ | |||
default-push = ssh://your.email@address.domain@hg.mozilla.org/jss/ | |||
=Playground= | =Playground= | ||
| Line 82: | Line 133: | ||
Contact kaie if you would like write access. | Contact kaie if you would like write access. | ||
=See also= | |||
* If you changing from NSS CVS to NSS HG see: [[NSS:UsingHG]] | |||
* Mozilla specific FAQs: https://developer.mozilla.org/en-US/docs/Mercurial_FAQ | |||
* General information about HG: http://mercurial.selenic.com/wiki/CvsConcepts | |||
[[Category:NSS]] | [[Category:NSS]] | ||