comparison mercurial/commands.py @ 10152:56284451a22c

Added support for templatevar "footer" to cmdutil.py
author Robert Bachmann <rbachm@gmail.com>
date Mon, 28 Dec 2009 17:55:52 +0100
parents 27457d31ae3f
children f5e55f1ca927
comparison
equal deleted inserted replaced
10151:c7355a0e1f39 10152:56284451a22c
304 else: 304 else:
305 ui.write(_("Due to skipped revisions, the first " 305 ui.write(_("Due to skipped revisions, the first "
306 "bad revision could be any of:\n")) 306 "bad revision could be any of:\n"))
307 for n in nodes: 307 for n in nodes:
308 displayer.show(repo[n]) 308 displayer.show(repo[n])
309 displayer.close()
309 310
310 def check_state(state, interactive=True): 311 def check_state(state, interactive=True):
311 if not state['good'] or not state['bad']: 312 if not state['good'] or not state['bad']:
312 if (good or bad or skip or reset) and interactive: 313 if (good or bad or skip or reset) and interactive:
313 return 314 return
1441 if not heads: 1442 if not heads:
1442 return 1 1443 return 1
1443 displayer = cmdutil.show_changeset(ui, repo, opts) 1444 displayer = cmdutil.show_changeset(ui, repo, opts)
1444 for n in heads: 1445 for n in heads:
1445 displayer.show(repo[n]) 1446 displayer.show(repo[n])
1447 displayer.close()
1446 1448
1447 def help_(ui, name=None, with_version=False): 1449 def help_(ui, name=None, with_version=False):
1448 """show help for a given topic or a help overview 1450 """show help for a given topic or a help overview
1449 1451
1450 With no arguments, print a list of commands with short help messages. 1452 With no arguments, print a list of commands with short help messages.
1929 parents = [p for p in other.changelog.parents(n) if p != nullid] 1931 parents = [p for p in other.changelog.parents(n) if p != nullid]
1930 if opts.get('no_merges') and len(parents) == 2: 1932 if opts.get('no_merges') and len(parents) == 2:
1931 continue 1933 continue
1932 count += 1 1934 count += 1
1933 displayer.show(other[n]) 1935 displayer.show(other[n])
1936 displayer.close()
1934 finally: 1937 finally:
1935 if hasattr(other, 'close'): 1938 if hasattr(other, 'close'):
1936 other.close() 1939 other.close()
1937 if cleanup: 1940 if cleanup:
1938 os.unlink(cleanup) 1941 os.unlink(cleanup)
2064 for ctx in cmdutil.walkchangerevs(repo, matchfn, opts, prep): 2067 for ctx in cmdutil.walkchangerevs(repo, matchfn, opts, prep):
2065 if count == limit: 2068 if count == limit:
2066 break 2069 break
2067 if displayer.flush(ctx.rev()): 2070 if displayer.flush(ctx.rev()):
2068 count += 1 2071 count += 1
2072 displayer.close()
2069 2073
2070 def manifest(ui, repo, node=None, rev=None): 2074 def manifest(ui, repo, node=None, rev=None):
2071 """output the current or given revision of the project manifest 2075 """output the current or given revision of the project manifest
2072 2076
2073 Print a list of version controlled files for the given revision. 2077 Print a list of version controlled files for the given revision.
2146 roots, heads = [common.node()], [p2.node()] 2150 roots, heads = [common.node()], [p2.node()]
2147 displayer = cmdutil.show_changeset(ui, repo, opts) 2151 displayer = cmdutil.show_changeset(ui, repo, opts)
2148 for node in repo.changelog.nodesbetween(roots=roots, heads=heads)[0]: 2152 for node in repo.changelog.nodesbetween(roots=roots, heads=heads)[0]:
2149 if node not in roots: 2153 if node not in roots:
2150 displayer.show(repo[node]) 2154 displayer.show(repo[node])
2155 displayer.close()
2151 return 0 2156 return 0
2152 2157
2153 return hg.merge(repo, node, force=opts.get('force')) 2158 return hg.merge(repo, node, force=opts.get('force'))
2154 2159
2155 def outgoing(ui, repo, dest=None, **opts): 2160 def outgoing(ui, repo, dest=None, **opts):
2184 parents = [p for p in repo.changelog.parents(n) if p != nullid] 2189 parents = [p for p in repo.changelog.parents(n) if p != nullid]
2185 if opts.get('no_merges') and len(parents) == 2: 2190 if opts.get('no_merges') and len(parents) == 2:
2186 continue 2191 continue
2187 count += 1 2192 count += 1
2188 displayer.show(repo[n]) 2193 displayer.show(repo[n])
2194 displayer.close()
2189 2195
2190 def parents(ui, repo, file_=None, **opts): 2196 def parents(ui, repo, file_=None, **opts):
2191 """show the parents of the working directory or revision 2197 """show the parents of the working directory or revision
2192 2198
2193 Print the working directory's parent revisions. If a revision is 2199 Print the working directory's parent revisions. If a revision is
2224 2230
2225 displayer = cmdutil.show_changeset(ui, repo, opts) 2231 displayer = cmdutil.show_changeset(ui, repo, opts)
2226 for n in p: 2232 for n in p:
2227 if n != nullid: 2233 if n != nullid:
2228 displayer.show(repo[n]) 2234 displayer.show(repo[n])
2235 displayer.close()
2229 2236
2230 def paths(ui, repo, search=None): 2237 def paths(ui, repo, search=None):
2231 """show aliases for remote repositories 2238 """show aliases for remote repositories
2232 2239
2233 Show definition of symbolic path name NAME. If no name is given, 2240 Show definition of symbolic path name NAME. If no name is given,
3104 If you have just made a commit, that commit will be the tip. If 3111 If you have just made a commit, that commit will be the tip. If
3105 you have just pulled changes from another repository, the tip of 3112 you have just pulled changes from another repository, the tip of
3106 that repository becomes the current tip. The "tip" tag is special 3113 that repository becomes the current tip. The "tip" tag is special
3107 and cannot be renamed or assigned to a different changeset. 3114 and cannot be renamed or assigned to a different changeset.
3108 """ 3115 """
3109 cmdutil.show_changeset(ui, repo, opts).show(repo[len(repo) - 1]) 3116 displayer = cmdutil.show_changeset(ui, repo, opts)
3117 displayer.show(repo[len(repo) - 1])
3118 displayer.close()
3110 3119
3111 def unbundle(ui, repo, fname1, *fnames, **opts): 3120 def unbundle(ui, repo, fname1, *fnames, **opts):
3112 """apply one or more changegroup files 3121 """apply one or more changegroup files
3113 3122
3114 Apply one or more compressed changegroup files generated by the 3123 Apply one or more compressed changegroup files generated by the