#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

#doitlive pause: 
#Several ways to get information about our current state
hg summary
hg status
hg diff

#doitlive pause:
#Add the file
hg add mars.txt

#doitlive pause:
#Let's see how the information changed!
hg summary
hg status
hg diff

#doitlive pause:
#And we commit the file
hg commit -m "Starting to think about Mars"

hg summary
hg status
hg diff

#doitlive pause:
#Most excitingly, we have a log!
hg log

echo "The two moons may be a problem for Wolfman" >> mars.txt

#doitlive pause:
#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

#doitlive pause:
#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"

#doitlive pause:
#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

#doitlive pause:
#Let's make some mistakes...
echo "We will need to manufacture our own oxygen" >> mars.txt
hg diff

#doitlive pause:
#Nah, never mind, we don't want to record this change, let's just throw it out
hg revert mars.txt
hg diff

#doitlive pause:
#Y'know what, let's actually restore this file to an older version
hg rev -r 0 mars.txt
hg diff

#doitlive pause:
#Hm, but why does that look changed?
hg rev mars.txt

#doitlive pause:
#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
