Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 21047:f0003f989e72
summary: introduce "summaryremotehooks" to avoid redundant incoming/outgoing check
This patch introduces "summaryremotehooks" to avoid redundant
incoming/outgoing check for "hg summary" in other than
"commands.summary".
Only if "--remote" is not specified for "hg summary", hooks registered
in "summaryremotehooks" are invoked with "None" as "changes" argument
at first, and they should return tuple of two booleans meaning
"whether incomings are needed" and "whether outgoings are needed".
If no hooks return tuple containing "True", "hg summary" does nothing
any more, because incoming/outgoing check is not needed.
Otherwise, hooks are invoked again: at this time, "changes" argument
refers the result of incoming/outgoing check.
This patch also prevents RepoError from being raised if "--remote" is
not specified for "hg summary", because of backward compatibility for
"hg summary --large" without "--remote".
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 16 Apr 2014 00:37:24 +0900 |
parents | a2cc3c08c3ac |
children | 1004d3cd65fd |
comparison
equal
deleted
inserted
replaced
21046:cc13addbd62b | 21047:f0003f989e72 |
---|---|
2380 return cmd | 2380 return cmd |
2381 | 2381 |
2382 # a list of (ui, repo) functions called by commands.summary | 2382 # a list of (ui, repo) functions called by commands.summary |
2383 summaryhooks = util.hooks() | 2383 summaryhooks = util.hooks() |
2384 | 2384 |
2385 # a list of (ui, repo, opts, changes) functions called by commands.summary. | |
2386 # | |
2387 # functions should return tuple of booleans below, if 'changes' is None: | |
2388 # (whether-incomings-are-needed, whether-outgoings-are-needed) | |
2389 # | |
2390 # otherwise, 'changes' is a tuple of tuples below: | |
2391 # - (sourceurl, sourcebranch, sourcepeer, incoming) | |
2392 # - (desturl, destbranch, destpeer, outgoing) | |
2393 summaryremotehooks = util.hooks() | |
2394 | |
2385 # A list of state files kept by multistep operations like graft. | 2395 # A list of state files kept by multistep operations like graft. |
2386 # Since graft cannot be aborted, it is considered 'clearable' by update. | 2396 # Since graft cannot be aborted, it is considered 'clearable' by update. |
2387 # note: bisect is intentionally excluded | 2397 # note: bisect is intentionally excluded |
2388 # (state file, clearable, allowcommit, error, hint) | 2398 # (state file, clearable, allowcommit, error, hint) |
2389 unfinishedstates = [ | 2399 unfinishedstates = [ |