Commit Graph

19709 Commits

Author SHA1 Message Date
Alexander Plavin
099a1df11b hgweb: call process_dates with a specified selector in ajax scroll
Now this function processes only newly added entries, and not old ones,
the amount of which can be much bigger.
2013-09-06 13:30:58 +04:00
Alexander Plavin
6ef3f6fe6f hgweb: add parentSelector argument to process_dates
Allow specifying parent selector of elements to process, useful for
incremental page updates.
2013-09-06 13:30:58 +04:00
Alexander Plavin
3fd64dca8e hgweb: optimize process_dates function
This function looped over every node due to getElementsByTagName('*'), instead
of using selectors. In this patch we use querySelectorAll('.age') and process
only these nodes, which is much faster and also doesn't require extra condition.

Browser compatibility isn't sacrificed: IE 8+, FF 3.5+, Opera 10+.
2013-09-06 13:30:58 +04:00
David Soria Parra
e6d74860f3 shelve: allow shelving of a change with an mq patch applied
We allow shelving of of changes on top of a MQ repository. MQ will
not allow repository changes on top of applied patches. We introduce
checkapplied in MQ to bypass this check.
2013-08-29 09:22:15 -07:00
David Soria Parra
db3958fb08 shelve: new output format for shelve listings
Use a more condensed and mercurial-like output format for shelve listing.
We don't prefix the message with 'shelved from...' anymore as our default
name contains the branch name or the user used his own name. To avoid
just printing the last commit message, we drop writing the description
to stdout.

old output:
  default         [1s ago]    shelved from default (01ba9745): create conflict

new output:
  default         (1s ago)    create conflict
2013-10-01 12:20:31 +02:00
David Soria Parra
72600cc4d7 shelve: add a shelve extension to save/restore working changes
This extension saves shelved changes using a temporary draft commit,
and bundles the temporary commit and its draft ancestors, then
strips them.

This strategy makes it possible to use Mercurial's bundle and merge
machinery to resolve conflicts if necessary when unshelving, even
when the destination commit or its ancestors have been amended,
squashed, or evolved. (Once a change has been unshelved, its
associated unbundled commits are either rolled back or stripped.)

Storing the shelved change as a bundle also avoids the difficulty
that hidden commits would cause, of making it impossible to amend
the parent if it is a draft commits (a common scenario).

Although this extension shares its name and some functionality with
the third party hgshelve extension, it has little else in common.
Notably, the hgshelve extension shelves changes as unified diffs,
which makes conflict resolution a matter of finding .rej files and
conflict markers, and cleaning up the mess by hand.

We do not yet allow hunk-level choosing of changes to record.
Compared to the hgshelve extension, this is a small regression in
usability, but we hope to integrate that at a later point, once the
record machinery becomes more reusable and robust.
2013-08-29 09:22:13 -07:00
David Soria Parra
f7b7fb2df4 localrepo: make report level in repo.transaction configurable
repo.transaction always writes to stderr when a transaction aborts. In order to
be able to abort a transaction quietly (e.g shelve needs a temporary view on
the repo) we need to make the report level configurable.
2013-10-01 12:20:29 +02:00
Matt Mackall
7b8a7d221c merge with stable 2013-10-01 17:00:03 -07:00
Matt Mackall
c72f362937 Added signature for changeset 318f4da8654e 2013-10-01 16:55:20 -07:00
Matt Mackall
109ea868bf merge with stable 2013-10-01 10:44:59 -07:00
FUJIWARA Katsunori
e4f428fc17 rebase: catch RepoLookupError at restoring rebase state for summary
Before this patch, "hg summary" may fail, when there is inconsistent
rebase state: for example, the root of rebase destination revisions
recorded in rebase state file is already stripped manually.

Mercurial earlier than 2.7 allows users to do anything other than
starting new rebase, even though current rebase is not finished or
aborted yet. So, such inconsistent rebase states may be left and
forgotten in repositories.

This patch catches RepoLookupError at restoring rebase state for
summary hook, and treat such state as "broken".
2013-10-01 00:35:07 +09:00
FUJIWARA Katsunori
d2e5b13e64 rebase: catch RepoLookupError at restoring rebase state for abort/continue
Before this patch, "rebase --abort"/"--continue" may fail, when rebase
state is inconsistent: for example, the root of rebase destination
revisions recorded in rebase state file is already stripped manually.

