Mercurial > hg-talk
view session1.sh @ 2:dd7a3a06dfe7
Add some stuff about help command to session1.sh
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Thu, 06 Nov 2014 16:48:08 -0500 |
parents | 882028e37e4a |
children | 4f46f63130a6 |
line wrap: on
line source
#doitlive commentecho: true #doitlive prompt: {user.blue}@{TTY.MAGENTA}mtlpyladies{TTY.RESET}:{dir.green}$ #First, what is hg? hg hg help #doitlive pause: #To read the help of a particular command... hg help init #doitlive pause: #Let's do some configging! hg config --edit #And our first repo hg init planets cd planets #Work on our first file echo "Cold and dry, but everything is my favorite color" > mars.txt ls cat mars.txt # #Several ways to get information about our current state hg summary hg status hg diff # #Add the file hg add mars.txt # #Let's see how the information changed! hg summary hg status hg diff # #And we commit the file hg commit -m "Starting to think about Mars" hg summary hg status hg diff # #Most excitingly, we have a log! hg log echo "The two moons may be a problem for Wolfman" >> mars.txt #Adding more changes will show up differently hg summary hg status hg diff hg commit -m "Concerns about Mars's moons on my furry friend" hg log #Another change, this time adding another file... echo "But the Mummy will appreciate the lack of humidity" >> mars.txt echo "That big red spot is quite the storm." >> jupiter.txt hg add jupiter.txt ls hg diff hg commit -m "Thoughts about the climate" #Now that we have some history to speak of, let's explore it. hg log --patch --verbose --graph hg log -pvG hg glog -pv hg glog --patch --verbose --rev 1 hg glog -pvr 1 hg diff -r 0 -r 2 hg diff -r 1 -r 2 hg diff --change 2 hg diff -c 2 hg annotate mars.txt hg ann --user --date --number --changeset mars.txt hg ann -udnc --quiet mars.txt #Let's make some mistakes... echo "We will need to manufacture our own oxygen" >> mars.txt hg diff #Nah, never mind, we don't want to record this change, let's just throw it out hg revert mars.txt hg diff #Y'know what, let's actually restore this file to an older version hg rev -r 0 mars.txt hg diff #Hm, but why does that look changed? hg rev mars.txt #Let's *move* around the history instead of just changing individual files hg update --rev 0 cat mars.txt hg summ hg glog hg up -r 1 cat mars.txt hg summ hg glog