Commit Graph

7637 Commits

Author SHA1 Message Date
Adrian Buehlmann
a216345ef2 workingctx.remove: use self.forget 2011-05-27 21:11:44 +02:00
Martin Geisler
e495964784 commands: use repo.branchheads in heads command 2011-05-31 13:18:56 +02:00
Martin Geisler
f365370231 commands: remove unused variable from heads command
The b variable has not been needed since 5333bad7a76b. Renamed ls
variable to bheads for clarity.
2011-05-31 09:59:03 +02:00
Martin Geisler
4cb518e9a1 hg: remove underscores in clone function 2011-05-27 12:42:36 +02:00
Martin Geisler
5cdd89938e doc: improve merge between hgrc.5 and config help topic 2011-05-30 11:15:25 +02:00
Martin Geisler
7cbe536a61 help/config: separate terms with a blank line
This makes it easier for translators since they can then translate
each term individually.
2011-05-30 10:35:43 +02:00
Martin Geisler
a66b0892f8 help/config: fix rendering of definition list
Without the blank line, the minirst parser renders

  Term-1
    Line-1

    Line-2
  Term-2
    Line-1

as

  Term-1
    Line-1

  Line-2 Term-2 Line-1

because the second term is seen as a paragraph.
2011-05-30 10:30:46 +02:00
Yun Lee
657bb2225f help: move part of hgrc.5 man page config help topic 2011-05-30 10:21:39 +02:00
Patrick Mezard
ab82a700d3 patch: do not patch unknown files (issue752) 2011-05-27 21:50:11 +02:00
Patrick Mezard
d4b7db6294 patch: use temporary files to handle intermediate copies
git patches may require copies to be handled out-of-order. For instance, take
the following sequence:

  * modify a
  * copy a into b

Here, we have to generate b from a before its modification. To do so,
applydiff() was scanning for copy metadata and performing the copies before
processing the other changes in-order. While smart and efficient, this approach
complicates things by handling file copies and file creations at different
places and times. While a new file must not exist before being patched a copied
file already exists before applying the first hunk.

Instead of copying the files at their final destination before patching, we
store them in a temporary file location and retrieve them when patching. The
filestore always stores file content in real files but nothing prevents adding
a cache layer. The filestore class was kept separate from fsbackend for at
least two reasons:

- This class is likely to be reused as a temporary result store for a future
  repository patching call (entries just have to be extended to contain copy
  sources).

- Delegating this role to backends might be more efficient in a repository
  backend case: the source files are already available in the repository itself
  and do not need to be copied again. It also means that third-parties backend
  would have to implement two other methods. If we ever decide to merge the
  filestore feature into backend, a minimalistic approach would be to compose
  with filestore directly. Keep in mind this copy overhead only applies for
  copy/rename sources, and may even be reduced to copy sources which have to
  handled ahead of time.
2011-05-27 21:50:10 +02:00
Patrick Mezard
e6f284be06 patch: refactor file creation/removal detection
The patcher has to know if a file is being created or removed to check if the
target already exists, or to actually unlink the file when a hunk emptying it
is applied. This was done by embedding the creation/removal information in the
first (and only) hunk attached to the file.

There are two problems with this approach:

- creation/removal is really a property of the file being patched and not its
  hunk.

- for regular patches, file creation cannot be deduced at parsing time: there
  are case where the *stripped* file paths must be compared. Modifying hunks
  after their creation is clumsy and prevent further refactorings related to
  copies handling.

Instead, we delegate this job to selectfile() which has all the relevant
information, and remove the hunk createfile() and rmfile() methods.
2011-05-27 21:50:09 +02:00
Adrian Buehlmann
5e0e57cb94 commands.remove: don't use workingctx.remove(list, unlink=True)
workingctx.remove(list, unlink=True) is unsuited here, because it does too
much: it also unlinks added files. But the command 'hg remove' is specified
to *never* unlink added files.

Instead, we now unlink the files at the commands.remove level (if --after was
not specified) and use workingctx.forget for all files.

As an added bonus, this happens to eliminate a wlock acquire/release pair,
since the previous implementation caused

   acquire wlock
   release wlock
   acquire wlock
   release wlock

where the first pair of acquire/release was caused by the workingctx.forget
call, and the second by the workingctx.remove call.
2011-05-27 15:59:52 +02:00
Matt Mackall
fd5cc95a4a coal: use preformatted text for descriptions (issue2835)
The coal style was broken here by an earlier change to paper, which
shares files.
2011-05-27 08:50:27 -05:00
Martin Geisler
2edabc4530 subrepo: refactor writestate for clarity 2011-05-27 11:01:44 +02:00
Matt Mackall
5f2364be24 cmdutil: make private copies of option lists to avoid sharing monkeypatches 2011-05-26 17:15:35 -05:00
Paul Molodowitch
dfc345d9b5 subrepo: bare git repos considered dirty
Currently, if there is a bare git subrepo, but it is at the "right"
revision, calling dirty() will error because diff-index does not work
on bare repos. This patch makes it so bare subrepos are always
considered dirty.
2011-05-25 08:38:58 -07:00
Idan Kamara
b9dc5b5bf7 dispatch: use the request to store the ui object
and check if we got one before creating.

