Vertion control - Mercurial
מערכת ניהול גירסאות
המשמעות היא שמערכת מאפשרת לעקוב גירסאות ושינויים מרובים של אותה יחידת מידע. ישנן מערכות רבות שכוללות מעקב אחרי שינויים והשוואה לגרסאות קודמות (ממש כמו: "מעקב אחרי שינויים" במסמי Word) . מערכות ניהול גרסאות כדוגאמת Mercurial מספקות מאפשרות יכולות עשירות יותר, כגון מספר גרסאות במקביל ומיזוג שינויים של משתמשים שונים. Mercurial Program manegmentShapedo visualize version control on 3D models and make it easier to understand
To install Mercurial and to add this year archive flow the FabLab Wiki
DON'T FORGET NEVER FORCE PUSH, IF YOU ARE NOT SURE WHAT TO DO CHECK ON THE TUTORIALS OR ASK
מידע נוסף והסבר על מערכת ניהול הגירסאות Mercurial ניתן למצא באתר Hg Init
This year we are using the FabAcademy servers and not MIT's remeber that when you install Mercurial on your computer
add your files to the folder
hg commit -m “meangingful message”
Mercurial Cheat Sheet [from AKF Tutorial]
If you have added content to your archive
Check to see what files you have added to your copy of the archive before committing. After typing hg status, there will be a list of the files that you added. Make sure that you are not adding huge files. If a file is large, you can delete it.
If you delete a tracked file from the archive:
hg rm -A
You will get a long list of files – do not be alarmed. This will remove the deleted files in all directories.
To commit the files after you are finished with your change:
hg commit -m “meangingful message”
|To get content from the global archive:||
After pulling – carefully read the messages that Mecrual gives you and respond to them.
If you do not understand the messages, look at this guide: Mercurial Troubleshooting
After responding to and resolving all the messages from the pull – you can push your committed changes to the global copy of the archive
Never, ever, EVER use push -f to force. You will regret it.
If you get messages from Mercurial – read and respond to them. If you do not understand the messages, look at this guide: Mercurial Troubleshooting
Mercurial Troubleshooting [from AKF Tutorial]
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|
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:
- 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
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:
- 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.
! 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.
$ hg pull
pulling from ssh://[email protected]/academy
searching for changes
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)
- Mercurial will list heads .
$ hg heads
user: username <[email protected]>
date: Thu Feb 03 13:40:38 2011 +0100
user: Anna Kaziunas France <[email protected]>
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
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 headsif you can't get all the heads resolved or the error messages - re-clone the archive.
- delete the "academy" directory
- re-initialize the hg repository:
hg init- The rest of the instructions are here
- follow steps 5 to the end of the tutorial.
$ 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"