sapling/mercurial
FUJIWARA Katsunori 79e0e8b442 windows: check target type before actual unlinking to follow POSIX semantics
Creation and writing into target file via vfs (a.k.a opener) is done
after "unlink()" target file, if it exists.

For example, it is assumed that the revision X consists of file 'A',
and the revision Y consists of file 'A/B'. Merging revision X into Y
tries to "unlink()" on directory 'A' of 'A/B', before creation of file
'A'.

On POSIX environment, directories should be removed by "rmdir(2)", and
"unlink(2)" on directories fails. "unlink()" of Mercurial (and Python)
uses "unlink(2)" directly, so unlinking in the merge case above would
fail.

In the other hand, on Windows environment, "unlink()" of Mercurial
tries to rename before actual unlinking, to follow POSIX semantics:
already opened file can be unlinked safely.

This causes unexpected success in unlinking in the merge case above,
even though directory 'A' is renamed to another. This confuses users.

This patch checks whether target is directory or not before renaming,
and raises IOError(errno.EPERM) if so, to follow POSIX semantics.
2013-05-07 05:04:11 +09:00
..
help smtp: use 465 as default port for SMTPS 2013-04-19 01:26:23 +09:00
hgweb hgweb: handle filtered "0" rev in navigation 2013-04-30 13:53:49 +02:00
httpclient http2: sane readline 2013-02-01 15:00:23 -08:00
pure check-code: catch trailing space in comments 2013-04-15 01:37:23 +02:00
templates css: fixed font-family 2013-04-20 22:09:17 +04:00
__init__.py
ancestor.py revlog: choose a consistent ancestor when there's a tie 2013-04-16 10:08:19 -07:00
archival.py archive: raise error.Abort if the file pattern matches no files 2013-03-21 22:09:15 +01:00
base85.c base85: cast Py_ssize_t values to int (issue3481) 2012-06-04 16:59:34 +02:00
bdiff.c bdiff: simplify overflow checks 2013-02-02 16:15:22 -06:00
bookmarks.py bookmarks: resolve divergent bookmarks when moving active bookmark forward 2013-05-01 15:34:45 -05:00
branchmap.py spelling: fix some minor issues found by spell checker 2013-02-10 18:24:29 +01:00
bundlerepo.py bundlerepo: replace basemap with the base field in the index 2013-02-08 23:26:00 +01:00
byterange.py byterange: remove now-unused sys import 2013-02-09 07:44:22 -06:00
changegroup.py changegroup: decompress GZ algorithm in larger chunks for better performance 2012-04-29 20:58:50 +02:00
changelog.py changelog: hexlify node when throwing a LookupError on a filtered node 2013-02-09 06:07:32 -06:00
cmdutil.py revert: ensure that copies and renames are honored (issue3920) 2013-05-03 12:40:17 -07:00
commands.py bookmarks: fix bug that activated a bookmark even with -r passed 2013-05-01 15:24:21 -05:00
commandserver.py commandserver: report capabilities sorted 2012-12-12 02:38:14 +01:00
config.py config: discard "%unset" values defined in the other files read in previously 2013-04-26 23:36:12 +09:00
context.py annotate: discard refcount of discarded annotation for memory efficiency 2013-04-18 19:50:04 +09:00
copies.py scmutil: use new dirs class in dirstate and context 2013-04-10 15:08:26 -07:00
dagparser.py en-us: labeled 2012-08-17 13:58:18 -07:00
dagutil.py cleanup: "raise SomeException()" -> "raise SomeException" 2012-05-12 16:00:58 +02:00
demandimport.py demandimport: determine at load time if __import__ has level argument 2011-08-22 22:50:52 +02:00
dicthelpers.py dicthelpers.diff: compare against default for missing values 2013-04-10 12:31:07 -07:00
diffhelpers.c diffhelpers: use Py_ssize_t in testhunk() 2012-05-12 14:00:51 +02:00
dirs.c dirs: use mutable strings internally 2013-04-10 15:08:28 -07:00
dirstate.py hgignore: fix regression with hgignore directory matches (issue3921) 2013-05-03 09:44:50 -07:00
discovery.py filtering: rename filters to their antonyms 2013-01-13 01:39:16 -06:00
dispatch.py dispatch: add support for --option=value to _earlygetopt 2013-04-29 14:14:42 -07:00
encoding.py tests: stabilize doctest output 2013-01-15 02:59:14 +01:00
error.py hgweb: show correct error message for i18n environment 2013-02-15 18:07:14 +09:00
exewrapper.c exewrapper: adapt for legacy HackableMercurial 2012-08-07 11:04:41 +02:00
extensions.py extensions: remove erroneous comment 2013-02-14 13:56:02 -06:00
fancyopts.py fancyopts: don't show a traceback on invalid integer values 2012-10-08 15:35:16 +02:00
filelog.py filelog: add file function to open other filelogs 2011-05-10 17:38:58 +02:00
filemerge.py merge: warn when internal:merge cannot merge symlinks 2013-01-15 01:05:11 +01:00
fileset.py filesets: add eol predicate 2013-03-29 16:48:32 -07:00
formatter.py formatter: add condwrite method 2012-11-03 14:37:50 -05:00
graphmod.py graphmod: don't try to visit nullrev (issue3772) 2013-01-23 00:20:26 -06:00
hbisect.py bisect: use changelog for iteration 2013-01-22 03:23:02 +01:00
help.py help: use a full header for topic titles 2013-02-10 12:58:57 +01:00
hg.py largefiles: don't crash when trying to find default dest for url without path 2013-02-04 23:26:44 +01:00
hook.py blackbox: do not translate the log messages 2013-02-13 12:51:30 -08:00
httpconnection.py httpclient: fix calling convention violation 2012-10-18 23:55:15 -05:00
httppeer.py httppeer: avoid large dumps when we don't see an hgweb repo 2013-02-17 14:41:31 -06:00
i18n.py i18n: use getattr instead of hasattr 2011-07-25 20:46:30 -05:00
ignore.py ignore: process hgignore files in deterministic order 2012-12-17 15:57:02 -08:00
keepalive.py keepalive: drop python 2.2 legacy code 2012-10-02 14:27:13 -07:00
localrepo.py push: make locking of source optional (issue3684) 2013-04-30 21:19:56 +02:00
lock.py lock: if we fork, ensure that only the parent releases 2013-04-11 13:30:27 -07:00
lsprof.py profiling: replace '+' markup of nested lines with indentation 2013-02-08 22:54:48 +01:00
lsprofcalltree.py drop unused imports 2009-05-14 15:35:46 +02:00
mail.py smtp: use 465 as default port for SMTPS 2013-04-19 01:26:23 +09:00
manifest.py manifestdict: add a method to diff _flags 2013-03-24 17:17:38 -07:00
match.py match: fix root calculation for combining regexps with simple paths 2013-04-30 01:04:35 +02:00
mdiff.py diff: move index header generation to patch 2012-11-15 15:16:41 -08:00
merge.py icasefs: rewrite case-folding collision detection (issue3452) 2013-04-30 05:01:32 +09:00
minirst.py minirst: optimize HTML table generation a bit 2013-02-09 21:51:21 +00:00
mpatch.c mpatch: use Py_ssize_t for string length 2012-05-20 01:28:31 +02:00
node.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
obsolete.py obsolete: extract obsolescence marker pulling into a dedicated function 2013-04-17 11:47:49 +02:00
osutil.c osutil: tab damage, how i hate thee 2012-12-03 13:17:01 -08:00
parser.py en-us: labeled 2012-08-17 13:58:18 -07:00
parsers.c parsers: remove warning: format ‘%ld’ expects argument of type ‘long int’ 2013-04-18 20:28:38 +02:00
patch.py patch: match 'diff --git a/' instead of 'diff --git' 2013-03-22 17:27:06 -05:00
pathencode.c pathencode: eliminate comma at end of enum list to avoid pedantic warning 2013-04-19 01:34:21 +09:00
peer.py peer: delete double definition of method peer 2012-07-28 22:36:22 +02:00
phases.py destroyed: invalidate phraserevs cache in all case (issue3858) 2013-04-15 17:10:58 +02:00
posix.py hfs+: rewrite percent-escaper (issue3918) 2013-05-04 14:51:21 -05:00
pushkey.py pushkey: do not exchange obsole markers if feature is disabled 2012-07-28 13:33:06 +02:00
pvec.py pvec: use the correct name for an identifier 2013-04-12 17:20:09 -07:00
py3kcompat.py spelling: relies 2012-08-17 13:58:18 -07:00
repair.py blackbox: add backup bundle paths to blackbox logs 2013-03-13 10:43:51 -07:00
repoview.py repoview: remove unreachable code 2013-04-12 17:18:52 -07:00
revlog.py revlog: fix a regression with null revision 2013-04-18 16:46:09 +04:00
revset.py log: fix behavior with empty repositories (issue3497) 2013-04-17 00:29:54 +04:00
scmposix.py scmutil: split platform-specific bits into their own modules 2013-02-12 11:36:21 -06:00
scmutil.py translations: change label integer error to not specify the kind of label 2013-04-19 10:55:11 -07:00
scmwindows.py scmutil: fix NameError on windows 2013-02-21 13:16:02 -06:00
setdiscovery.py delete some dead comments and docstrings 2012-08-21 02:41:20 +02:00
similar.py cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
simplemerge.py cleanup: "raise SomeException()" -> "raise SomeException" 2012-05-12 16:00:58 +02:00
sshpeer.py sshpeer: store subprocess so it cleans up correctly 2013-03-08 16:59:36 -08:00
sshserver.py sshserver: avoid a multi-dot attribute lookup in a hot loop 2012-09-14 12:09:44 -07:00
sslutil.py sslutil: abort if peer certificate is not verified for secure use 2013-03-26 02:28:10 +09:00
statichttprepo.py statichttprepo: add missing import of os 2013-04-12 17:17:05 -07:00
store.py store: switch to C-based hashed path encoding 2012-12-12 13:09:37 -08:00
strutil.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
subrepo.py subrepo: open files in 'rb' mode to read exact data in (issue3926) 2013-05-09 21:09:58 +09:00
tags.py tags: update tag type only if tag node is updated (issue3911) 2013-04-30 09:02:02 +09:00
templatefilters.py templatefilters: add missing import of _ 2013-02-28 13:55:00 +01:00
templatekw.py templatekw: add default styles for hybrid types (issue3887) 2013-04-16 09:44:29 -05:00
templater.py hgweb: make help verbose again (issue3899) 2013-04-22 12:27:56 +04:00
transaction.py spelling: journaling 2012-08-17 13:58:18 -07:00
treediscovery.py util: subclass deque for Python 2.4 backwards compatibility 2012-06-01 17:05:31 -07:00
ui.py i18n: show the non-ASCII password prompt text correctly 2013-04-25 20:48:49 +09:00
unionrepo.py unionrepo: read-only operations on a union of two localrepos 2013-01-18 15:54:09 +01:00
url.py url: clean up use of two-argument raise 2013-01-01 12:50:46 -06:00
util.h store: implement fncache basic path encoding in C 2012-09-18 15:42:19 -07:00
util.py util: add notindexed optional parameter to makedirs function 2013-02-16 11:44:13 +01:00
verify.py clfilter: verify logic should be unfiltered 2012-10-08 17:08:52 +02:00
win32.py windows: check target type before actual unlinking to follow POSIX semantics 2013-05-07 05:04:11 +09:00
windows.py util: add functions to check symlink/exec bits 2013-04-03 11:35:27 -07:00
wireproto.py wireproto: clarify cryptic 'remote: unsynced changes' error message on push 2013-04-11 14:54:18 +02:00
worker.py worker: add missing import of errno 2013-04-12 17:16:37 -07:00