note that the contents of the ui object might change after
dispatch() returns (by options passed through --config for example),
to ensure it doesn't, pass a copy() of it.
2011-05-26 00:53:23 +03:00
Idan Kamara
5544ef8f07 dispatch: wrap dispatch related information in a request class
currently only stores the arguments.
2011-05-26 00:44:11 +03:00
Steven Brown
b13eee65a4 patch: restore the previous output of 'diff --stat'
Restore the previous diffstat behaviour of scaling by the maximum number of
changes to a single file. Changeset 7bb0e22a7988 modified the diffstat to be
scaled by the total number of changes. This seems to have been unintentional.
2011-05-26 22:51:02 +08:00
Peter Arrenbrecht
8761d1fa87 wireproto: enable optional args for known() for future extensibility
Firstly, I think we should do this for all new wire commands, just
to be on the safe side. So I want to get this into the 1.9 release.

Secondly, there actually is potential here that sometimes the server
can know that the number of its nodes which can possibly still be
undecided on the client is small. It might then just send them along
directly (cutting short the end game). This, however, requires
walking the graph on the server, which can be expensive, so for the
moment we're not actually doing it.
2011-05-24 17:48:16 +02:00
Matt Mackall
c6e850b04b context: make forget work like commands.forget
Switch users of wctx.delete(..., False) to forget.
2011-05-26 17:15:35 -05:00
Matt Mackall
97c6e7b48d dirstate: rename forget to drop
It has substantially different semantics from forget at the command
layer, so change it to avoid confusion.

We can't simply combine it with remove because we need to explicitly
drop non-added files in some cases like commit.
2011-05-26 17:15:35 -05:00
Martin Geisler
ce8ced9777 minirst: read test input from stdin 2011-05-26 10:46:34 +02:00
Matt Mackall
a8dec32fed httprepo: handle large lengths by bypassing the len() operator 2011-05-24 17:30:00 -05:00
Adrian Buehlmann
5872a76fa2 workingctx.remove: don't stat files again after unlinking
we already know at this point that they have been unlinked
2011-05-24 14:52:23 +02:00
Matt Mackall
438f823709 httprepo: send URL redirection notices to stderr (issue2828) 2011-05-24 17:16:31 -05:00
Augie Fackler
14a08e5514 pure parsers: properly detect corrupt index files
This new Python code should be equivalent in behavior to the if
statement at line 312 of parsers.c. Without this, the pure-python
parsers improperly ignore truncated revlogs as created in
test-verify.t.
2011-05-24 13:30:10 -05:00
Adrian Buehlmann
2fa6cdd315 workingctx: unlink paths while holding the wlock 2011-05-24 14:08:20 +02:00
Martin Geisler
34dddcd6fe wireproto: do not hash when heads == ['force']
Changeset 20b319765bcf introduced the unbundlehash capability and
unconditionally hashed the heads on the client side. By mistake, the
heads were also cased in the heads == ['force'] case.
2011-05-24 16:12:01 +02:00
Patrick Mezard
32250cd067 patch: remove EOL support from linereader class
This was only used when reading patched files which is now done by backends.
2011-05-24 14:21:04 +02:00
Matt Mackall
db4e14bfa3 subrepo: handle local added subrepo case correctly 2011-05-23 22:49:10 -05:00
Idan Kamara
d5c206ffa2 extensions: raise when trying to find an extension that failed to load
extensions that depend on other extensions (such as record) use this pattern
to check if the dependant extension is available:

    try:
        mq = extensions.find('mq')
    except KeyError:
        return

but since if an error occurs while loading an extension it leaves its entry
in the _extensions map as None, we want to raise in that situation too.

