7. $ rc status
Modified: 2009-12-11.txt
$ rc commit -m "It's called a Chinese
White Pear not a Apple Pear Chinese Fruit"
8. $ rc diff -r 1
diff -r 1 2009-12-11.txt
--- a/2009-12-11.txt Thu Dec 03 15:45:38
+++ b/2009-12-11.txt Thu Dec 03 15:51:39
@@ -2,7 +2,7 @@
Oranges
Cherries
Milk
-Apple Pear Chinese Fruit
+Chinese White Pear
Noodles
Pomegranate
Strawberries
9. $ rc log
reversion: 1
author: Myles Braithwaite
summary: Added the Grocery List for Friday
11 Dec, 2009.
reversion: 2
author: Other Person
summary: It's called a Chinese White Pear
not a Apple Pear Chinese Fruit
14. $ rc commit -m 'Went to the Grocery store
and picked up Apples, Oranges, and
Cherries.'
The Repository is Out of Sync. Please
merge the new changes.
28. $ export P_DIR=~/GroceryList
$
$ # Create an empty repository on your
$ # local machine.
$ mkdir $P_DIR; cd $P_DIR
$ hg init
$
$ # Clone a remote repository.
$ hg clone ssh://hg.mb/grocery_list $P_DIR
destination directory: /home/m/GroveryList
...
3 files updated, 0 files merged, 0 files
removed, 0 files unresolved
29. $ echo 'Apple' > cat 2009-12-08.txt
$ hg status
? 2009-12-08.txt
$ hg add 2009-12-08.txt
$ hg status
A 2009-12-08.txt
$ hg commit -m 'Added the grocery list for
9th Dec. 2009.'
30. $ hg status
M 2009-12-08.txt
$ hg diff
diff -r 012549b5c017 2009-12-08.txt
--- a/2009-12-08.txt 19:42:25
+++ b/2009-12-08.txt 19:44:46
@@ -1,1 +1,2 @@
Apples
+Pizza
$ hg commit -m 'I am hungry for some
Pizza.'
31. $ hg log -l 2
changeset: 14:848072d17be0
tag: tip
user: Myles Braithwaite
date: 19:49:10
summary: I am hungry for some Pizza
changeset: 13:012549b5c017
user: Myles Braithwaite
date: 19:42:25
summary: Added the grocery list for
9th Dec. 2009.
32. $ hg annotate 2009-12-08.txt
13: Apples
14: Pizza
15: Nuts
16: Hot Chocolate Mix
33. $ hg tags
tip 16:54c53457b1ac
2009-12-04 9:d1361977c248
$ hg tag 2009-12-08
$ hg tags
tip 17:21598a08291c
2009-12-08 16:54c53457b1ac
2009-12-04 9:d1361977c248
35. # If we cloned the repository.
$ hg push
$ hg push ssh://hg.mb/grocery_list
36. $ hg pull ssh://hg.mb/grocery_list
pulling from ssh://hg.mb/grocery_list
searching for changes
...
(run 'hg update' to get a working copy)
$ hg update
1 files updated, 0 files merged, 0 files
removed, 0 files unresolved
37. $ hg log -l 2
changeset: 20:6dfef8e8a348
tag: tip
user: Other Person
summary: Remove some things fromthe
list that were already entered on Friday'
list.
changeset: 19:1564f5195566
date: 16:30:18
summary: Added a shopping list for
Sat. 12 Dec. 2009
39. $ # Using an extension we can call an
$ # external program to run the diff.
$ hg extdiff -p oodiff -r 19
--- GroceryList.1565f5195566/2009-12-12.odt
+++ GroveryList/2009-12-12.odt
@@ -1,12 +1,4 @@
- Oranges
-
- Apples
-
- Bananas
-
- Cereal
-
Cherios
Beer