Commit Graph

14897 Commits

Author SHA1 Message Date
Adrian Buehlmann
b58d26815b windows: eliminate win32 wildcard import 2011-07-29 00:39:27 +02:00
Matt Mackall
7cae202e57 merge with stable 2011-07-29 17:27:38 -05:00
Matt Mackall
2a8aa75bfe merge with crew 2011-07-29 17:27:14 -05:00
Matt Mackall
f04c56437d merge with crew 2011-07-28 14:20:06 -05:00
Lee Cantey
974aa0a16d test-filecache: change for python 2.4 compatibility 2011-07-28 02:38:01 +03:00
Andrew Pritchard
f23118834a setdiscovery: return anyincoming=False when remote's only head is nullid
This fixes (issue2907) a crash when using 'hg incoming --bundle' with an empty
remote repo and a non-empty local repo.

This also fixes an unreported bug that 'hg summary --remote' erroneously
reports incoming changes when the remote repo is empty and the local is not.

Also, add a test to make sure issue2907 stays fixed
2011-07-27 18:32:54 -04: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
Patrick Mezard
50825774f7 notify: rewrite user documentation
The main intent is to turn the reference help into a configuration walkthrough.
It also fix several things:
- Do not suggest to use it for commit notifications, it cannot work
- Fix notify.strip default value
- Mention that subscriptions can be setup in Mercurial configuration files
- Improve notify.strip and notify.domain documentation
2011-07-26 21:30:12 +02:00
Augie Fackler
3a3e79d5b5 check-code: disallow use of hasattr()
The hasattr() builtin from Python < 3.2 [1] has slightly surprising
behavior: it catches all exceptions, even KeyboardInterrupt. This
causes it to have several surprising side effects, such as hiding
warnings that occur during attribute load and causing mysterious
failure modes when ^Cing an application. In later versions of Python
2.x [0], exception classes which do not inherit from Exception (such
as SystemExit and KeyboardInterrupt) are not caught, but other types
of exceptions may still silently cause returning False instead of
getting a reasonable exception.

[0] http://bugs.python.org/issue2196
[1] http://docs.python.org/dev/whatsnew/3.2.html
2011-07-25 14:59:31 -05:00
Augie Fackler
5a1e206eb8 demandimport: use getattr instead of hasattr
We don't use util.safehasattr() here to avoid adding new dependencies
for demandimport. This change may expose previously-silenced
deprecation warnings to appear, as hasattr silently hides warnings
that occur during module import when using demandimport.
2011-07-25 21:15:48 -05:00
Idan Kamara
ce5a7b8382 cmdserver: repo.invalidate() on every runcommand
This will trigger the filecache and recreate every cached property that was
changed by something other than this cmdserver instance (e.g. by running
'hg commit' at the cmdline).
2011-07-25 22:19:28 +03:00
Angel Ezquerra
3ee1ac8027 help: add "web/logoimg" setting description 2011-07-25 08:28:37 +02:00
Matt Mackall
291c95dda6 filecache: fix check-code complaint 2011-07-25 12:58:47 -05:00
Idan Kamara
e37d7b9cbe localrepo: unify tag related info into a tagscache class 2011-07-25 15:08:57 +03:00
Idan Kamara
00456bfe26 localrepo: make invalidate() walk _filecache 2011-07-25 15:08:37 +03:00
Idan Kamara
a2947574cb localrepo: decorate manifest() with filecache 2011-07-25 15:08:37 +03:00
Idan Kamara
91c5accca8 localrepo: decorate _bookmarks/current with filecache
nodebookmarks() can be cached as well, leaving for later
2011-07-25 15:08:37 +03:00
Idan Kamara
61b90b0061 localrepo: decorate changelog() with filecache 2011-07-25 15:08:37 +03:00
Idan Kamara
398def5032 localrepo: refresh filecache entries after releasing a repo.lock() 2011-07-25 15:08:37 +03:00
Idan Kamara
e627b89651 localrepo: decorate dirstate() with filecache
We refresh the stat info when releasing repo.wlock(), right after writing it.

Also, invalidate the dirstate by deleting its attribute. This will force a
stat by the decorator that actually checks if anything changed, rather than
reading it again every time.

Note that prior to this, there was a single dirstate instance created for a
localrepo. It was invalidated by calling dirstate.invalidated(), clearing
its internal attributes.

As a consequence, the following construct is no longer safe:

  ds = repo.dirstate # keep a reference to the repo's dirstate
  wlock = repo.wlock()
  try:
      ds.setparents(...)
  finally:
      wlock.release() # dirstate should be written here