(rather than adding another check if the return value is None)
2011-05-23 23:09:00 +03:00
Adrian Buehlmann
f559c2bcbb remove: clarify help text about added files never being deleted from disk 2011-05-23 15:56:31 +02:00
Martin Geisler
ff9aae8a76 changelog: convert user and desc from local encoding early
Failing to do so makes it impossible to use the memctx API to create a
changeset with a commit message or username outside of the current
encoding.encoding setting.
2011-05-19 18:09:25 +02:00
Martin Geisler
3eec57aed2 subrepo: respect non-default path for incoming/outgoing
Push and pull set repo._subtoppath before pushing or pulling subrepos.
The incoming and outgoing commands needed to do the same.
2011-05-18 15:13:26 +02:00
Martin Geisler
9ea41d9e6c revset: the name is optional for the tag predicate 2011-05-18 09:31:19 +02:00
Martin Geisler
c9db075708 revset: note case-sensitive match in grep 2011-05-18 09:28:11 +02:00
Martin Geisler
009dc5d112 revset: note case-insensitive matches in keyword and user 2011-05-18 09:20:52 +02:00
Martin Geisler
e7ee99da82 revset: expand help for contains predicate 2011-05-18 09:15:18 +02:00
Adrian Buehlmann
8728d73db7 pure: provide more correct implementation of posixfile for Windows
requires ctypes

Why is posixfile a class?

Because the implementation needs to use the Python library call os.fdopen [1],
which sets the 'name' attribute on the Python file object it creates to the
mostly meaningless string '<fdopen>', since file descriptors don't have a name.

But users of posixfile depend on the name attribute [2] being set to a proper
value, like Python's built-in 'open' function sets it on file objects.

Python file's name attribute is read-only, so we can't just assign to it after
the file object has alrady been created.

To solve this problem, we save the name of the file on a wrapper object,
and delegate the file function calls to the wrapped (private) file object
using __getattr__.

[1] http://docs.python.org/library/os.html#os.fdopen
[2] http://docs.python.org/library/stdtypes.html#file.name
2011-05-18 09:12:27 +02:00
Peter Arrenbrecht
fedeff28a1 bundlerepo: make getremotechanges support filtering of incoming
Extensions can hook discovery.findcommonincoming to filter out unwanted remote
changesets. This patch makes getremotechanges respect the changed remote heads
returned by such extensions.
2011-05-23 20:35:10 +02:00
Adrian Buehlmann
a11d19c5ad applyupdates: audit merged files
protects changing flags on merged files (util.setflags call on line 341)
2011-05-22 11:03:15 +02:00
Adrian Buehlmann
18e5c7b1c9 applyupdates: audit path on flag changes
we're using the auditor of the repo wopener, since this is a path that belongs
to the tree we're updating to
2011-05-21 23:21:12 +02:00
Adrian Buehlmann
60c5ff105b opener: add audit function 2011-05-21 23:13:59 +02:00
Matt Mackall
0842cf2d1e templatekw: use diffstatsum in diffstat keyword 2011-05-21 15:09:15 -05:00
Matt Mackall
6af03bc2e8 patch: use diffstatsum in diffstat 2011-05-21 15:06:38 -05:00
Matt Mackall
7560e9a576 patch: add diffstatsum helper 2011-05-21 15:06:36 -05:00
Matt Mackall
898e0ce783 diffstatdata: no longer a generator
This produces a smallish amount of data and all consumers needed to
buffer it anyway.
2011-05-21 15:01:28 -05:00
Adrian Buehlmann
9e0713e79c add new option --all to manifest command
prints a list of all files in all revisions of the repo

obsoletes the cifiles extension
2011-05-18 21:31:40 +02:00
Adrian Buehlmann
4c8d0e46fa applyupdates: audit unlinking of renamed files and directories 2011-05-21 02:05:00 +02:00
Matt Mackall
66805ccfed revlog: stop exporting node.short 2011-05-21 15:01:28 -05:00
Patrick Mezard
272081b65d patch: fast-path git case in selectfile()
We avoid a lot of complicated heuristics in git cases, where these heurestics
may even be broken when copies are involved.
2011-05-19 22:55:13 +02:00
Patrick Mezard
a09607c9ee patch: unify backend file access interface
- Rename readlines() into getfile(), return data and mode
- Make setfile() write a data buffer instead of lines, make mode mandatory.
2011-05-19 22:49:43 +02:00
Patrick Mezard
701e9571f9 patch: merge backend setmode() into writelines()
Copy handling will be easier to handle in a single method.
2011-05-19 22:44:01 +02:00
Patrick Mezard
15861c0232 patch: stop modifying gitpatch objects
gitpatch objects emitted by iterhunks() were referencing file paths unmodified
from the input patch. _applydif() made them usable by modifying the gitpatch
objects in-place with specified path strip level. The same modified objects
were then reused by iterhunks() generator. _applydiff() now copies and update
the paths which completely decouples both routines.

