Tutorials - Fab Academy at AS220 Labs - Providence, RI

Mercurial Troubleshooting:


Other Helpful Mercurial Tutorials

Push Messages

TAKE NOTE: If you try to push and Mercurial mentions:
- multiple branches
- multiple heads
- outstanding uncommitted changes
-archive has diverged
-or any other similar message

and then asks if you want to push anyway..

DON'T DO IT! This creates multiple heads.

After you give Mercurial a command, look at the output, read all the messages and respond to them.
These notes should help with some common problems we have all been having.

General Command Meanings:
pull pulls down current state of the archive (brings changes)
merge remote hg directory has new changes, if your local copy is an older version, merge reconciles them.
commit stores a "snapshot" of your copy of the archive
push sends changes back to central server we are all using (MIT copy)
update takes the changes and puts them in the working copy of the directory

If You Have Updated Files:

- If you added new work or updated files in the repository:
hg add
hg commit -m "your commit message here"
hg pull 
- if you get new stuff (files added) when / after pulling and Mercurial tells you that you need to merge.
- you need to merge:
hg merge 

If You Delete a Local File / Directory:

- You will need to tell Mercurial to "record a delete for missing files"
- You will run into problems if you don't do this!
- error depicted here:

hg add 
hg rm -A

- You will get a very long listing both of removed files and files that Mercurial says "still exist and will not be removed".


[many files listed above as "not removing"............]
not removing Web/videos/video/module_02.html: file still exists (use -f to force removal)
removing Web/labs/providence/anna_kaziunas_france/resources/html_workshop/ HTML_Basics_2.0.odp

--> do not force remove anything
- This is what should happen.

- Mecural is updating.

hg commit -m "your commit message here"
hg pull

Errors and Issues:

If the Archive Has Diverged:

You try to push and get:

"archive has diverged" message
"abort: push creates new remote heads on branch 'default'!"
"abort: crosses branches"
something similar to the above messages

- You need to Pull and Merge. DO NOT FORCE PUSH.

- First, pull to make sure you have an up to date copy of the archive.

hg pull 
- if you try to push and get: "abort: outstanding uncommitted changes (use 'hg status' to list changes)"
hg commit -m "your commit message here"
- You should check status:
hg status

- if you have a "!" in front front of a file or directory name in the status listing, it means you deleted a file that Mercurial is tracking.


$hg status
! Web/labs/providence/AnnaKaziunasFrance/resources/html_workshop/ HTML_Basics_2.0.odp
! Web/labs/providence/AnnaKaziunasFrance/resources/html_workshop/ HTML_Basics_2.0.pdf

- To fix this --> do the following:

hg add 
- tell Mercurial to record a delete for missing files
hg rm -A
hg commit -m "your commit message here"
hg pull

- if you get a message about "multiple heads" --> see next topic below.

If Mercurial Mentions "Multiple Heads":


$ hg pull
pulling from ssh://hg@fab.cba.mit.edu/academy
searching for changes
adding changesets
adding manifests
adding file changes
added 50 changesets with 162 changes to 113 files (+1 heads)
abort: crosses branches (merge branches or use --check to force update)
warning: changegroup hook exited with status 255
(run 'hg heads' to see heads, 'hg merge' to merge)

- First, list heads:
hg heads 

- Mercurial will list heads . Example:

$ hg heads
changeset: 480:00cdd8eef593
tag: tip
parent: 479:f09cf2bc12ba
parent: 476:e519545ebdd5
user: username <username@domaincom>
date: Thu Feb 03 13:40:38 2011 +0100
summary: merge

changeset: 430:da050aca6ab4
user: Anna Kaziunas France <anna@kaziunas.com>
date: Thu Feb 03 08:23:21 2011 -0500
summary: created external css for resources page

- To merge with one of these heads (you can have many heads) --> type the number after "changeset:"
- I have shown the number in bold so you can see them more easily.
- For example, to merge with head -->changeset: 480:00cdd8eef593
- type:

hg merge 480

- If there are multiple heads (more than one listed as the output of hg heads) you wil need to repeat the merge for each head until there is only one left.
-Then commit your changes:

hg commit -m "commit message"
hg push  
- don''t push if it says you shouldn't - "archive has diverged" - then pull instead.
hg pull
hg update
hg heads  
if you can't get all the heads resolved or the error messages - re-clone the archive.

To Re-Clone The Archive:

- if you have new work in your firstname_lastname directory, make a copy and save in a directory outside of the "academy" directory
- delete the "academy" directory
- re-initialize the hg repository:
hg init 
The rest of the instructions on how to reclone the are on this page

- follow step 5 to the end of the tutorial.

If You Get a "waiting for log on working directory" Message:

- use CONTROL + C to interrupt

.DS_Store Error - MAC only

- If you try to merge and get the following:
$ hg merge
local changed Web/labs/.DS_Store which remote deleted
(d)elete? ged version or

--> hit the <ENTER> key.
- Then commit the changes
hg commit -m "removed .DSstore file"