Since it's possible that the dirstate was modified between lines #1 and #2,
therefore changes to the old dirstate won't get written when the lock releases,
because a new instance was created by the decorator.
2011-07-25 15:08:37 +03:00
Idan Kamara
1c37933f72 localrepo: add a cache with stat info for files under .hg/ 2011-07-25 15:08:37 +03:00
Wagner Bruna
92a9350b35 test-i18n, i18n-pt_BR: updated test message changed in 73e761bdb384 2011-07-22 20:31:15 -03:00
Wagner Bruna
47fc87f884 i18n-pt_BR: synchronized with ea9f5211c508 2011-07-22 20:27:40 -03:00
Augie Fackler
88cecc18f1 rebase: remove trailing whitespace found by check-code 2011-07-21 15:56:15 -05:00
Lee Cantey
22431d693c hooks: use python 2.4 compatible exception handling 2011-07-22 08:03:47 -07:00
Matt Mackall
8fc00f653d url: handle urls of the form file:///c:/foo/bar/ correctly 2011-07-22 17:11:35 -05:00
David Golub
11baa243a9 dispatch: avoid double backslashes in error message
The use of %r in the format string caused Python to display Windows paths with
double backslashes.
2011-07-21 16:02:34 -04:00
Matt Mackall
edf401959a revert: restore check for uncommitted merge (issue2915) (BC)
This will restore the pre-1.9 behavior.
2011-07-21 15:39:37 -05:00
Kevin Bullock
e4deb92563 subrepo: don't commit in subrepo if it's clean
If a subrepo has changed relative to the outer repo's substate, but the
subrepo itself is clean, we don't need to commit in the subrepo.
2011-07-19 13:43:53 -05:00
Stefano Tortarolo
1f811e0952 rebase: block collapse with keepbranches on multiple named branches (issue2112)
Collapse and keepbranches should be blocked when there is more than
one named branch on the branch that's going to be rebased.
2011-07-18 22:58:21 +02:00
Idan Kamara
361e7cfb4a win32: assign winstdout to sys.__stdout__ as well (issue2888)
On Windows sys.stdout was being replaced with winstdout, which caused
util.system() to redirect its output (due to 388eabdda556). That causes
interactive tools (such as vim) to stop working.
2011-07-16 15:24:28 +03:00
Idan Kamara
3b6032fdaf scmutil: introduce filecache
The idea is being able to associate a file with a property, and watch
that file stat info for modifications when we decide it's important for it to
be up-to-date. Once it changes, we recreate the object.

On filesystems that can't uniquely identify a file, we always recreate.

As a consequence, localrepo.invalidate() will become much less expensive in the
case where nothing changed on-disk.
2011-07-09 19:06:59 +03:00
Idan Kamara
09359f3d7d posix, windows: introduce cachestat
This class contains a stat result, and possibly other file info to reliably
determine between two points in time whether a file has changed.

Uniquely identifying a file gives us that reliability because we either
atomic rename or append. So one of two will happen: the file 'id' will change,
or the size of the file will change.

posix implements it simply by calling os.stat() and checking if the result
has st_ino.

For now on Windows we always assume the path is uncacheable. This can be
improved on NTFS due to file IDs: http://msdn.microsoft.com/en-us/library/aa363788(v=vs.85).aspx

So we need to find out if a file path is on an NTFS drive, for that we have:

- GetVolumeInformation, which unfortunately only works with a root path (but is available on XP)
- GetVolumeInformationByHandleW, works on a full file path but requires Vista or higher
2011-07-25 15:03:02 +03:00
Adrian Buehlmann
f1218befa0 util: eliminate wildcard imports 2011-07-23 12:29:52 +02:00
Matt Mackall
4257ca8615 templater: use a global funcs table 2011-07-23 14:33:35 -05:00
Simon Heimberg
9cc31081c5 ui: config path relative to repo root 2011-07-23 06:09:14 +02:00
Simon Heimberg
e99ca763b9 ui: providing no default value to configpath should not raise an Error 2011-07-23 06:08:52 +02:00
Simon Heimberg
28de693a93 ui: fix error, base can not be a list 2011-07-23 06:08:49 +02:00
Matt Mackall
8cb28238c5 merge with stable 2011-07-23 11:52:25 -05:00
Matt Mackall
e7ac311a48 merge with stable 2011-07-22 17:17:23 -05:00
Angel Ezquerra
9f2d3a19a5 hgweb: add a "web/logoimg" setting to customize the web logo image
This change complements the existing web/logourl setting, and lets the user
customize the logo image that is shown on many of the hg server pages.

If this setting is not set, hglogo.png is used.
2011-07-21 15:10:16 +02:00
Adrian Buehlmann
2229d01007 util: move windows and posix wildcard imports to begin of file 2011-07-21 11:05:26 +02:00
Adrian Buehlmann
fefd0e5c0a util: move "default" hidewindow to posix.py
There is a hidewindow in win32.py, which we get via windows.py
2011-07-22 10:35:05 +02:00
Adrian Buehlmann
b3b6db23eb util: move "default" lookupreg to posix.py
There is a lookupreg in win32.py, which we get via windows.py
2011-07-22 10:31:56 +02:00
Adrian Buehlmann
f5f99a1f05 util: move "default" unlinkpath to posix.py
we have a unlinkpath in windows.py
2011-07-22 09:55:46 +02:00
Adrian Buehlmann
0da6a5ee7a util: move "default" makedir to posix.py
makedir is already defined in win32.py, which gets imported into util.py
via windows.py if we are running on Windows
2011-07-22 09:53:15 +02:00
Augie Fackler
761e80b9ae summary: allow color to highlight active bookmark 2011-07-21 15:52:08 -05:00
Augie Fackler
2847cf3f0e summary: show bookmarks separate from tags and note active mark (issue2892) 2011-07-18 07:53:26 -05:00
Andrew Pritchard
99a944ad65 localrepo: make requirements attribute of newly-created repos contain a set
This is for internal consistency, as this attribute typically contains a set
2011-07-20 18:23:06 -04:00
Matt Mackall
fa1960ed0a localrepo: fix comment on set 2011-07-22 16:46:22 -05:00