As a side effect, the "git" event now receives only metadata about
copies/renames to perform the necessary copies ahead of time. Other actions are
handled in the "file" event.
2011-05-19 22:44:01 +02:00
Patrick Mezard
3246b5c773 patch: stop handling hunkless git blocks out of stream
Patch changes are emitted by iterhunks() in two separate events: 'file' when
hunks have to be applied and 'git' to describe other modifications like copies
or mode changes. Note that a file which mode is changed and which content is
modified by the same patch will be emitted in both events. It is more
convenient to handle all file modifications in a single event. This patch
"zips" git actions with regular changes so both kinds can be emitted at the
same place.
2011-05-19 22:44:01 +02:00
Patrick Mezard
ac0634bc33 patch: reindent code 2011-05-19 22:44:01 +02:00
Patrick Mezard
ac6f56515a patch: unify iterhunks() afile/bfile handling
git afile/bfile are extracted twice, once when reading a 'diff --git', and
again when reading a unified hunk. The problem is not all git blocks have
unified hunks (renames just have metadata) and they were not extracted the same
way. This is what this patch unifies.
2011-05-19 22:44:01 +02:00
Patrick Mezard
f8df1dcc42 patch: git metadata was ignored if strip > 1
gitpatch objects emitted by iterhunks() are modified in place by applydiff().
Processing them earlier improves iterhunks() isolation. applydiff() modifying
them should still be fixed though.
2011-05-19 22:44:01 +02:00
Patrick Mezard
68fd0dcbe7 patch: construct and parse binary hunks at the same time 2011-05-19 22:44:01 +02:00
Patrick Mezard
452fad17b8 patch: refactor iterhunks() regular and binary files emission 2011-05-19 22:44:01 +02:00
Patrick Mezard
78738c3822 patch: remove patch.patch() cwd argument 2011-05-19 22:44:01 +02:00
Patrick Mezard
6d4d079b0e patch: merge _updatedir() into externalpatch() 2011-05-19 22:44:01 +02:00
Martin Geisler
0eaeed4412 merge with stable 2011-05-19 18:10:03 +02:00
Martin Geisler
142cf677cd merge crew with main 2011-05-19 16:57:14 +02:00
Brendan Cully
b1b428c2d8 clone: make default path absolute for all local paths
This fixes the default path when cloning local repositories with hg-git, since
hg-git cancopy() is false even for local repositories.
2011-05-18 23:20:26 -07:00
Patrick Mezard
2bda8cbde2 patch: add a workingbackend dirstate layer on top of fsbackend
_updatedir() is no longer used by internalpatch()

The change in test-mq-missingfiles.t comes from workingbackend not considering
the missing 'b' file as changed, thus not calling addremove() on it.
2011-05-18 23:48:17 +02:00
Patrick Mezard
34a629b9c0 patch: handle binary copies as regular ones
This introduces a performance regression for large files, as they will be
copied just to be clobbered afterwards since binary patching does not use
deltas.  But it simplifies the code and the previous optimization will be
reintroduced later in a better way.
2011-05-18 23:48:13 +02:00
Patrick Mezard
18202a57db patch: remove files while patching, not in updatedir()
At this point, updatedir() only reads the working directory and update the
dirstate.
2011-05-18 23:48:13 +02:00
Patrick Mezard
514ff73602 patch: set desired mode when patching, not in updatedir()
This patch and the following aim at merging _updatedir() actions into
_applydiff().
2011-05-18 23:48:13 +02:00
Patrick Mezard
e5afef2782 patch: stop changing current directory before patching
_applydiff() patcher argument was added to help hgsubversion like extension
monkeypatching the patching process. While it could be removed at this point, I
prefer to leave it until patch.py is completely refactored and there is a valid
and tested alternative.
2011-05-18 23:48:13 +02:00
Sune Foldager
9a73f9bed3 revlog: linearize created changegroups in generaldelta revlogs
This greatly improves the speed of the bundling process, and often reduces the
bundle size considerably. (Although if the repository is already ordered, this
has little effect on both time and bundle size.)

For non-generaldelta clients, the reduced bundle size translates to a reduced
repository size, similar to shrinking the revlogs (which uses the exact same
algorithm). For generaldelta clients the difference is minor.

When the new bundle format comes, reordering will not be necessary since we
can then store the deltaparent relationsships directly. The eventual default
behavior for clients and servers is presented in the table below, where "new"
implies support for GD as well as the new bundle format:

                    old client                    new client
old server          old bundle, no reorder        old bundle, no reorder
new server, non-GD  old bundle, no reorder[1]     old bundle, no reorder[2]
new server, GD      old bundle, reorder[3]        new bundle, no reorder[4]

[1] reordering is expensive on the server in this case, skip it
[2] client can choose to do its own redelta here
[3] reordering is needed because otherwise the pull does a lot of extra
    work on the server
[4] reordering isn't needed because client can get deltabase in bundle
    format

Currently, the default is to reorder on GD-servers, and not otherwise. A new
setting, bundle.reorder, has been added to override the default reordering
behavior. It can be set to either 'auto' (the default), or any true or false
value as a standard boolean setting, to either force the reordering on or off
regardless of generaldelta.


