Commit Graph

168 Commits

Author SHA1 Message Date
Adrian Buehlmann
e981d64ef2 rename path_auditor to pathauditor
The Mercurial 1.9 release is moving a lot of stuff around anyway and we are
already moving path_auditor from util.py to scmutil.py for that release.

So this seems like a good opportunity to do such a rename. It also strengthens
the current project policy to avoid underbars in names.
2011-05-06 09:54:06 +02:00
Dan Villiom Podlaski Christiansen
88e742876f util & scmutil: adapt read/write helpers as request by mpm 2011-05-02 10:11:05 +02:00
Adrian Buehlmann
c14abef27b scmutil: introduce casecollisionauditor
and cleaning up portability functions
2011-04-30 23:27:00 +02:00
Dan Villiom Podlaski Christiansen
e36632966a opener: add read & write utility methods
The two new methods are useful for quickly opening a file for reading
or writing. Unlike 'opener(...).read()', they ensure they the file is
immediately closed without relying on CPython reference counting.
2011-04-30 19:41:53 +02:00
Dan Villiom Podlaski Christiansen
9b9141450f add filteropener abstraction for store openers 2011-04-30 19:37:13 +02:00
Dan Villiom Podlaski Christiansen
30ecd40f14 opener: introduce an abstact superclass of it
Currently, this class doesn't do anything useful.
2011-04-30 19:36:48 +02:00
Kevin Gessner
e0a808198a add: notify when adding a file that would cause a case-folding collision
On a case-sensitive file system, files can be added with names that differ
only in case (a "case collision"). This would cause an error on case-insensitive
filesystems. A warning or error is now given for such collisions, depending on
the value of ui.portablefilenames ('warn', 'abort', or 'ignore'):

    $ touch file File
    $ hg add --config ui.portablefilenames=abort File
    abort: possible case-folding collision for File
    $ hg add File
    warning: possible case-folding collision for File
2011-04-30 12:39:46 +02:00
Kevin Gessner
3eac7995c0 scmutil: refactor ui.portablefilenames processing
The ui.portablefilenames config handling is generally useful for notifying the
user of various portability problems.
2011-04-30 11:08:24 +02:00
Adrian Buehlmann
a928db8b4e move system_rcpath and user_rcpath to scmutil 2011-04-21 21:16:54 +02:00
Adrian Buehlmann
bee8559898 move os_rcpath from util to scmutil 2011-04-21 20:54:45 +02:00
Adrian Buehlmann
9a67b02dba move rcpath from util to scmutil 2011-04-21 20:14:29 +02:00
Adrian Buehlmann
267c80394b move walkrepos from util to scmutil 2011-04-21 16:06:19 +02:00
Adrian Buehlmann
756a1d3529 move checkfilename from util to scmutil
checkfilename is specific to Mercurial, since it contains the knowledege
that Mercurial can't track files with \n or \r in the name.
2011-04-21 13:18:52 +02:00
Adrian Buehlmann
bf5585ac5b scmutil: fix erroneous Abort call
This fixes d26b1348d3f6 (affected Windows only).
2011-04-21 12:10:03 +02:00
Adrian Buehlmann
307196b733 move path_auditor from util to scmutil 2011-04-20 22:43:31 +02:00
Adrian Buehlmann
f3e8eae526 move canonpath from util to scmutil 2011-04-20 21:41:41 +02:00
Adrian Buehlmann
cf126bb7dd move opener from util to scmutil 2011-04-20 19:54:57 +02:00
Adrian Buehlmann
fc7e20743c add: introduce a warning message for non-portable filenames (issue2756) (BC)
On POSIX platforms, the 'add', 'addremove', 'copy' and 'rename' commands now
warn if a file has a name that can't be checked out on Windows.

Example:

  $ hg add con.xml
  warning: filename contains 'con', which is reserved on Windows: 'con.xml'
  $ hg status
  A con.xml

The file is added despite the warning.

The warning is ON by default. It can be suppressed by setting the config option
'portablefilenames' in section 'ui' to 'ignore' or 'false':

  $ hg --config ui.portablefilenames=ignore add con.xml
  $ hg sta
  A con.xml

If ui.portablefilenames is set to 'abort', then the command is aborted:

  $ hg --config ui.portablefilenames=abort add con.xml
  abort: filename contains 'con', which is reserved on Windows: 'con.xml'

On Windows, the ui.portablefilenames config setting is irrelevant and the
command is always aborted if a problematic filename is found.
2011-04-19 12:42:53 +02:00