Mercurial earlier than 2.7 allows users to do anything other than
starting new rebase, even though current rebase is not finished or
aborted yet. So, such inconsistent rebase states may be left and
forgotten in repositories.

This patch catches RepoLookupError at restoring rebase state for
abort/continue, and treat such state as "broken".
2013-10-01 00:35:07 +09:00
FUJIWARA Katsunori
da45f9c6a0 histedit: suggest "histedit --abort" for inconsistent histedit state
Mercurial earlier than 2.7 allows users to do anything other than
starting new histedit, even though current histedit is not finished or
aborted yet. So, unfinished (and maybe inconsistent now) histedit
states may be left and forgotten in repositories.

Before this patch, histedit extension shows the message below, when it
detects such inconsistent state:

   abort: REV is not an ancestor of working directory
   (update to REV or descendant and run "hg histedit --continue" again)

But this message is incorrect, unless old Mercurial is re-installed,
because Mercurial 2.7 or later disallows users to update the working
directory to another revision.

This patch changes the hint message to suggest "hg histedit --abort".
2013-10-01 00:35:07 +09:00
FUJIWARA Katsunori
477426f110 discovery: abort also when pushing multiple headed new branch
Before this patch, pushing with --new-branch permits to create
multiple headed branch on the destination repository.

But permitting to create new branch should be different from
permitting to create multiple heads on branch.

This patch prevents from careless pushing multiple headed new branch,
and requires --force to push such branch forcibly.
2013-10-01 00:26:22 +09:00
Pierre-Yves David
b5bc8d504a branchmap: stop looking for stripped branch
Since repoview in 2.5 we do not make special call to `branchmap` when stripping.
We just recompute the branchmap from a lower subset that still has valid
branchmap. So I'm dropping this dead code.
2013-09-30 17:42:38 +02:00
Pierre-Yves David
64005d41eb branchmap: remove the droppednodes logic
It was unused. note how it is only extended if the list is empty. So it's always
empty at the end.

We could try to fix that, however this would part of the code is to be removed
in the next changeset as we do not run `branchmap` on truncated repo since
`repoview` in 2.5.
2013-09-30 17:31:39 +02:00
FUJIWARA Katsunori
e190bd65ec histedit: add more detailed help about "--outgoing" 2013-10-01 00:12:34 +09:00
FUJIWARA Katsunori
cd5b67960a histedit: abort if there are multiple roots in "--outgoing" revisions
Before this patch, if there are multiple roots in "--outgoing"
revisions, result of "histedit --outgoing" depends on the parent of
the working directory. It succeeds only when the parent of the working
directory is a descendant of the oldest root in "--outgoing"
revisions, and fails otherwise.

It seems to be ambiguous and difficult for users.

This patch makes "histedit --outgoing" abort if there are multiple
roots in "--outgoing" revisions always.
2013-10-01 00:12:34 +09:00
Martin Schröder
bb6af51cfa i18n-de: fix record prompt (issue4044) 2013-09-30 20:54:39 +02:00
Martin Schröder
c8184271b4 i18n-de: synchronized with e369ee27d6db 2013-09-30 20:04:03 +02:00
Pierre-Yves David
a58c8b0406 branchmap: fix blank line position
The blank line was after was after the `if` condition instead of before.
2013-09-30 15:52:37 +02:00
FUJIWARA Katsunori
0aaf5e6516 histedit: add more detailed help about "--outgoing" 2013-10-01 00:12:34 +09:00
FUJIWARA Katsunori
e27c19b1b7 histedit: abort if there are multiple roots in "--outgoing" revisions
Before this patch, if there are multiple roots in "--outgoing"
revisions, result of "histedit --outgoing" depends on the parent of
the working directory. It succeeds only when the parent of the working
directory is a descendant of the oldest root in "--outgoing"
revisions, and fails otherwise.

It seems to be ambiguous and difficult for users.