Some timing data from a relatively branch test repository follows. All
bundling is done with --all --type none options.

Non-generaldelta, non-shrunk repo:
-----------------------------------
Size: 276M

Without reorder (default):
Bundle time: 14.4 seconds
Bundle size: 939M

With reorder:
Bundle time: 1 minute, 29.3 seconds
Bundle size: 381M

Generaldelta, non-shrunk repo:
-----------------------------------
Size: 87M

Without reorder:
Bundle time: 2 minutes, 1.4 seconds
Bundle size: 939M

With reorder (default):
Bundle time: 25.5 seconds
Bundle size: 381M
2011-05-18 23:26:26 +02:00
Sune Foldager
354fe2aa7b revlogdag: add linearize function
See the docstring for a detailed explanation. The linearizer was originally
written by Benoit Boissinot.
2011-05-18 23:11:34 +02:00
Martin Geisler
b8eb9675f3 localrepo, sshrepo: use Boolean create argument in __init__ 2011-05-18 19:30:17 +02:00
Martin Geisler
aac60bcbc9 commands: replace 'x = f(); return x' with 'return f()' 2011-05-18 19:25:34 +02:00
Martin Geisler
c3877c2424 merge with stable 2011-05-18 19:22:55 +02:00
Thomas Arendsen Hein
5921e1efcc annotate: fix alignment of columns in front of line numbers (issue2807) 2011-05-18 15:41:03 +02:00
Martin Geisler
9bc622d2ad merge with stable 2011-05-18 09:56:27 +02:00
Sune Foldager
3549e9b445 patch: remove unused variable to make pyflakes test happy 2011-05-18 09:05:18 +02:00
Patrick Mezard
42f681d4d9 patch: add lexists() to backends, use it in selectfile()
At this point, all applydiff() filesystem calls should pass through fsbackend.
2011-05-17 23:46:38 +02:00
Patrick Mezard
c3cc8c546a patch: move copyfile() into backends, abstract basedir 2011-05-17 23:46:38 +02:00
Patrick Mezard
6b9f641c33 patch: merge makerejlines() into write_rej() 2011-05-17 23:46:37 +02:00
Patrick Mezard
431a9d156a patch: extract fs access from patchfile into fsbackend
Most filesystem calls are already isolated in patchfile but this is not enough:
renames are performed before patchfile is available and some chmod calls are
even done outside of the applydiff call. Once all these calls are extracted
into a backend class, we can provide cleaner APIs to write to a working
directory context directly into the repository.
2011-05-17 23:46:15 +02:00
Patrick Mezard
45494955e5 mq: fix qpush changes detection of renamed files
patch.changedfile() was not considering renamed file source as changed.
2011-05-17 23:27:58 +02:00
Augie Fackler
5086ed5b5d httpclient: import revision fc731618702a of py-nonblocking-http 2011-05-17 10:28:03 -05:00
Augie Fackler
d61478c8ef httpconnection: correctly handle redirects from http to https
Previously the connection cache for keepalives didn't keep track of
ssl. This meant that when we connected to an https server after that
same server via http, both on the default port, we'd incorrectly reuse
the non-https connection as the default port meant the connection
cache key was the same.
2011-05-16 16:59:45 -05:00
Augie Fackler
640a6e5b0b httpconnection: improved logging formatting
I had to use this debugging output for the first time recently when
looking for a problem, and the lack of good formatting made things
difficult.
2011-05-16 16:59:45 -05:00
Yann E. MORIN
236f8c6745 ui: enable alias exception when reading config in plain mode
When in plain mode with "alias" present in the exception list,
keep the aliases. This will be used later to enable auto-completion.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-17 00:17:52 +02:00
Yann E. MORIN
013aed8037 ui: test plain mode against exceptions
Let ui.plain() accept an optional parameter in the form of a feature
name (as a string) to exclude from plain mode.

The result of ui.plain is now:
 - False if HGPLAIN is not set or the requested feature is in HGPLAINEXCEPT
 - True otherwise

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-17 00:08:51 +02:00
Matt Mackall
a6f2ad6f1e revlog: drop base() again
deltaparent does what's needed, and more "portably".
2011-05-18 17:05:30 -05:00
Adrian Buehlmann
5884f8cd09 win32.py: add argtypes and restype
This is a feature of ctypes. Without these, pypy complains with

  RuntimeWarning: C function without declared arguments called
  RuntimeWarning: C function without declared return type called

As a side effect of specifying restypes, the return value of e.g. CreateFileA
is now implicitly converted to an instance of _HANDLE, so we also need to
change the definition

  _INVALID_HANDLE_VALUE = -1

to

  _INVALID_HANDLE_VALUE = _HANDLE(-1).value

