100 opmap = [['user', getname], ['number', str], ['changeset', getnode]] |
100 opmap = [['user', getname], ['number', str], ['changeset', getnode]] |
101 if not ops['user'] and not ops['changeset']: |
101 if not ops['user'] and not ops['changeset']: |
102 ops['number'] = 1 |
102 ops['number'] = 1 |
103 |
103 |
104 args = relpath(repo, args) |
104 args = relpath(repo, args) |
105 node = repo.current |
105 node = repo.dirstate.parents()[0] |
106 if ops['revision']: |
106 if ops['revision']: |
107 node = repo.changelog.lookup(ops['revision']) |
107 node = repo.changelog.lookup(ops['revision']) |
108 change = repo.changelog.read(node) |
108 change = repo.changelog.read(node) |
109 mmap = repo.manifest.read(change[0]) |
109 mmap = repo.manifest.read(change[0]) |
110 maxuserlen = 0 |
110 maxuserlen = 0 |
140 time.localtime(float(changes[2].split(' ')[0]))) |
140 time.localtime(float(changes[2].split(' ')[0]))) |
141 if ui.verbose: print "files:", " ".join(changes[3]) |
141 if ui.verbose: print "files:", " ".join(changes[3]) |
142 print "description:" |
142 print "description:" |
143 print changes[4] |
143 print changes[4] |
144 |
144 |
|
145 def parents(ui, repo, node = None): |
|
146 '''show the parents of the current working dir''' |
|
147 if node: |
|
148 p = repo.changelog.parents(repo.lookup(hg.bin(node))) |
|
149 else: |
|
150 p = repo.dirstate.parents() |
|
151 |
|
152 for n in p: |
|
153 if n != hg.nullid: |
|
154 ui.write("%d:%s\n" % (repo.changelog.rev(n), hg.hex(n))) |
|
155 |
145 def status(ui, repo): |
156 def status(ui, repo): |
146 '''show changed files in the working directory |
157 '''show changed files in the working directory |
147 |
158 |
148 C = changed |
159 C = changed |
149 A = added |
160 A = added |
170 [('r', 'revision', '', 'revision'), |
181 [('r', 'revision', '', 'revision'), |
171 ('u', 'user', None, 'show user'), |
182 ('u', 'user', None, 'show user'), |
172 ('n', 'number', None, 'show revision number'), |
183 ('n', 'number', None, 'show revision number'), |
173 ('c', 'changeset', None, 'show changeset')], |
184 ('c', 'changeset', None, 'show changeset')], |
174 'hg annotate [-u] [-c] [-n] [-r id] [files]'), |
185 'hg annotate [-u] [-c] [-n] [-r id] [files]'), |
|
186 "parents": (parents, [], 'hg parents [node]'), |
175 "status": (status, [], 'hg status'), |
187 "status": (status, [], 'hg status'), |
176 "undo": (undo, [], 'hg undo'), |
188 "undo": (undo, [], 'hg undo'), |
177 } |
189 } |
178 |
190 |
179 norepo = "init branch help" |
191 norepo = "init branch help" |