Commit Graph

11220 Commits

Author SHA1 Message Date
Aaron Jensen
9aca899376 hgweb: adding branch, tags, bookmarks, user, and file list to rss feed entries 2014-04-16 09:32:04 -07:00
Aaron Jensen
294492a1d9 hgweb: adding branch, tags, bookmarks, user, and file list to atom feed entries 2014-04-16 09:31:37 -07:00
FUJIWARA Katsunori
63865524f1 outgoing: introduce "outgoinghooks" to avoid redundant outgoing check
This patch introduces "outgoinghooks" to avoid redundant outgoing
check for "hg outgoing" in other than "commands.outgoing" (or utility
functions used by it).
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
f962e484fd hg: make "_outgoing()" return peer object for remote repository
This patch makes "_outgoing()" return peer object for remote
repository, to avoid re-execution "expandpath()", "parseurl()", and
"peer()" on caller side for specified URL.
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
7c3a219e15 hg: make "_outgoing()" return empty list instead of "None"
This patch makes "_outgoing()" return empty list instead of "None", if
there are no outgoing changesets, because:

  - returning "None" requires callers to examine whether returned
    value is "None" or not explicitly, if callers want to execute loop
    on returned value, but

  - there are no explicit needs to return "None"
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
090a597dc7 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".
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
18631f0006 util: enable "hooks" to return list of the values returned from each hooks 2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
16b89197f7 summary: separate checking incoming/outgoing and showing remote summary
This patch separates checking incoming/outgoing and showing remote
summary, as a preparation for refactoring in succeeding patches,
because:

  - checking incoming/outgoing may be needed, even if "--remote" is
    not specified for "hg summary"

  - checking incoming/outgoing may not be needed simultaneously

"hg summary --large" without "--remote" is typical case for these.
2014-04-16 00:37:24 +09:00
FUJIWARA Katsunori
7b1e8194b5 localrepo: introduce "prepushoutgoinghooks" to extend outgoing check easily
This patch introduces "prepushoutgoinghooks" to extend outgoing check
before pushing changesets to remote easily.

This chooses the function returning "util.hooks" instead of the one to
be overridden.

The latter may cause problems silently, if one of overriders forgets
(or fails) to execute a kind of "super(xxx, self).overridden(...)". In
the other hand, the former can ensure that all registered functions
are invoked, unless one of them raises an exception.
2014-04-16 00:37:24 +09:00
Matt Harbison
615b124547 cat: support cat with explicit paths in subrepos
The cat command with an explicit path into a subrepo is now handled by invoking
cat on the file, from that subrepo.  The previous behavior was to complain that
the file didn't exist in the revision (of the top most repo).  Now when the file
is actually missing, the revision of the subrepo is named instead (though it is
probably desirable to continue naming the top level repo).

The documented output formatters %d and %p reflect the path from the top level
repo, since the purpose of this is to give the illusion of a unified repository.
Support for the undocumented (for cat) formatters %H, %R, %h, %m and %r was
added long ago (I tested back as far as 0.5), but unfortunately these will
reflect the subrepo node instead of the parent context.

The previous implementation was a bit loose with the return value, i.e. it would
return 0 if _any_ file requested was cat'd successfully.  This maintains that
behavior.
2014-03-14 21:32:05 -04:00
Matt Harbison
cb793b21fa cat: move most of the implementation into cmdutils.cat()
This will allow access to the reusable parts from subrepos, similar to add(),
forget(), etc.
2014-03-13 23:45:18 -04:00
FUJIWARA Katsunori
6737a23301 amend: invoke editor forcibly when "--edit" option is specified
1fc59036a99b introduces "--edit" option into "hg commit", but it
doesn't work for "hg commit --amend", because 1fc59036a99b prepares
for editor invocation only around "commitfunc()" internal function,
which is used only for temporary amend commit by "cmdutil.amend()".

Actual commit message editing is executed in "cmdutil.amend()".

This patch invokes editor forcibly when "--edit" option is specified
for "hg commit --amend", even if commit message is specified
explicitly by "--message" or "--logfile".

This patch also removes useless handling for commit message and editor
invocation around "commitfunc()" internal function.
2014-04-16 02:38:11 +09:00
FUJIWARA Katsunori
c448280b69 commit: abolish useless "--force-editor" internal option for "hg commit"
"--force-editor" option for "hg commit" has been useless since
074e6345f65e, which makes "commands.tag()" invoke "cmdutil.commit()"
directly instead of "commands.commit()" with "--force-editor" internal
option.

