Commit Graph

80 Commits

Author SHA1 Message Date
Bryan O'Sullivan
51dda0ee74 scmutil: turn opener._audit into a property, mustaudit
This will be used by an upcoming patch.
2012-09-14 12:04:35 -07:00
Patrick Mezard
7221d12e58 discovery: add extinct changesets to outgoing.excluded
Before this change, push would incorrectly fast-path the bundle
generation when extinct changesets are involved, because they are not
added to outgoing.excluded. The reason to do so are related to
outgoing.excluded being assumed to contain only secret changesets by
scmutil.nochangesfound(), when displaying warnings like:

 changes found (ignored 9 secret changesets)

Still, outgoing.excluded seems like a good API to report the extinct
changesets instead of dedicated code and nothing in the docstring
indicates it to be bound to secret changesets. This patch adds extinct
changesets to outgoing.excluded and fixes scmutil.nochangesfound() to
filter the excluded node list.

Original version and test by Pierre-Yves.David@ens-lyon.org
2012-07-25 19:34:31 +02:00
Joshua Redstone
30df933365 scmutil: 25% speedup in casecollisionauditor
On a large repository, switching casecollisionauditor to lowercasing all file
names at once rather than one at a time improves hg-add time by 25%.
2012-07-06 13:56:40 -07:00
FUJIWARA Katsunori
64cae05faf localrepo: use file API via vfs while ensuring repository directory
As a part of migration to vfs, this patch invokes some file API
indirectly via vfs, while ensuring repository directory in the
constructor of "localrepository" class.

New file API are added to "scmutil.abstractopener" class, because they
are also used via other derived classes than "scmutil.opener".

But "join()" is not yet defined other than "scmutil.opener" class,
because it should not be used via other opener classes yet.
2012-07-06 18:45:27 +09:00
FUJIWARA Katsunori
d20072de6a localrepo: use path expansion API via vfs
As a part of migration to vfs, this patch moves path expansion API
invocations in the constructor of "localrepository" to the constructor
of "opener", because the root path to the repository is very important
to handle paths using non-ASCII characters correctly.

This patch also rearrange initialization order of "wvfs" field,
because it is required to initialize "self.root".
2012-07-06 18:45:27 +09:00
Mads Kiilerich
ff855a00ed help: improve hgweb help
The existing help only walked through an example.

Now we first explain the basic rules and then show an example.

The 'collections' example and description only cause confusion and is removed.

Bikeshedded by Patrick Mezard <patrick@mezard.eu>
2012-06-21 12:50:15 +02:00
Bryan O'Sullivan
4bb35317bc scmutil: speed up new-style range extension
This improves perfrevset performance by 10% for 2222::33333 on a
kernel repo.
2012-06-22 12:00:41 -07:00
Adrian Buehlmann
9a9882a6d8 scmutil: change canonpath to use util.samefile (issue2167)
Fixes (on Windows in cmd.exe):

  $ hg -R v:\x\a status V:\x\a\bar
  abort: V:\x\a\bar not under root