Otherwise, tests for equality to _INVALID_HANDLE_VALUE in code like

  def _getfileinfo(name):
      fh = _kernel32.CreateFileA(name, 0,
              _FILE_SHARE_READ | _FILE_SHARE_WRITE | _FILE_SHARE_DELETE,
              None, _OPEN_EXISTING, 0, None)
      if fh == _INVALID_HANDLE_VALUE:
          _raiseoserror(name)

would now fail to detect an invalid handle, which in turn would lead to
exceptions raised with wrong errno values, like e.g.

  >>> nlinks('missing.txt')
  Traceback (most recent call last):
  ...
  OSError: [Errno 9] missing.txt: The handle is invalid.

instead of the correct (as per this patch and before it)

  >>> nlinks('missing.txt')
  Traceback (most recent call last):
  ...
  OSError: [Errno 2] missing.txt: The system cannot find the file specified.
2011-05-15 21:33:51 +02:00
Adrian Buehlmann
1301f80255 win32.py: more explicit definition of _STD_ERROR_HANDLE 2011-05-15 21:27:59 +02:00
Matt Mackall
3974d4288a revset: add follow(filename) to follow a filename's history across copies 2011-05-16 17:02:35 -05:00
Matt Mackall
01a4d248e5 revset: introduce filelog() to emulate log's fast path
filelog() only reports revisions present in the matching filelogs.
2011-05-16 17:02:35 -05:00
Steve Borho
48f0028601 simplemerge: do not allow binary files to abort an entire merge
When used as the default merge tool, or used as a --tool override,
the simplemerge script should not be allowed to raise a util.Abort
just because one of the files being merged is binary.  Instead, return
1 and mark the file unresolved.
2011-05-13 19:46:36 -05:00
Augie Fackler
5ace1beee1 httpclient: import revision b8c3511a8cae from py-nonblocking-http
Fixes issues with SSL_ERROR_WANT_READ incorrectly breaking the
response read.
2011-05-12 10:48:31 -05:00
Sune Foldager
c222fc4662 changelog: don't use generaldelta 2011-05-16 13:06:48 +02:00
Sune Foldager
d7f01e602b revlog: get rid of defversion
defversion was a property (later option) on the store opener, used to propagate
the changelog revlog format to the other revlogs, so they would be created with
the same format.

This required that the changelog instance was created before any other revlog;
an invariant that wasn't directly enforced (or documented) anywhere.

We now use the revlogv1 requirement instead, which is transfered to the store
opener options. If this option is missing, v0 revlogs are created.
2011-05-16 12:44:34 +02:00
Thomas Arendsen Hein
0d153cc970 paths: Add support for -q/--quiet
Suppresses output (resolved paths or "not found!") when searching a path,
similar to "grep -q".
Sample usage: hg paths -q foo || echo "there is no foo"

Just prints path names (instead of "name = result") when listing all path
definitions, like "hg bookmarks -q".
Sample usage: hg paths -q | while read i; do hg incoming "$i"; done
2011-05-16 11:41:48 +02:00
Matt Mackall
3afbc844f5 merge with stable 2011-05-15 13:15:41 -05:00
Matt Mackall
90ea6a60a1 debugrevlog: add --dump flag to dump graphable per-revision statistics 2011-05-15 11:50:16 -05:00
Matt Mackall
608041d55e revlog: restore the base method 2011-05-15 11:50:15 -05:00
Sune Foldager
9634f23f04 debugindex etc.: add --changelog and --manifest options
These open the changelog and manifest, respectively, directly so you don't
need to specify the path.

The options have been added to debugindex, debugdata and debugrevlog.

The patch also fixes some minor usage-related bugs.
2011-05-14 00:30:32 +02:00
Matt Mackall
0832007f60 scmutil: drop aliases in cmdutil for match functions 2011-05-13 14:58:24 -05:00
Matt Mackall
ae22dd85a2 scmutil: drop some aliases in cmdutil 2011-05-13 14:48:48 -05:00
Matt Mackall
03aaf3756d scmutil: fold in wdutil 2011-05-13 14:07:16 -05:00
Matt Mackall
cf07129983 scmutil: move revsingle/pair/range from cmdutil
This allows users at levels below the command layer to avoid import loops.
2011-05-13 14:06:28 -05:00
Matt Mackall
1d5abac148 help: consolidate topic hooks in help.py
This removes loops like cmdutil->revset->help->extensions->cmdutil and
simplifies the code.
2011-05-13 12:57:27 -05:00
Matt Mackall
9fd29f01e9 extensions: move moduledoc to break import loop with help 2011-05-13 11:04:51 -05:00
Matt Mackall
d184ed2af2 extensions: drop maxlength from enabled and disabled
This is a bad/silly API. Instead calculate maxlength in one place in help
it's used and simplify all the callers.
2011-05-13 11:04:51 -05:00
Peter Arrenbrecht
af91571a48 util: make str(url) return file:/// for abs paths again
str(url) was recently changed to return only file:/. However, the
canonical way to represent absolute local paths is file:/// [1], which
is also expected by at least hgsubversion.

