Skip navigation

Introductory Programming In Java

Use of Mercurial SCM to submit your work

Each of you are given a server repository on our partch machine (the very same which you can use to remotely login onto the student system via ssh u0123456@partch.anu.edu.au). Due to certain limitations, one can only use this repository (cloning from it and publishing to it) from the student system (your standard student account). Therefore, all instructions below are meant to be carried out from your student account.

The repository URL is:

	
     ssh://hg@partch.anu.edu.au/comp6700/u0123456
	

(where u0123456 should be replaced by your actual uni ID).

You should begin by cloning this (initially empty) repository into your local repository. I should stress that what is below referred to as local repository is NOT the local repository which you created with hg init and used in exercises of Lab 6.

Perform the following actions:

  1. Create a directory called mercurial inside your comp6700 general repository, change into it and clone the server repository:

    > mkdir -p ~/comp6700/mercurial && cd ~/comp6700/mercurial
    > hg clone ssh://hg@partch.anu.edu.au/comp6700/u0123456
    

    this will create a local repository (seen as the subdirectory u0123456) which is a carbon copy ("clone") of the repository on the partch server. The two repositories will be synchronised which is important since you will later push the local repository back to the server. This pushing will be your act of submitting.

  2. Nest change into the working directory of the local repository and create subdirectories for each item of work which will be submitted later:

    > cd u0123456
    > mkdir homework6 homework7 ass2
    
  3. Now you can copy files of your work on HW-6, HW-7 or Assignment 2 into the corresponding subdirectories. Let's say, the code from you HW-6 was located in the directory ~/comp6700/homeworks/hw6 and that those files were

    • ColouredShapes.java
    • SimpleTransitions.java
    • View.java
    • Model.java

    Copy them all into the homework6 subdirectory of the working copy; ie, without changing you location on the file system, execute the following command:

    > cp ~/comp6700/homeworks/hw6/*.java homework6/
    
  4. When you examine the status of your working directory, you will see that newly copied files are not yet under the Mercurial management:

    > hg st
    ? homework6/ColouredShapes.java
    ? homework6/SimpleTransitions.java
    ? homework6/View.java
    ? homework6/Model.java
    

    You need to bring them under the SCM control:

    > hg add homework6/*.java
    > hg st
    A homework6/ColouredShapes.java
    A homework6/SimpleTransitions.java
    A homework6/View.java
    A homework6/Model.java
    

    after which the files become a part of the SCM and will be included in the next commit.

  5. Commit them (if you've finalised your Homework 6 solutions):

    > hg ci -u u0123456 -m"My homework 6 solutions"
    
  6. The last step — submission. This is achieved by publishing (pushing) your local repository into the server repository from which you originally cloned:

    > hg push ssh://hg@partch.anu.edu.au/comp6700/u0123456
    

    This will accomplish the submission. I will later collect your work for marking by cloning your server directory the same way you did in the beginning. You can check the content of the server repository by cloning it again (like in the beginning) into a different local repository (use a temporary directory ~/tmp if you like to do this).

Perform similar actions later to submit your homework 7. This should be a report saved in a file called JavaNext.txt. The .txt extension indicates that this is a plain text file, which is a preferred format, but I will be equally content if you choose a .pdf or .html format (you decide).

For Assignment 2, everything is similar. Make only source files be managed by Mercurial, and try to preserve the directory structure as it was in the original ass2.zip archive; namely,

> ls ass2/src/dotsandboxes
DotsAndBoxes.java    Grid.java    Vertex.java    View.java

Of course, if you write new source files, add them too.

Because an assignment is a big (bigger) piece of work, you may commit your code to the local repository several times before you finish the work, and then push the local repository back to the server. By reading the logs, I will see the records of how your assignment work has been progressing.

Updated:  Tue 14 May 2013 01:03:20 EST Responsible Officer:   JavaScript must be enabled to display this email address. Page Contact:   Course Webmaster