This patch makes "histedit --outgoing" abort if there are multiple
roots in "--outgoing" revisions always.
2013-10-01 00:12:34 +09:00
Pierre-Yves David
763949e575 repoview: have unfilteredpropertycache using the underlying cache
A  `unfilteredpropertycache` is a kind of `propertycache` used on `localrepo` to
unsure it will always be run against unfiltered repo and stored only once.

As the cached value is never stored in the repoview instance, the descriptor
will always be called. Before this patch such calls always result in a call to
the `__get__` method of the `propertycache` on the unfiltered repo. That was
recomputing a new value on every access through a repoview.

We can't prevent the repoview's `unfilteredpropertycache` to get called on every
access. In that case the new code makes a standard attribute access to the
property. If a value is cached it will be used.

The `propertycache` test file have been augmented with test about this issue.
2013-09-30 14:23:14 +02:00
Pierre-Yves David
a411302ece repoview: make propertycache.setcache compatible with repoview
Propertycache used standard attribute assignment. In the repoview case, this
assignment was forwarded to the unfiltered repo. This result in:
(1) unfiltered repo got a potentially wrong cache value,
(2) repoview never reused the cached value.

This patch replaces the standard attribute assignment by an assignment to
`objc.__dict__` which will bypass the `repoview.__setattr__`. This will not
affects other `propertycache` users and it is actually closer to the semantic we
need.

The interaction of `propertycache` and `repoview` are now tested in a python
test file.
2013-09-30 14:36:11 +02:00
Wagner Bruna
60a132ad52 i18n-pt_BR: synchronized with 1265e540a84f 2013-10-01 16:41:04 -03:00
Wagner Bruna
74c55e31a2 i18n-pt_BR: synchronized with e369ee27d6db 2013-09-24 13:34:12 -03:00
Matt Mackall
bd565fec9b tests: fix check-code breakage 2013-09-23 13:22:28 -07:00
FUJIWARA Katsunori
af33f66d43 help: use full name of extensions to look up them for keyword search
Before this patch, "hg help -k KEYWORD" fails, if there is the
extension of which name includes ".", because "extensions.load()"
invoked from "help.topicmatch()" fails to look such extension up, even
though it is already loaded in.

"help.topicmatch()" invokes "extensions.load()" with the name gotten
from "extensions.enabled()". The former expects full name of extension
(= key in '[extensions]' section), but the latter returns names
shortened by "split('.')[-1]". This difference causes failure of
looking extension up.

This patch adds "shortname" argument to "extensions.enabled()" to make
it return shortened names only if it is True. "help.topicmatch()"
turns it off to get full name of extensions.

Then, this patch shortens full name of extensions by "split('.')[-1]"
for showing them in the list of extensions.

Shortening is also applied on names gotten from
"extensions.disabled()" but harmless, because it returns only
extensions directly under "hgext" and their names should not include
".".
2013-09-23 20:23:25 +09:00
Wojciech Lopata
0a0c3321e2 generaldelta: initialize basecache properly
Previously basecache was incorrectly initialized before adding the first
revision from a changegroup. Basecache value influences when full revisions are
stored in revlog (when using generaldelta). As a result it was possible to
generate a generaldelta-revlog that could be bigger by arbitrary factor than its
non-generaldelta equivalent.
2013-09-20 10:45:51 -07:00
Sean Farley
6064a14daf strip: set current bookmark to None if stripped 2013-09-07 15:07:10 -05:00
Augie Fackler
fd194f3d5b sslutil: backed out changeset 2cb59fd7ebb6 (issue4038)
Python docs are a little unclear, but mpm reports reading the OpenSSL
source code shows that PROTOCOL_SSLv23 allows TLS whereas
PROTOCOL_SSLv3 does not.
2013-09-18 14:40:17 -04:00
Augie Fackler
401f0a3a21 httpclient: apply upstream revision da7579b034a4 to fix SSL problems (issue4038) 2013-09-18 14:45:28 -04:00
Antoine Pitrou
ecc34bd7c0 bundle: fix performance regression when bundling file changes (issue4031)
Somewhere before 2.7, a change [82beb9b16505] was committed that
entailed a large performance regression when bundling (and therefore
remote cloning) repositories. For each file in the repository, it would
recompute the set of needed changesets even though it is the same for
all files. This computation would dominate bundle runtimes according to
profiler output (by 10x or more).
2013-09-07 21:20:00 +02:00
Alexander Plavin
0502c7c0ba hgweb: eliminate extra complexity in process_dates definition
There was an extra anonymous outer function, called immediately. It is removed
in this patch.
2013-09-06 13:30:58 +04:00
Siddharth Agarwal
4500805b25 util.h: backout cb07828e14e0 and 7d902369e960 for big-endian breakage
getbe32 and putbe32 need to behave differently on big-endian and little-endian
systems. On big-endian ones, they should be roughly equivalent to the identity
function with a cast, but on little-endian ones they should reverse the order
of the bytes. That is achieved by the original definition, but
__builtin_bswap32 and _byteswap_ulong, as the names suggest, swap bytes around
unconditionally.