where v:\x\a is a valid repository with a checked-out file "bar"
(Note the difference in casing: "v:\" versus "V:\")
2012-06-14 11:43:48 +02:00
Matt Mackall
da90115a02 merge with stable 2012-06-01 15:14:29 -05:00
Bryan O'Sullivan
ca79cf4afa scmutil: seen.union should be seen.update (issue3476) 2012-05-31 20:55:30 -07:00
Matt Mackall
d4e4a5b5be revpair: handle odd ranges (issue3474) 2012-05-30 14:13:57 -05:00
Adrian Buehlmann
19b92fcf59 scmutil: use _winreg.HKEY_LOCAL_MACHINE 2012-05-27 11:30:03 +02:00
Matt Mackall
bfe92722a0 merge with stable 2012-05-30 14:21:58 -05:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
Thomas Arendsen Hein
243e5232c0 opener: coding style, use triple quotes for doc string 2012-04-18 15:16:15 +02:00
Matt Mackall
b55cd4a40b opener: introduce tryread helper
This makes it easier to follow the common pattern "read a file or give
an empty string if it's missing".
2012-04-17 11:11:59 -05:00
Wolfgang Treutterer
00e7333b1b scmutil: fix systemrcpath regression introduced in ebc9c501f13c
Changeset ebc9c501f13c introduced a 'root' path component to look for
hgrc files, which is used both as an absolute path and a path relative
to the <install-root>.
The latter one was broken since 'root' was set to an absolute location
and the subsequent os.path.join discarded the <install-root> path prefix.
2012-04-13 10:08:08 +02:00
Bryan O'Sullivan
ba47c1b0e5 scmutil: speed up revrange
This improves the performance of "hg log -l1" from 0.21 seconds to
0.07 on a Linux kernel tree.

Ideally we could use xrange instead of range on the most common
path, and thus avoid a ton of allocation, but xrange doesn't support
slice-based indexing.
2012-04-09 22:16:26 -07:00
Steven Stallion
d79ff306e5 plan9: initial support for plan 9 from bell labs
This patch contains support for Plan 9 from Bell Labs. A README is
provided in contrib/plan9 which describes the port in greater detail.
A new extension is also provided named factotum which permits the
factotum(4) authentication agent to provide credentials for HTTP
repositories. This extension is also applicable to other POSIX
platforms which make use of Plan 9 from User Space (aka plan9ports).
2012-04-08 12:43:41 -07:00
Matt Mackall
8dac6af07e scmutil: use context instead of lookup 2012-04-08 12:38:23 -05:00
Thomas Arendsen Hein
0f80b37090 merge with stable 2012-03-02 09:57:09 +01:00
Idan Kamara
6f16e78f1f scmutil: add join method to opener to construct path relative to base
Useful when we only have the opener without the base path used when it was
constructed.
2012-03-01 17:39:58 +02:00
Idan Kamara
58bc817cd0 filecache: refactor path join logic to a function
New users of filecache use different names for the function used to compute
the runtime path of the cached file.

Users should subclass filecache and provide their own version of this
function to call the appropriate join function on 'obj' (an instance
of the class that its member function was decorated).
2012-03-01 17:39:58 +02:00
Patrick Mezard
22a413e426 graphlog: restore FILE glob expansion on Windows
On platforms not supporting shell expansion, scmutil.match() performs glob
expansion on 'pats' arguments. But _matchfiles() revset calls match.match()
directly, bypassing this behaviour. To avoid duplicating scmutil.match(), a
secondary scmutil.matchandpats() is introduced returning both the match object
and the expanded inputs. Note the expanded pats are also needed in the fast
path, and will be used by --follow code path.
2012-02-25 22:11:34 +01:00
Matt Mackall
7c3342ed27 addremove: return 1 if we failed to handle any explicit files 2012-02-24 16:52:32 -06:00
Idan Kamara
f729c0ef8a scmutil: update cached copy when filecached attribute is assigned (issue3263)
When assigning a new object to filecached properties, the cached object that
was kept in the _filecache map was still holding the old object.

By implementing __set__, we track these changes too and update the cached
copy as well.
2012-02-15 20:02:35 +02:00
FUJIWARA Katsunori
d93ccafb52 use util.localpath() instead of 'str.replace()' to unify path conversion 2012-02-05 22:58:31 +09:00
Matt Mackall
e4d11ad28c scmutil: unify some 'no changes found' messages
This keeps the wording more consistent for secret csets
2012-01-25 17:14:08 -06:00
Dan Villiom Podlaski Christiansen
6ee655e337 canonpath: allow canonicalization of non-existant paths
Such as a copy destination; see the added test.
2012-01-08 15:23:26 +01:00
Matt Mackall
dc09090fed merge with stable 2011-12-26 18:08:20 -06:00
FUJIWARA Katsunori
529dcf14a4 windows: force specified path to be audited in localpath form
pathauditor is invoked not only for localpath form using "os.sep" as
separator, but also for normalized form using "/": for example, hg
internal path like "store/data" under ".hg", or ones normalized by
match object

this causes insufficient repository nesting check, because current
pathauditor implementation divides specified path into components by
"os.sep", and this causes to treat multiple path components joined by
"/" as single one on Windows environment.

this patch applies "util.localpath()" on specified path to force it to
be divided into components correctly.

in fact, root for pathauditor also uses multiple path separator on
Windows. but this does not affect audit itself, so "util.localpath()"
is not applied on it.
2011-12-24 19:01:07 +09:00
FUJIWARA Katsunori
44af3b0ebf pathauditor: switch normcase logic according to case sensitivity of filesystem
this patch applies 'util.normcase()' to audit path only on case
insensitive filesystem.
2011-12-16 21:09:40 +09:00
FUJIWARA Katsunori
6b07b41e4f pathauditor: preserve case in abort messages
this patch uses both plain and normcase()-ed pathes to preserve letter
case of path in abort messages.
2011-12-16 21:09:40 +09:00
FUJIWARA Katsunori
afdb157d48 pathauditor: use normcase()-ed path for audit result cache
in current pathauditor implementation, un-normcase()-ed path is
stored into and compared with audit result cache.

this is not efficiency on case insensitive filesystem.
2011-12-16 21:09:40 +09:00
Matt Mackall
7cf4e6eacb merge with stable 2011-12-16 19:05:59 -06:00
Mads Kiilerich
782d103c42 cmdutil: don't use repr on paths in pathauditor - it looks strange on windows 2011-11-07 02:49:00 +01:00
Matt Mackall
7cae202e57 merge with stable 2011-07-29 17:27:38 -05:00
FUJIWARA Katsunori
a423a1ab9d i18n: use UTF-8 string to lower filename for case collision check
Some character sets, cp932 (known as Shift-JIS for Japanese) for
example, use 0x41('A') - 0x5A('Z') and 0x61('a') - 0x7A('z') as second
or later character.

In such character set, case collision checking recognizes different
files as CASEFOLDED same file, if filenames are treated as byte
sequence.

win32mbcs extension is not appropriate to handle this problem, because
this problem can occur on other than Windows platform only if
problematic character set is used.

Callers of util.checkcase() use known ASCII filenames as last
component of path, and string.lower() is not applied to directory part
of path. So, util.checkcase() is kept intact, even though it applies
string.lower() to filenames.
2011-07-28 14:36:07 +09:00
Steve Borho
bb2fdf8f33 scmutil: add missing import of re
see https://bitbucket.org/tortoisehg/thg/issue/929
2011-07-08 20:24:19 -05:00
Pierre-Yves David
2ebc0660c3 requirements: show all missing features in the error message.
Displaying all missing featureis help people to solve the issue (choosing the
right version, creation the right repo)
2011-06-25 02:30:24 +02:00
Adrian Buehlmann
a6cb8dc613 opener: add self._audit (issue2862) 2011-06-22 10:13:44 +02:00
Matt Mackall
deda228cd7 scmutil: match no longer accepts repo objects 2011-06-18 16:52:51 -05:00
Matt Mackall
5ab97592f7 scmutil: switch match users to supplying contexts
The most appropriate context is not always clearly defined. The obvious cases:

For working directory commands, we use None
For commands (eg annotate) with single revs, we use that revision

The less obvious cases:

For commands (eg status, diff) with a pair of revs, we use the second revision
For commands that take a range (like log), we use None
2011-06-18 16:52:51 -05:00
Matt Mackall
7fe2a75e90 scmutil: match now accepts a context or a repo 2011-06-18 16:52:51 -05:00
Matt Mackall
3ca86d272f context: add a match builder method
This is groundwork for matching against filesets in contexts
2011-06-18 16:52:51 -05:00
Matt Mackall
86143efd7d scmutil: improve path calculation for install-relative RC files (issue2841)
This code was ugly and might do the wrong thing with symlinks.
2011-06-03 15:08:08 -05:00
Matt Mackall
b0048281b5 requires: note apparent corruption 2011-05-31 15:55:23 -05:00
Adrian Buehlmann
cfc4484960 readrequires: provide easier to understand error message
NEW:

  $ hg id
  abort: unknown repository format: requires feature 'foo' (upgrade Mercurial)!

OLD:

  $ hg id
  abort: requirement 'foo' not supported!
2011-05-31 19:16:25 +02:00
Adrian Buehlmann
924c56c606 introduce new function scmutil.readrequires
for reading and parsing the .hg/requires file
2011-05-31 19:16:18 +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