This is an experimental feature.  It is possible to lose your work when using mercurial and this is only recommended for advanced users. You can get into a LOT of trouble if you are working with multiple developers simultaneously. If you are working by yourself this is reasonably safe. Before you try the following it is highly recommended that you understand the basics of mercurial.

When mercurial support is enabled a mercurial repository will be created with each instance. When you push updates to the "default" branch of the repository these updates will automatically appear under htdocs/hg/[instance name]. The safest way to use this feature is to only push updates from your workstation. It is possible to make changes locally on the server and commit the changes via phpshell but this is dangerous (only recommended for "development" repositories). You also want to be really wary of adding/modifying files that are under the "hg" directory in "htdocs" unless you know what you're doing. Think of the "hg" directory under htdocs as "read-only" and you'll be safe (it's possible to mingle non-hg content, but you better understand what you're doing!).

If you want to have a "workflow" one option is to have 3 instances of "dev"/"test"/"production". You can actively muck with dev and push changes to "test" as things become stable and then push to production. This vastly over simplifies what is possible with hg, but it's a starting point.

Step 1: hg clone

From your splashpage URL find the hg URL and clone to your workstation.

[working]$ hg clone https://webhostXXX.kproxy.cornell.edu/hg/cornelldev
http authorization required
realm: KProxy (the Cornell Kerberos Proxy Gateway). Enter your NetID and password.
user: netid
password:
no changes found
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

Step 2: add files to local repo

The following creates a file "index.html" that contains "hello from git"

[cornelldev]$ echo "hello from mercurial" > index.html

Add the file into your local hg repo

[cornelldev]$ hg add index.html

Add a description of your new file

[cornelldev]$ hg commit -m 'added index.html'

Step 3: publish changes to server

The following will push the content up to the server and publish it add https://webhostXXX.hosting.cornell.edu:XXXX/hg/cornelldev (assuming the instance is named cornelldev)

[cornelldev]$ hg push
pushing to https://webhostXXX.kproxy.cornell.edu/hg/cornelldev
http authorization required
realm: KProxy (the Cornell Kerberos Proxy Gateway). Enter your NetID and password.
user: netid
password:
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
remote: 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
remote: pulling from /www/repos/hg/cornelldev
remote: requesting all changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
remote: (run 'hg update' to get a working copy)
remote: 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  • No labels