comparison text/learning_mercurial_in_workflows.txt @ 136:0364cfc00295

learning in workflows: Added identify and update to 'null'
author Arne Babenhauserheide <bab@draketo.de>
date Fri, 01 May 2009 15:07:56 +0200
parents 8d069bba8cce
children defbaee4011c
comparison
equal deleted inserted replaced
135:8d069bba8cce 136:0364cfc00295
105 105
106 To look at a previous version of your code, you can use update. Let's assume that you want to see revision 3. 106 To look at a previous version of your code, you can use update. Let's assume that you want to see revision 3.
107 107
108 $ hg update 3 108 $ hg update 3
109 109
110 Now your code is back at revision 3, the fourth commit (Mercurial starts couting at 0). 110 Now your code is back at revision 3, the fourth commit (Mercurial starts counting at 0).
111 To check if you're really at that revision, you can use "identify -n".
112
113 $ hg identify -n
114
115 Note: "identify" without options gives you the short form of a unique revision ID. That ID is what Mercurial uses internally. If you tell someone about the version you updated to, you should use that ID, since the numbers can be different for other people. If you want to know the reasons behind that, please read up Mercurials [basic concepts]().
111 116
112 To update to the most recent revision, you can use "tip" as revision name. 117 To update to the most recent revision, you can use "tip" as revision name.
113 118
114 $ hg update tip 119 $ hg update tip
115 120
116 Note: If at any place any command complains, your best bet is to read what it tells you and follow that advice. 121 Note: If at any place any command complains, your best bet is to read what it tells you and follow that advice.
117 122
118 Note: Instead of "hg update" you can also use the shorthand "hg up". Similarly you can abbreviate "hg commit" to "hg ci". 123 Note: Instead of "hg update" you can also use the shorthand "hg up". Similarly you can abbreviate "hg commit" to "hg ci".
124
125 Note: To get a revision devoid of files, just "update" to "null" via "hg update null". That's the revision before any files were added.
119 126
120 ==== Fixing errors in earlier revisions ==== 127 ==== Fixing errors in earlier revisions ====
121 128
122 When you find a bug in some earlier revision you have two options: eaither you can fix it in the current code, or you can go back in history and fix the code exactly where you did it. 129 When you find a bug in some earlier revision you have two options: eaither you can fix it in the current code, or you can go back in history and fix the code exactly where you did it.
123 130