There was no measurable performance improvement, so there's no point adding
extra complexity with even more ifdefs for endianncess.
2013-09-30 12:36:26 -07:00
Matt Mackall
c0d5c1e51a merge with stable 2013-09-30 12:38:08 -07:00
Kevin Bullock
513ec83540 strip: bring extension description in line with style and copy-edit 2013-09-27 21:54:53 -05:00
Pierre-Yves David
b8a3fefef6 strip: rename test-mq-strip into test-strip
And makes it use the strip extension only (except for the part testing mq
interaction)
2013-09-26 11:11:39 +02:00
Pierre-Yves David
9a065a615c mq: extract strip function as its standalone extension (issue3824)
Strip now lives in its own extension

reminder: The extension is surprisingly called `strip`.  The `mq` extension
force the use of the strip extension when its enabled. This is both necessary
for backward compatibility (people expect `mq` to comes with strip) and become
some utility function used by `mq` are now in the strip extension.
2013-09-26 23:57:21 +02:00
Pierre-Yves David
7d361f0e67 strip: move the strip helper function for mq to strip
The next patch finally move the command. No joke! (hey, this is for issue3824)
2013-09-26 23:43:00 +02:00
Pierre-Yves David
c041cca5aa strip: move checklocalchanges from mq to strip
One more step for issue3824.
2013-09-26 23:32:52 +02:00
Pierre-Yves David
c91342584d strip: move checksubstate from mq to strip
One more step for issue3824
2013-09-26 23:12:43 +02:00
Pierre-Yves David
7cc217e108 mq: prepare a strip extension for extraction
Strip will lives in its own extension. The extension is surprisingly called
`strip`. (as discussed in issue3824) The `mq` extension force the use of the
strip extension when its enabled. This will both necessary for backward
compatibility (people expect `mq` to comes with strip) and become some utility
function used by `mq` will move in the strip extension.
2013-09-26 23:10:11 +02:00
David Soria Parra
22083388ea histedit: remove unused parents() call 2013-09-26 14:47:19 +02:00
Pierre-Yves David
775803a1d5 mq: have the strip command functionnal on repo without mq
This is the last step before being able to extract `strip` in its own extension.
The changes are made in mq to allow a move only extraction without touching a
line of code.
2013-09-25 14:16:51 +02:00
Pierre-Yves David
a85f87aed5 mq: extract mq.queue.strip
It does not depend on `mq.queue` anymore.
2013-09-25 14:07:37 +02:00
Pierre-Yves David
b35e49d479 mq: drop the use of mq.queue.qparent in mq.queue.strip
Same as in the previous changeset, rev is never `None`. We can just copy the two
relevant lines in in `queue.strip`. This help having `queue.strip` independent
from `queue`. One further step toward the extraction of `strip` in an independent
extension. (As discussed in issue3824).
2013-09-25 13:41:43 +02:00
Pierre-Yves David
e78203d763 mq: drop the use of mq.queue.qparent in mq.strip
In this case, rev is never `None`. We can just copy the two relevant lines in
in `strip`. This help having `strip` independent from `queue` one
further step toward its extraction in an independent extension. (As
discussed in issue3824).
2013-09-25 14:10:34 +02:00
Pierre-Yves David
cdfc54ba34 mq: document repo.mq.qparents
The function is not very complex but writing this doc helped me to check if
I got everything right.
2013-09-25 19:34:45 +02:00