This patch abolishes useless "--force-editor" internal option for "hg
commit".
2014-04-16 02:04:41 +09:00
Matt Mackall
404e995f87 subrepo: return non-zero exit code when a subrepo push doesn't succeed 2014-04-15 14:15:35 -04:00
Matt Mackall
ca3a6376d7 debugrevlog: use unfiltered view for changelog 2014-04-14 23:27:31 -04:00
Mads Kiilerich
dde33b4102 debugrevlog: format columns (more) nicely when dumping index data 2014-03-19 00:13:38 +01:00
Gregory Szorc
d620dd5f0f branchmap: log events related to branch cache
The blackblox log will now contain log events when the branch caches are
updated and written.
2014-03-22 17:14:37 -07:00
Gregory Szorc
0a33c75296 tags: log events related to tags cache
We now log when .hg/cache/tags data is built from scratch by reading
manifests and when the file is written.
2014-04-14 11:50:05 -07:00
Mads Kiilerich
020377d078 dirstate: inline local finish function
Having it as a local function adds no value.
2013-04-27 23:19:52 +02:00
Mads Kiilerich
2572d4c880 demandimport: make it possible to disable by setting HGDEMANDIMPORT=disable
Convenient for debugging weird problems that are caused by demandimport or
obfuscated by it.

This is an undocumented developer feature.
2014-04-08 01:35:13 +02:00
Mads Kiilerich
0e8795ccd6 spelling: fixes from spell checker 2014-04-13 19:01:00 +02:00
Bradley M. Kuhn
4cd8c219ba commit: --edit/-e to force edit of otherwise-supplied commit message
The --edit/-e option for the 'commit' command forces editor, even when a
commit message has been provided already by other means, such as by the -m or
-l options.
2013-09-08 19:02:08 -04:00
Pierre-Yves David
75b8e03941 bundle2: directly feed part to readbundle
Now that part payload can be read like a stream, we can directly use it to feed
the unbundle10 process.
2014-04-12 00:38:15 -04:00
Pierre-Yves David
acbb6d4494 bundle2: lazy unbundle of part payload
The `unbundle` part gains a `read` method to retrieve payload content.
This method behaves as a python file-like read method.

The bundle-processing code is updated to make sure a part is fully consumed before
another one is extracted.

Test output changes because the debug output is even more interleaved now.
2014-04-11 16:05:22 -04:00
Pierre-Yves David
a04ebd710a util: support None size in chunkbuffer.read()
When no size is provided, read the whole buffer. This aligns with the usual
behavior of `read()` in python.
2014-04-10 22:10:26 -07:00
Pierre-Yves David
1726c7ed72 bundle2: move unpackheader closure into the class
With the same argument as the other one, we move this closure into the
`unbundlepart` class.
2014-04-11 15:47:38 -04:00
Pierre-Yves David
a5bcb69da6 bundle2: move the fromheader closure into the class itself
The class is now directly related to this header data. We can sanely move it on
the class.

I do not like closures very much...
2014-04-11 15:46:09 -04:00
Pierre-Yves David
0819f89a04 bundle2: add an unbundle part responsible from unbundling part
We have a new unbundle class and it is now responsible from extracting its own
data. The top level bundler only extracts the header (to detect an end of stream
marker) then leaves everything else to the `unbundlepart` class. The ultimate
goal is to have `unbundlepart` responsible for lazily extracting its payload.

This is mostly code movement.
2014-04-11 15:43:16 -04:00
Pierre-Yves David
10657d6382 bundle2: extract stream/unpack logic in an unpackermixin
The coming `unbundlepart` will need the same kind of method than `unbundle20`
for unpacking data from the stream. We extract them into a mixin class before
the creation of `unbundlepart`.
2014-04-11 15:19:54 -04:00
Pierre-Yves David
9498b02a99 exchange: restore truncated comment
The old version of this comment appeared to have been trunca
2014-04-13 12:21:09 -04:00
Takumi IINO
108a15e83e grep: highlight all matched words
"hg grep" highlights first matched word only.
This behavior is different from GNU grep.