Relative paths are returned as file:the/relative/path.

[1] http://en.wikipedia.org/wiki/File_URI_scheme
2011-05-12 16:41:56 +02:00
Matt Mackall
8acd26be3c subrepo: use a safer revision check for hg repos
This avoids a traceback if the expected revision has been stripped.
2011-05-12 18:35:04 -05:00
Steven Brown
195784b9d8 monoblue: improve readability of the filenolink template
Whitespace changes only. No difference to the rendered page.
2011-05-12 18:06:15 +08:00
Sune Foldager
b5be0ed65d debugrevlog: many improvements 2011-05-12 22:37:52 +02:00
Sune Foldager
8f3ebca381 add debugrevlog command
Displays data and statistics about revlogs, including generaldelta details.
2011-05-12 18:22:49 +02:00
Sune Foldager
3d7c8d3ac3 order commands alphabetically 2011-05-12 16:21:01 +02:00
Sune Foldager
2ce60e2564 revlog: improve delta generation heuristics for generaldelta
Without this change, pulls (and clones) into a generaldelta repository could
generate very inefficient revlogs, the size of which could be at least twice
the original size.

This was caused by the generated delta chains covering too large distances,
causing new chains to be built far too often. This change addresses the
problem by forcing a delta against second parent or against the previous
revision, when the first parent delta is in danger of creating a long chain.
2011-05-12 15:24:33 +02:00
Adrian Buehlmann
bd06e02be8 commands: use a decorator to build table incrementally
this allows to define the table entries near the command functions
2011-05-12 08:14:04 +02:00
Sune Foldager
7b30600f6b revlog: fix bug in chainbase cache
The bug didn't cause corruption, and thus wasn't caught in hg verify or in
tests. It could lead to delta chains longer than normally allowed, by
affecting the code that decides when to add a full revision. This could,
in turn, lead to performance regression.
2011-05-12 13:47:17 +02:00
Augie Fackler
93b91bd721 httpconnection: fix debug logging option for httpclient 2011-05-11 08:07:51 -05:00
Augie Fackler
21a2956afa httpclient: import f4c380237fd5 to fix keepalive not working 2011-05-11 08:00:48 -05:00
Sune Foldager
762090a2c7 revlog: add docstring to _addrevision 2011-05-11 11:04:44 +02:00
Matt Mackall
72b9ca1b3b cmdutil: make_file to makefileobj 2011-05-10 16:08:47 -05:00
Matt Mackall
cf2d9729ae cmdutil: make_filename -> makefilename 2011-05-10 16:08:46 -05:00
Matt Mackall
e53ca7b463 cmdutil: bail_if_changed to bailifchanged 2011-05-10 16:08:46 -05:00
Adrian Buehlmann
2a166c5eb3 store: change names to comply with project coding standards
as stated at http://mercurial.selenic.com/wiki/CodingStyle
(see also http://selenic.com/pipermail/mercurial-devel/2011-May/031139.html )

name changes done at module scope:

  _build_lower_encodefun      -> _buildlowerencodefun
  _windows_reserved_filenames -> _winreservednames      (see 42a6bcfc9d44)
  MAX_PATH_LEN_IN_HGSTORE     -> _maxstorepathlen
  DIR_PREFIX_LEN              -> _dirprefixlen
  _MAX_SHORTENED_DIRS_LEN     -> _maxshortdirslen

  (no users of these outside the store module)

changed locals:

  win_reserved  -> winreserved
  space_left    -> spaceleft
2011-05-08 23:27:48 +02:00
Sune Foldager
3a06c3752e filelog: add file function to open other filelogs 2011-05-10 17:38:58 +02:00
Martin Geisler
58a533fee9 help: add -c/--command flag to only show command help (issue2799) 2011-05-10 14:42:53 +02:00
Martin Geisler
0f668c1b4f help: give hint about 'hg help -e' when appropriate
The hint is only given if a command shadows an extension with the same
name and when that extension has a multi-line module docstring.
2011-05-10 13:19:05 +02:00
Alexander Solovyov
6240007914 fix bookmarks rollback behavior
Before this patch undo.bookmarks was created on bookmarks write and
not with other transaction-related files. There were two issues: first
is that if you have changed bookmarks few times after a transaction
happened, rollback will give you a state which can point to
non-existing revision. Second is that if you have not changed
bookmarks after a transaction, rollback will touch your state anyway.

This change also adds `localrepo._writejournal` method, which can be
used by other extensions to save their transaction-related backup in
right time.
2011-05-01 13:07:00 +02:00
Thomas Arendsen Hein
394d9f50d7 subrepo: use code from 1d866b621bf7 only if Python needs it (issue2795)
With Python >= 2.6 the original code already works correct, therefore the
fix for issue2556 on Python <= 2.5 broke relative subrepositories with
newer versions of Python.
2011-05-05 16:01:09 +02:00
Patrick Mezard
3616aca56a subrepo: handle svn tracked/unknown directory collisions
This happens more often than expected. Say you have an svn subrepository with
python code. Python would have generated unknown .pyc files. Now, you rebase
this setup on a revision where a directory containing python code does not
exist. Subversion is first asked to remove this directory when updating, but
will not because it contains untracked items. Then it will have to bring back
the directory after the merge but will fail because it now collides with an
untracked directory.

Using --force is not very elegant and only works with svn >= 1.5 but the only
alternative I can think of is to write our own purge command for subversion.
2011-03-04 14:00:49 +01:00
Augie Fackler
a74cb339b1 subrepo: tell Subversion when we are non-interactive (issue2759)
$ hg clone repo repo-clone -v
  updating to branch default
  resolving manifests
  getting .hgsub
  getting .hgsubstate
  abort: svn: OPTIONS of 'https://subversion.srv/project': Server certificate
  verification failed: issuer is not trusted (https://subversion.srv)
2011-04-29 03:05:48 -05:00
Martin Geisler
7564668184 commit: improve --date help text 2011-04-26 12:55:26 +02:00
Kevin Bullock
4669edf97c identify: further clarification of help
Following on to 9010cb9bd620, correct a minor grammar issue, re-wrap to
72 columns, and further clarify wording.
2011-04-19 13:33:43 -05:00
Martin Geisler
6cd55d2029 hgweb: detect change based on changelog size too
Before, there was a race between an access and a modification made
within the same second.
2011-04-19 15:15:56 +02:00
Martin Geisler
f225a4e198 rollback: lower-case warning issued when branch cannot be reset
Also improved the word order.
2011-04-19 13:25:19 +02:00
Martin Geisler
cb82832656 help config: explain that config files do not exist by default
Inspired by critique given on StackOverflow where a user writes:

  I can have a good guess at what "%USERPROFILE%" might signify but
  none of the files listed in the "hg help config" output exist after
  running the installer. Previous experience would suggest that
  missing files mean something somewhere has gone seriously wrong.

  http://stackoverflow.com/questions/2329023/2351139#2351139
2011-04-18 13:57:22 +02:00
Idan Kamara
44990ce111 identify/help: say what the command does first, mention bookmarks 2011-04-19 00:41:47 +03:00
Matt Mackall
1cf3cf83b1 encoding: avoid localstr when a string can be encoded losslessly (issue2763)
localstr's hash method exists to prevent bogus matching on lossy local
encodings. For instance, we don't want 'caf?' to match 'café' in an
ASCII locale.

But when café can be losslessly encoded in the local charset, we can
simply use a normal string and avoid the hashing trick.


This avoids using localstr's hash method, which would prevent a match between
2011-04-15 23:45:41 -05:00
Idan Kamara
32b141c5c5 help/revset: fix grammar 2011-04-15 16:35:32 +03:00
Thomas Arendsen Hein
e97f821988 subrepo: prevent url normalization from removing // in ssh paths (issue2556) 2011-04-07 12:33:47 +02:00
Md. O. Shayan
43492ff710 hgweb: fix inconsistant display of graphlog (issue1706) 2011-04-07 13:23:07 +05:30
Matt Mackall
ada95b57d4 merge with crew 2011-04-06 15:13:49 -05:00
Matt Mackall
bfe6a35a69 url: use a regex to hide unsupported ssh passwords (issue2754) 2011-04-06 15:10:47 -05:00
Martin Geisler
f484933f96 help/dates: rephrase explanation of internal format
The old explanation referred to the two numbers as "unixtime" and
"offset" without really defining those terms.
2011-04-05 10:04:19 +02:00
Yuya Nishihara
8138520db0 hgweb: add missing bookmarks definition to coal/map
It shares most templates with paper style.
2011-04-03 23:47:17 +09:00
Yuya Nishihara
63284146ac hgweb: add separate bookmarks listing to gitweb theme (based on 77ea38e46cc8) 2011-04-03 23:47:05 +09:00
Yuya Nishihara
ac9ff11417 hgweb: add bookmark labels to gitweb theme (based on 4d7cfa1867b5) 2011-04-03 23:44:28 +09:00
Yuya Nishihara
eac83f8ea6 hgweb: format page_nav of gitweb/error.tmpl and add missing links 2011-04-03 23:42:05 +09:00