Free and Open Source real time strategy game with a new take on micro-management

Difference between revisions of "User:Giszmo/hgsession1"

From Globulation2

Jump to: navigation, search
(No difference)

Revision as of 02:48, 27 January 2008

Example session

Get glob2 repository

Get all that there is both source and binary data like pictures and sounds.

cd ~/projects/
hg clone http://hg.globulation2.org/glob2/ glob2

get a working directory

hg clone -r unitAssignmentByLeo glob2 hgtest
cd hgtest
hg update -r unitAssignmentByLeo

modify

create a new file

echo "only a test" > hgdemo.txt
echo "only a test" > hgdemo2.txt

put the new files under the control of hg

hg add hgdemo*.txt

create a new changeset. (one changeset may contain several changes to files. If we hg remove the files again before we commit we will be told there's nothing to commit.

hg commit -m "added a file to show how hg works"

pull changes in the main branch called "default" into this branch

hg pull -r default ../glob2
hg merge
hg commit -m "merged default"

undo file changes

hg remove hgdemo*.txt
hg commit -m "removed demo files again"

push to local main repository

hg push -r unitAssignmentByLeo ../glob2

push to online repository

After checking with "hg history", "hg view" and "hg serve" that everything looks like I want (especially the branch of my changesets should not be "default" for now) I can push it to the server:

cd ../glob2/
hg push -r unitAssignmentByLeo https://hg.globulation2.org/glob2/

some great commands

start a server to inspect your repository using

sudo hg serve -p 80

a structural view of the merges is best represented by

hg view

to see the branches, too use

hg history -l 10

a full transcript of this example

leo@Nemo:~/projects$  hg clone -r unitAssignmentByLeo glob2 hgtest
requesting all changes
adding changesets
adding manifests
adding file changes
added 2968 changesets with 12911 changes to 696 files
411 files updated, 0 files merged, 0 files removed, 0 files unresolved
leo@Nemo:~/projects$  cd hgtest
leo@Nemo:~/projects/hgtest$  echo "only a test" > hgdemo.txt
leo@Nemo:~/projects/hgtest$  echo "only a test" > hgdemo2.txt
leo@Nemo:~/projects/hgtest$  hg add hgdemo*.txt
leo@Nemo:~/projects/hgtest$  hg commit -m "added a file to show how hg works"
leo@Nemo:~/projects/hgtest$ hg pull -r default ../glob2
pulling from ../glob2
searching for changes
no changes found
leo@Nemo:~/projects/hgtest$ hg update -C
1820 files updated, 0 files merged, 5 files removed, 0 files unresolved
leo@Nemo:~/projects/hgtest$ hg remove hgdemo*.txt
leo@Nemo:~/projects/hgtest$ hg commit -m "removed demo files again"
leo@Nemo:~/projects/hgtest$ hg push -r unitAssignmentByLeo ../glob2
pushing to ../glob2
searching for changes
note: unsynced remote changes!
adding changesets
adding manifests
adding file changes
added 1 changesets with 0 changes to 0 files
leo@Nemo:~/projects/hgtest$ hg branch
unitAssignmentByLeo
leo@Nemo:~/projects/hgtest$ cd ../glob2/
leo@Nemo:~/projects/glob2$ hg history -l 4
changeset:   3037:386605b3d592
branch:      unitAssignmentByLeo
tag:         tip
user:        leo <leo.wandersleb@gmx.de>
date:        Sun Jan 27 03:23:48 2008 +0100
summary:     removed demo files again

changeset:   3036:b088f08f9787
branch:      unitAssignmentByLeo
parent:      3035:a581b9697809
parent:      3034:74c0094d81d9
user:        leo <leo.wandersleb@gmx.de>
date:        Sun Jan 27 03:05:33 2008 +0100
summary:     merged default

changeset:   3035:a581b9697809
branch:      unitAssignmentByLeo
parent:      3014:a753a0366f75
user:        leo <leo.wandersleb@gmx.de>
date:        Sun Jan 27 03:04:09 2008 +0100
summary:     added a file to show how hg works

changeset:   3034:74c0094d81d9
user:        Stephane Magnenat <stephane at magnenat dot net>
date:        Sun Jan 20 20:31:21 2008 +0100
summary:     Added iterators in the direction of a clean structure for collections

leo@Nemo:~/projects/glob2$ hg push -r unitAssignmentByLeo https://hg.globulation2.org/glob2/
pushing to https://hg.globulation2.org/glob2/
http authorization required
realm: Enter your globulation 2 mercurial username
user: leo
password:
searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 11 changes to 11 files (-1 heads)
Misc