Commit Graph

18196 Commits

Author SHA1 Message Date
Kevin Bullock
bd7b56e105 merge with stable 2013-01-14 10:17:06 -06:00
FUJIWARA Katsunori
573ec722a6 histedit: correct the number of added revisions in online help
In the context of help document on which this patch focuses, the
example repository, which is source of cloning, should be already
histedit-ed, and contain only 3 revisions (rev # 0 to 2). So, not 3,
but 4 revisions should be added to the destination repository of
cloning, if it contains 7 revisions (rev # 0 to 6).

This patch also adds modifier "histedit-ed" to "example repository",
to make context clear.
2013-01-14 23:14:45 +09:00
FUJIWARA Katsunori
75da74f62e histedit: correct changeset IDs in online help
There is no '633536316234' revision in the example repository. It
should be 'c561b4e977df', according to the revisions in it and
explanation in help document.
2013-01-14 23:14:45 +09:00
FUJIWARA Katsunori
9fd6562bca convert: correct 'hooks' section name in online help
The section name for hooks is not 'hook', but 'hooks'.
2013-01-14 23:14:45 +09:00
Pierre-Yves David
e4fab34c27 hgweb: document the revnavgen function 2013-01-13 21:36:35 +01:00
Mads Kiilerich
79e0196dc6 largefiles: make update with backup files in .hglf slightly less broken
Largefiles update would try to copy f to f.orig if there was a .hglf/f.orig .
That is in many many ways very very wrong, but it also caused an abort if f
didn't exist.

Now it only tries to copy f if it exists.
2013-01-10 15:33:14 +01:00
Pierre-Yves David
ed7bbaa14c dispatch: handle empty testedwith value in extension
When extensions had an empty `testedwith` attribute the code tried to parse it
and failed. As a result the actual error were shallowed by a This crash.

We now treat empty strip as 'unknown'
2013-01-04 19:06:42 +01:00
Benoit Boissinot
487f5cb58d test-command-template.t: make "age" filter test work on Feb 29th
reported by Julien Cristau.
2013-01-02 13:59:07 +01:00
Matt Mackall
56ee5e8df3 Added signature for changeset 9d7e53f4560e 2013-01-02 00:07:43 -06:00
Matt Mackall
b65fcfe7e4 merge with i18n 2013-01-02 00:03:31 -06:00
Matt Mackall
4ba8b9bde7 merge i18n heads 2013-01-02 00:02:22 -06:00
Augie Fackler
f909cd2da7 test-command-template.t: fix test so it all year
This test started failing for me after midnight UTC on December
31st. Fixed it by specifying a date 7 years in the future more
precisely (rather than just adding 8 to the year and specifying
January 1st), which allows the test to pass both now and on 2012-12-01
at the same time.
2012-12-31 21:50:35 -06:00
Pierre-Yves David
b6d4017a84 amend: prevent loss of bookmark on failed amend
The active bookmark were moved to the temporary commit. When the transaction
were rollbacked, the bookmark were lost.

We now temporarly disable the bookmark to prevent this effect.
2012-12-30 03:49:15 +01:00
Pierre-Yves David
6a1ec255bb amend: invalidate dirstate in case of failure (issue3670)
The temporary commit created by amend update the dirstate. If the final commit
fails, we need to invalidate the change made to the dirstate, otherwise the
release of the wlock will write the dirstate created after the rollbacked
temporary commit.

This dirstate writing logic should probably be handled in the same object than
the transaction one. However such change are too big for stable.
2012-12-29 18:00:18 +01:00
Alexander Sauta
39c2e8f8fe i18n-ru: synchonized with ce5a796b8950 2012-12-27 07:32:51 +00:00
Matt Mackall
bad4a7148f paper: sanity-check page feed links
filelog has feeds in header, but not in menu bar
help has header feeds pointing to tags
2012-12-20 16:36:45 -06:00
Benoit Boissinot
12b2b140f5 zeroconf: use port from server instead of picking port from config (issue3746)
In order to get the port, wrap create server instead of
hgweb_mod/hgwebdir_mod.
2012-12-30 19:19:52 +01:00
Matt Mackall
567c0ff1dc scmutil: don't try to match modes on filesystems without modes (issue3740) 2012-12-20 15:52:23 -06:00
Matt Mackall
6f6ef90fe2 hgwebdir: honor web.templates and web.static for static files (issue3734) 2012-12-22 18:11:51 -06:00
Mads Kiilerich
24be691647 tests: fix windows test failures 2012-12-28 14:10:35 +01:00
Pierre-Yves David
8f71cbe4e1 hgweb: no do not use listinsert(0, ...)
This is not efficient. We now append element and either reverse the list or
iterate in reverse order.
2012-12-19 19:06:50 +01:00
Idan Kamara
ddb5b141cc localrepo: drop unnecessary check on wlock unlock
Calling out to dirstate one line before guarantees that it'll be in the filecache.
2013-01-10 23:57:03 +02:00
Idan Kamara
dd240808d9 dirstate: refresh _branch cache entry after writing it 2012-12-16 20:33:00 +02:00
Idan Kamara
ad6fc4bb63 filecache: create an entry in _filecache when __set__ is called for a missing one
Preserve the invariant that if P is a filecached property on X then
P in X.__dict__ => P in X._filecache.

Previously, it was possible for a filecached property to become out of sync
with the filesystem if it was set before getting it first, since the initial
filecacheentry was created in __get__.

Old behaviour:

  repo.prop = x
  repo.invalidate() # prop has no entry in _filecache, it's not removed
                    # from __dict__
  repo.prop         # returns x like before without checking with the
                    # filesystem

New:

  repo.prop = x     # an empty entry is created in _filecache
  repo.invalidate() # prop is removed from __dict__
  repo.prop         # recreates prop
2012-12-17 15:25:45 +02:00
Idan Kamara
542705b00a filecache: allow filecacheentry to be created without stating in __init__
Will be used for properties that are set without getting them first.
2013-01-10 23:54:53 +02:00
Idan Kamara
dc1e34eda3 rollback: don't clear the filecache
This was an old workaround to force the filecache to reload everything. Now
that the syncing issue is fixed, we no longer need it.
2013-01-09 20:36:53 +02:00
Idan Kamara
ca54b38975 destroyed: keep the filecache in sync with __dict__ (issue3335) (issue3693) (issue3743)
We need to make sure that if X is in the filecache then it's also in the
filecache owner's __dict__, otherwise it will go out of sync:

repo.X                  # first access to X, records stat info in
                        # filecache and updates __dict__
repo._filecache.clear() # removes X from _filecache but it's still in __dict__
repo.invalidate()       # iterates over _filecache and removes entries
                        # from __dict__, but X isn't in _filecache, so
                        # it's kept in __dict__
repo.X                  # X is fetched from __dict__, bypassing the filecache
2013-01-09 20:37:44 +02:00
Idan Kamara
b367739fa0 localrepo: write the phasecache when destroying nodes 2013-01-11 00:05:52 +02:00
Idan Kamara
a5fb16be88 localrepo: update the branchmap when destroying nodes
This was previously called directly during strip. Moving it to destroying
also means that it'll be called through _rollback, which seems harmless.
2013-01-05 16:50:12 +02:00
Idan Kamara
bd84da5670 localrepo: introduce destroying function 2012-12-15 20:08:13 +02:00
Idan Kamara
7b192e750c localrepo: don't refresh filecache entries that aren't in __dict__
We call invalidate to remove properties from __dict__ because they're
possibly outdated and we'd like to check for a new version. Next time
the property is accessed the filecache mechanism checks the current stat
info with the one recorded at the last time the property was read, if
they're different it recreates the property.

Previously we refreshed the stat info on all properties in the filecache
when the lock is released, including properties that are missing from
__dict__. This is a problem because:

  l = repo.lock()
  repo.P          # stat info S for P is recorded in _filecache
  <changes are made to repo.P indirectly, e.g. underlying file is replaced>
                  # P's new stat info = S'
  l.release()     # filecache refreshes, records S' as P's stat info

At this point our filecache contains P with stat info S', but P's
version is from S, which is outdated.

The above happens during _rollback and strip. Currently we're wiping the
filecache and forcing everything to reload from scratch which works but
isn't the right solution.
2012-12-16 23:13:02 +02:00
Mads Kiilerich
d8671137d4 changelog: please check-code and remove tabs
Tabs were introduced in 972c32f23691.
2013-01-12 16:04:29 +01:00
Pierre-Yves David
77db5734c1 branchmap: Save changectx creation during update
The newly introduced `branchmap` function allows us to skip the
creation of changectx objects. This speeds up the construction of
the branchmap.

On the mozilla repository (117293 changesets, 15490 mutable)

Before:
  ! impactable 19.9
  ! mutable 0.576
  ! unserved 3.16

After:
  ! impactable 7.03 (2.8x faster)
  ! mutable 0.352 (1.6x)
  ! unserved 1.15 (2.7x)

On the cpython repository (81418 changesets, 6418 mutable)

Before:
  ! impactable 15.9
  ! mutable 0.451
  ! unserved 0.861

After:
  ! impactable 6.55 (2.4x faster)
  ! mutable 0.170 (2.6x faster)
  ! unserved 0.289 (2.9x faster)

On the pypy repository (58852 changesets)

Before:
  ! impactable 13.6

After:
  ! impactable 6.17 (2.2x faster)

On my Mercurial repository (18295 changesets, 2210 mutable)

Before:
  ! impactable 23.9
  ! mutable 0.368
  ! unserved 0.057

After:
  ! impactable 1.31 (18x faster)
  ! mutable 0.042 (8.7x)
  ! unserved 0.025 (2.2x)
2013-01-11 18:47:42 +01:00
Pierre-Yves David
a99d835522 changelog: add a branch method, bypassing changectx
The only way to access the branch of a changeset is currently to
create a changectx object and access its `branch()` method. Creating
a new Python object is costly and has a huge impact on code doing
heavy access to `branch()` (like branchmap).

This change introduces a new method on changelog that allows direct
access to the branch of a revision. See the next changeset for impact.
2013-01-10 00:41:40 +01:00
Pierre-Yves David
4bd2fce08b branchmap: pass revision insteads of changectx to the update function
Creation of changectx objects is very slow, and they are not very
useful. We are going to drop them. The first step is to change the
function argument type.
2013-01-08 01:28:39 +01:00
Pierre-Yves David
684502f847 perf: add perfbranchmap command
The command times the update of a branchmap from its nearest subset
or from scratch.
2013-01-11 18:39:43 +01:00
Pierre-Yves David
4e9586f18e clfilter: enforce hidden filtering on all repository accesses
We ensure all repositores created through `mercurial.hg.repository`
are "hidden" filtered. This is an even stronger enforcement than
86530c899687.

Citing Matt's response to changeset 86530c899687 installing filtering
in dispatch:

> Unfortunately, this means that code that doesn't go through dispatch (ie all
> those crazy misguided people using Mercurial as a library) are going to see
> these hidden changesets.
>
> Might be better to instead install the filter in localrepo construction by
> default and disable it in dispatch.
2013-01-11 20:34:54 +01:00
Mads Kiilerich
bd884d9410 archival: avoid touching deprecated gzip name attribute
The existing workaround didn't work when no filename was specified.

If running in a context with warnings enabled and subsecond mtime it gave a
warning:
  DeprecationWarning: use the name attribute
2013-01-03 21:07:04 +01:00
Mads Kiilerich
959c978f9d archival: pass integer to struct.pack int field instead of float
If running in a context with warnings enabled and subsecond mtime it gave a
warning:
  DeprecationWarning: integer argument expected, got float
2013-01-03 21:07:04 +01:00
Mads Kiilerich
dfd7d10cbf largefiles: fix update from a merge with removed files
A situation with this case could happen after interrupting an update. Update
would fail with:
  abort: No such file or directory: $TESTTMP/f/.hglf/sub2/large6

Update from a merge without using clean is not possible anyway, so this patch
takes a step in the right direction so it gets as far as reporting the right
error.
2013-01-11 16:30:29 +01:00
Mads Kiilerich
19813fa421 largefiles: fix revert removing a largefile from a merge
Before revert could fail with:
  abort: .hglf/large@33fdd332ec: not found in manifest!

The LookupError will now be caught and handled correctly.
2013-01-11 16:30:29 +01:00
Mads Kiilerich
5096819efc largefiles: remove unused proto.refuseclient code
Should have been removed with other pre-1.9 code in 416c0b8e6104.
2013-01-11 16:30:29 +01:00
Angel Ezquerra
e70892baf4 subrepo: make 'in subrepo' string easier to find by external tools
This patch is meant to make it easier for tools that wrap the mercurial
output (such as TortoiseHg) to find the "in subrepo MYSUBREPO" string that
(since 6c419dfc848c) is appended after subrepo error messages, particularly when
the mercurial output is translated to a non-English language.

The message remains the same but the '%s' that was used to prepend the original
error message in front of the 'in subrepo' string has been moved out of the
translatable string.

As an example of the usefulness of making it easy to look for "in subrepo
MYSUBREPO" strings, TortoiseHg looks for these strings in error messages in
order to "linkify them" (i.e. convert "MYSUBREPO" into alink to the
corresponding subrepo).

The original string made it hard for a tool such as TortoiseHg to look for the
translated string on mercurial's output because the translated string contained
the error message itself. This meant that a regular expression was required to
ignore the error message part. With this change TortoiseHg can just get the
translated "(in subrepo %s)" string, substitute %s for the subrepo path (which
it gets from the subrepo exception) and simply search for the resulting string
(no regular expression needed, or at least a much simpler regular expression
could be used).

Additionaly, the existing string could lead a translator mistakenly assume that
it was possible invert the order of the %s (error and subrepo path) fields,
which would not work because the string interpolation was position based.
2013-01-03 17:42:25 +01:00
Brendan Cully
31cab25274 subrepo: fix python2.4 compatibility after e9ad4d8804d3
super(SubrepoAbort, self).__init__(*args, **kw) raises
  TypeError: super() argument 1 must be type, not classobj
2013-01-10 10:35:37 -08:00
Christian Ebert
9b136a0b1f test-keyword: improve grammar and spelling in branchcache note
See: 95bf063e6776
2013-01-10 16:25:06 +00:00
Augie Fackler
2986e3abf8 Merge with stable. 2013-01-10 09:43:28 -05:00
Pierre-Yves David
bf6aa861ef repoview: extract hideable revision computation in a dedicated function
This will help extensions to plug into the hidden mechanism.
2013-01-10 10:25:02 +01:00
Matt Mackall
fe3bd5fa6c tests: fix up test-highlight for breadcrumb changes 2013-01-09 19:10:44 -06:00
Sean Farley
96729d25e1 color: add template label function 2012-12-28 19:25:10 -06:00
Sean Farley
3247f202be templater: add no-op template function 'label' 2012-12-22 21:46:26 -06:00