Commit Graph

7449 Commits

Author SHA1 Message Date
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
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
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
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
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
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