Size: 1212
Comment: sketching out sections
|
Size: 4083
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
== Extension Name == | ## page was renamed from CaseFoldPlugin ## page was renamed from FoldPlugin == Fold: Case Folding Rescue == |
Line 3: | Line 5: |
'''This extension is in proposal stage and therefore not distributed with Mercurial.''' | |
Line 5: | Line 6: |
''Author: Brad Olson'' | '''This extension is not distributed with Mercurial.''' |
Line 7: | Line 8: |
Download site: Under Discussion | ''Author: BradOlson'' |
Line 9: | Line 10: |
=== Jargon === | Download site: [[http://bitbucket.org/bradobro/hgfold/]] |
Line 11: | Line 12: |
FS:: Filesystem (file system). CS:: Case-sensitive (case-preserving), a context where "TheGreenTree" and "thegreentree" refer to two different files. CI:: Case-insensitive (case-folding), a context where "TheGreenTree" and "thegreentree" refer to the same file or entity. Collision:: Case collision, two names that differ only by case. |
Tested with: Mercurial 1.2.1 Status: Not updating. With Mercurial 1.7.5 (and perhaps earlier), Mercurial does saner things on Windows when case-collisions cause an update abort. It is not possible to recover without this extension by hg mv-ing one of the offending files. My employer is seeing fewer case folding problems and considering manual fixes to them. If this proves insufficient, this extension may be resurrected. === Definitions === FS:: Filesystem (file system). CS:: Case-sensitive (case-preserving), a context where "THEGREENTREE" and "thegreentree" refer to two different files. CI:: Case-insensitive (case-folding), a context where "THEGREENTREE" and "thegreentree" refer to the same file or entity. Collision:: Case collision, two names that differ only by case. |
Line 18: | Line 25: |
This extension seeks to comprehensively deal with the problem of Mercurial filename case collisions. | This extension seeks to comprehensively deal with the problem of Mercurial filename case collisions in merges and updates. (It does not address Mercurial's internal storage, which is and needs to be CI no matter the file system, cf. CaseFoldingPlan.) |
Line 20: | Line 27: |
It's developed with these core principles (which are open for community discussion): | Basic understandings about filename collisions. |
Line 22: | Line 29: |
1. It takes a person to decide whether a project's filenames are CI or CS. (Current FS is not an adequate decider.) 1. |
1. It takes a person to decide whether a project's filenames are CI or CS. Current FS is not an adequate decider. 1. In a CS project, a collision is just another file; in a CI project, a collision is a conflict. 1. Mercurial users need sane ways to remedy collisions on a CIFS. (It's easy to fix them on a CSFS, but on a CIFS you have to modify parentage, which can get dangerous. See FixingCaseCollisions.) It proposes the following phases: 1. (Done) Add options to ''merge'' and ''update'' that will treat collisions as conflicts that need merging. 1. Adding options to other commands (''add'', ''addrem'', ''commit'', ''clone'', and ''rename'') to handle/prevent folds. 1. Add .hgfold to define cannonical forms of filenames and flag that a repository needs to behave as if file names case-insensitive |
Line 34: | Line 48: |
... | fold = /full/path/to/fold.py |
Line 37: | Line 51: |
=== Usage === ''hg help update'' and ''hg help merge'' have been augmented to describe this extension. {{{ hg update --fold [-C] [-d DATE] [[-r] REV] -n --dry-run do not perform actions, just print output --fold treat filename collisions as the same file, merging as needed hg merge --fold [-f] [[-r] REV] -n --dry-run do not perform actions, just print output --fold treat filename collisions as the same file, merging as needed }}} |
|
Line 38: | Line 65: |
=== Mercurial Command Extension === This extension demonstrates a way of extending existing mercurial commands (as opposed to simply adding a new command). There are risks and advantages to this. It tries to do it as safely as possible: 1. The original command entry if found and retained. 1. New options are audited so they will not overlap with existing command options (even future ones). 1. Command help and syntax is augmented. 1. A wrapper function is called instead of the original command function. Best practice is for that wrapper, if it learns that its extra services are not needed, to execute the original command function with the arguments pertinent to it. === Other Types of Filename Collisions === This extension acknowledges that there are other ways for filenames to collid besides case. By changing the definition of collisionFinder.cannonize(), it can be taught to find other types of filename collisions. I welcome any suggestions. |
|
Line 41: | Line 83: |
Other approaches are outlined at CaseFolding. | |
Line 42: | Line 85: |
CategoryExtension | CategoryExtensionsByOthers |
Fold: Case Folding Rescue
This extension is not distributed with Mercurial.
Author: BradOlson
Download site: http://bitbucket.org/bradobro/hgfold/
Tested with: Mercurial 1.2.1
Status: Not updating. With Mercurial 1.7.5 (and perhaps earlier), Mercurial does saner things on Windows when case-collisions cause an update abort. It is not possible to recover without this extension by hg mv-ing one of the offending files. My employer is seeing fewer case folding problems and considering manual fixes to them. If this proves insufficient, this extension may be resurrected.
Definitions
- FS
- Filesystem (file system).
- CS
- Case-sensitive (case-preserving), a context where "THEGREENTREE" and "thegreentree" refer to two different files.
- CI
- Case-insensitive (case-folding), a context where "THEGREENTREE" and "thegreentree" refer to the same file or entity.
- Collision
- Case collision, two names that differ only by case.
Overview
This extension seeks to comprehensively deal with the problem of Mercurial filename case collisions in merges and updates. (It does not address Mercurial's internal storage, which is and needs to be CI no matter the file system, cf. CaseFoldingPlan.)
Basic understandings about filename collisions.
- It takes a person to decide whether a project's filenames are CI or CS. Current FS is not an adequate decider.
- In a CS project, a collision is just another file; in a CI project, a collision is a conflict.
Mercurial users need sane ways to remedy collisions on a CIFS. (It's easy to fix them on a CSFS, but on a CIFS you have to modify parentage, which can get dangerous. See FixingCaseCollisions.)
It proposes the following phases:
(Done) Add options to merge and update that will treat collisions as conflicts that need merging.
Adding options to other commands (add, addrem, commit, clone, and rename) to handle/prevent folds.
- Add .hgfold to define cannonical forms of filenames and flag that a repository needs to behave as if file names case-insensitive
Limitations
This extension has not been tested on filenames containing characters outside the basic Roman set.
Configuration
Configure your .hgrc to enable the extension by adding following lines:
[extensions] fold = /full/path/to/fold.py
Usage
hg help update and hg help merge have been augmented to describe this extension.
hg update --fold [-C] [-d DATE] [[-r] REV] -n --dry-run do not perform actions, just print output --fold treat filename collisions as the same file, merging as needed hg merge --fold [-f] [[-r] REV] -n --dry-run do not perform actions, just print output --fold treat filename collisions as the same file, merging as needed
Development Discussion
Mercurial Command Extension
This extension demonstrates a way of extending existing mercurial commands (as opposed to simply adding a new command). There are risks and advantages to this. It tries to do it as safely as possible:
- The original command entry if found and retained.
- New options are audited so they will not overlap with existing command options (even future ones).
- Command help and syntax is augmented.
- A wrapper function is called instead of the original command function. Best practice is for that wrapper, if it learns that its extra services are not needed, to execute the original command function with the arguments pertinent to it.
=== Other Types of Filename Collisions ===
This extension acknowledges that there are other ways for filenames to collid besides case. By changing the definition of collisionFinder.cannonize(), it can be taught to find other types of filename collisions.
I welcome any suggestions.
Other Solutions
Other approaches are outlined at CaseFolding.