This patch makes highlight all matched words.
2014-03-31 01:00:05 +09:00
Pierre-Yves David
e5b4ced868 bundle2: rename part to bundlepart
We are going to introduce an `unbundlepart` dedicated to reading bundle. So we
need to rename the one used to create bundle. Even if dedicated to creation, this
is still used for unbundling until we get the new class.
2014-04-11 07:36:14 -07:00
Pierre-Yves David
ef4a1b021a bundle2: comment to clarify why the handler call is where it is
The reason why it is here is not obvious. I'm the one who wrote it there in the
first place and almost moved it 2 weeks later.
2014-04-11 16:43:01 -04:00
Pierre-Yves David
f1960c11a4 bundle2: use chunkbuffer for exchange.getbundle
We can use `util.chunkbuffer` instead.
2014-04-12 00:53:15 -04:00
Pierre-Yves David
a90efe54ad bundle2: lazily generate the changegroup part in exchange.getbundle
Now that we have lazy generation of parts, let's use it.
2014-04-12 14:56:55 -04:00
Pierre-Yves David
be93303ad1 bundle2: support chunk iterator as part data
When the `part.data` attribute is an iterator, we assume it is an iterator of
chunks and use it.

We use a chunkbuffer to yield chunks of 4096 bytes.

The tests are updated to use this feature.
2014-04-11 08:04:16 -07:00
Pierre-Yves David
2cfe67ddd2 bundle2: extract a _payloadchunks method for part
We are preparing streaming capability for part. So the generation of payload
chunk will becomes more complex. We extract this part in its own function before
any changes.
2014-04-10 12:33:20 -07:00
Pierre-Yves David
a8e05fc7b8 changegroup: move chunk extraction into a getchunks method of unbundle10
This code used to be in `writebundle` only. We needs to make it more broadly
available for bundle2. The "changegroup" bundle2 part has to retrieve the
binary content of changegroup stream. We moved the chunks retrieving code into
the `unbundle10` object directly and the `writebundle` code is now using that.

This split is useful for bundle2 purpose, we want to be able to easily stream
changegroup content in a part.

To keep thing simples, we kept compression out of the new methods. If it make
more sense in the future, compression may get included in this function too.
2014-04-10 13:19:00 -07:00
Pierre-Yves David
c4bb78d90c bundle2: use reply part to return result of addchangegroup
We now have an official way to return the result of addchangegroup. The tests are
updated to check that the return bundle is properly created. It will be used
when push is bundle2 enabled.
2014-03-25 15:05:11 -07:00
Pierre-Yves David
e46e61d8b1 bundle2: produce a bundle2 reply
We do not know yet what kind of data future features and extensions will need to
exchange. To handle that, bundle2 allows to send arbitrary content to the
server. As a consequence, we need to be able to reply arbitrary content to the
client. And, we can use bundle2 to transmit those arbitrary data.

When a client will push a bundle2 to the server, the server will reply with a
bundle2 itself.

This changeset installs the first stone of this logic and test it.
2014-04-04 14:24:11 -07:00
Pierre-Yves David
90cfb42a5c bundle2: add reply awareness to unbundlerecords
We need an efficient way to handle bundle replies. The unbundle records class is
extended to carry such data.
2014-04-11 08:24:59 -07:00
Pierre-Yves David
311fe283fd bundle2: add an integer id to part
For sending response to a pushed bundle, we need to link reply parts to request
part. We introduce a part id for this purpose. This is a 32 bit unique
integer stored in the header.
2014-04-01 00:07:17 -07:00
Mads Kiilerich
b117005b7c revlog: use context ancestor instead of changelog ancestor
We want to move in this direction.
2014-04-07 23:17:51 +02:00
Mads Kiilerich
c55887b864 copies: guard debug section with ui.debugflag 2014-02-25 20:31:53 +01:00
Mads Kiilerich
210347bb4f copies: remove _checkcopies wrapper - it does no good
mergecopies might be doomed but it is not dead yet ...
2014-02-25 20:31:51 +01:00
Mads Kiilerich
861f191408 commit: use revlog.commonancestors instead of .ancestor
This do probably not make any real difference but is slightly more correct and
we would like to get rid of flog.ancestor.
2014-04-07 23:17:51 +02:00
Mads Kiilerich
723c536d44 backout: don't limit heritage check to a single ancestor
This do probably not make any real difference but is slightly more correct and
we would like to get rid of changelog.ancestor.
2014-04-07 23:17:51 +02:00
Mads Kiilerich
421298c7fe ancestor: remove unused genericancestor 2014-03-20 01:35:07 +01:00
Mads Kiilerich
c951e7f8b6 context: remove unused filectx.ancestor 2014-04-07 23:17:48 +02:00
FUJIWARA Katsunori
a40858d014 bundlerepo: treat temporarily extracted bundle file via vfs 2014-03-09 01:03:28 +09:00