sapling/mercurial
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
..
help revset aliases 2011-04-30 18:30:14 +02:00
hgweb rename util.set_binary to setbinary 2011-05-06 15:25:35 +02:00
httpclient httpclient: import revision fc731618702a of py-nonblocking-http 2011-05-17 10:28:03 -05:00
pure pure parsers: properly detect corrupt index files 2011-05-24 13:30:10 -05:00
templates coal: use preformatted text for descriptions (issue2835) 2011-05-27 08:50:27 -05:00
__init__.py Add back links from file revisions to changeset revisions 2005-05-03 13:16:10 -08:00
ancestor.py ancestor: improve description 2011-03-07 15:45:10 -06:00
archival.py move opener from util to scmutil 2011-04-20 19:54:57 +02:00
base85.c backout of e4cb9628354c 2011-01-27 11:15:08 +01:00
bdiff.c bdiff.c: rename all variables which hold a hash value to "hash" 2011-03-23 02:33:24 +01:00
bookmarks.py merge with stable 2011-05-08 16:16:41 -05:00
bundlerepo.py bundlerepo: make getremotechanges support filtering of incoming 2011-05-23 20:35:10 +02:00
byterange.py pylint, pyflakes: remove unused or duplicate imports 2010-04-14 17:58:10 +09:00
changegroup.py unbundler: separate delta and header parsing 2011-04-30 19:01:24 +02:00
changelog.py merge with stable 2011-05-19 18:10:03 +02:00
cmdutil.py cmdutil: make private copies of option lists to avoid sharing monkeypatches 2011-05-26 17:15:35 -05:00
commands.py commands.remove: don't use workingctx.remove(list, unlink=True) 2011-05-27 15:59:52 +02:00
config.py config: use util.posixfile 2011-03-16 18:48:59 +01:00
context.py context: make forget work like commands.forget 2011-05-26 17:15:35 -05:00
copies.py misc: replace .parents()[0] with p1() 2011-04-04 16:21:59 -05:00
dagparser.py cleanup: use x in (a, b) instead of x == a or x == b 2010-09-23 00:02:31 -05:00
dagutil.py revlogdag: add linearize function 2011-05-18 23:11:34 +02:00
demandimport.py demandimport: change default for level from None to -1 2010-12-01 21:46:08 +01:00
diffhelpers.c backout of e4cb9628354c 2011-01-27 11:15:08 +01:00
dirstate.py dirstate: rename forget to drop 2011-05-26 17:15:35 -05:00
discovery.py discovery: resurrect findoutgoing as findcommonoutgoing for extension hooks 2011-05-06 14:44:18 +02:00
dispatch.py dispatch: use the request to store the ui object 2011-05-26 00:53:23 +03:00
encoding.py encoding: add an encoding-aware lower function 2011-04-30 10:57:13 -05:00
error.py introduce new RequirementError (issue2649) 2011-02-18 20:25:25 +01:00
extensions.py extensions: raise when trying to find an extension that failed to load 2011-05-23 23:09:00 +03:00
fancyopts.py help: show value requirement and multiple occurrence of options 2010-06-06 17:25:00 +09:00
filelog.py filelog: add file function to open other filelogs 2011-05-10 17:38:58 +02:00
filemerge.py rename util.find_exe to findexe 2011-05-08 20:35:46 +02:00
graphmod.py graphmod: correctly emit nodes with more than 2 predecessors 2011-05-01 15:51:46 +02:00
hbisect.py hbisect: use real Booleans instead of 0/1 2011-05-06 10:02:46 +02:00
help.py help: consolidate topic hooks in help.py 2011-05-13 12:57:27 -05:00
hg.py clone: make default path absolute for all local paths 2011-05-18 23:20:26 -07:00
hook.py rename explain_exit to explainexit 2011-05-06 15:31:09 +02:00
httpconnection.py httprepo: handle large lengths by bypassing the len() operator 2011-05-24 17:30:00 -05:00
httprepo.py httprepo: send URL redirection notices to stderr (issue2828) 2011-05-24 17:16:31 -05:00
i18n.py HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT 2011-01-05 00:18:36 +11:00
ignore.py remove unnecessary list comprehensions 2011-02-03 10:31:17 +01:00
keepalive.py fix coding style (reported by pylint) 2010-02-08 15:36:34 +01:00
localrepo.py dirstate: rename forget to drop 2011-05-26 17:15:35 -05:00
lock.py lock: use util.unlink (issue2537) 2011-01-11 14:10:16 +01:00
lsprof.py lsprof: remove #!-line from non-executable script 2010-10-25 23:46:26 +02:00
lsprofcalltree.py drop unused imports 2009-05-14 15:35:46 +02:00
mail.py rename util.find_exe to findexe 2011-05-08 20:35:46 +02:00
manifest.py revlog: compute correct deltaparent in the deltaparent function 2011-05-05 18:05:24 +02:00
match.py match: make 'listfile:' split on LF and CRLF 2011-05-07 21:12:30 +02:00
mdiff.py mdiff: carriage return (\r) is also ignorable whitespace 2010-10-19 03:55:06 +02:00
merge.py dirstate: rename forget to drop 2011-05-26 17:15:35 -05:00
minirst.py minirst: read test input from stdin 2011-05-26 10:46:34 +02:00
mpatch.c backout of e4cb9628354c 2011-01-27 11:15:08 +01:00
node.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
osutil.c osutil: replace #import with #include, and add a check for it 2011-03-23 23:05:32 +01:00
parser.py revset: report a parse error if a revset is not parsed completely (issue2654) 2011-03-16 23:09:14 +01:00
parsers.c backout of e4cb9628354c 2011-01-27 11:15:08 +01:00
patch.py patch: refactor file creation/removal detection 2011-05-27 21:50:09 +02:00
posix.py rename util.is_exec to isexec 2011-05-08 20:45:47 +02:00
pushkey.py bookmarks: move pushkey functions into core 2011-02-10 13:46:27 -06:00
py3kcompat.py py3kcompat: added fake ord implementation for py3k 2010-08-07 16:38:38 -03:00
repair.py remove unused imports and variables 2011-04-30 13:59:14 +02:00
repo.py Make sure bundlerepo doesn't leak temp files (issue2491) 2011-02-12 10:58:11 +01:00
revlog.py revlog: stop exporting node.short 2011-05-21 15:01:28 -05:00
revset.py merge with stable 2011-05-18 09:56:27 +02:00
scmutil.py context: make forget work like commands.forget 2011-05-26 17:15:35 -05:00
setdiscovery.py setdiscovery: limit lines to 80 characters 2011-05-05 23:21:37 +08:00
similar.py fix coding style 2010-05-02 00:48:33 +02:00
simplemerge.py merge with stable 2011-05-15 13:15:41 -05:00
sshrepo.py localrepo, sshrepo: use Boolean create argument in __init__ 2011-05-18 19:30:17 +02:00
sshserver.py rename util.set_binary to setbinary 2011-05-06 15:25:35 +02:00
sslutil.py sslutil: extracted ssl methods from httpsconnection in url.py 2011-05-04 22:08:55 -05:00
statichttprepo.py prevent transient leaks of file handle by using new helper functions 2011-05-02 10:11:18 +02:00
store.py store: change names to comply with project coding standards 2011-05-08 23:27:48 +02:00
strutil.py Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
subrepo.py subrepo: refactor writestate for clarity 2011-05-27 11:01:44 +02:00
tags.py prevent transient leaks of file handle by using new helper functions 2011-05-02 10:11:18 +02:00
templatefilters.py help: consolidate topic hooks in help.py 2011-05-13 12:57:27 -05:00
templatekw.py patch: restore the previous output of 'diff --stat' 2011-05-26 22:51:02 +08:00
templater.py prevent transient leaks of file handle by using new helper functions 2011-05-02 10:11:18 +02:00
transaction.py transaction: use posixfile and unlink from util 2011-02-15 14:41:49 +01:00
treediscovery.py treediscovery: fix regression when run against older repos (issue2793) 2011-05-05 12:53:33 +02:00
ui.py ui: enable alias exception when reading config in plain mode 2011-05-17 00:17:52 +02:00
url.py url: use new http support if requested by the user 2011-05-06 10:22:08 -05:00
util.h backout of e4cb9628354c 2011-01-27 11:15:08 +01:00
util.py util: make str(url) return file:/// for abs paths again 2011-05-12 16:41:56 +02:00
verify.py code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
win32.py win32.py: add argtypes and restype 2011-05-15 21:33:51 +02:00
windows.py rename util.find_exe to findexe 2011-05-08 20:35:46 +02:00
wireproto.py wireproto: enable optional args for known() for future extensibility 2011-05-24 17:48:16 +02:00