Download Darcs User Manual

Transcript
5.5.3
darcs move
Darcs cannot reliably distinguish between a file being deleted and a new one added, and a file being moved.
Therefore Darcs always assumes the former, and provides the ‘darcs mv’ command to let Darcs know when
you want the latter. This command will also move the file in the working tree (unlike ‘darcs remove’), unless
it has already been moved.
Darcs will not rename a file if another file in the same folder has the same name, except for case. The
–case-ok option overrides this behaviour. Windows and OS X usually use filesystems that do not allow files
a folder to have the same name except for case (for example, ‘ReadMe’ and ‘README’). If –case-ok is used,
the repository might be unusable on those systems!
Usage: darcs move [OPTION]... <SOURCE> ... <DESTINATION>
Options:
--case-ok
don’t refuse to add files differing only in case
refuse to add files whose name differ only in
--no-case-ok
case [DEFAULT]
don’t refuse to add files with
--reserved-ok
Windows-reserved names
refuse to add files with Windows-reserved
--no-reserved-ok
names [DEFAULT]
specify the repository directory in which to
--repodir DIRECTORY
run
Advanced options:
--umask UMASK specify umask to use when writing
Move or rename files.
5.5.4
darcs replace
In addition to line-based patches, Darcs supports a limited form of lexical substitution. Files are treated as
sequences of words, and each occurrence of the old word is replaced by the new word. This is intended to
provide a clean way to rename a function or variable. Such renamings typically affect lines all through the
source code, so a traditional line-based patch would be very likely to conflict with other branches, requiring
manual merging.
Files are tokenized according to one simple rule: words are strings of valid token characters, and everything between them (punctuation and whitespace) is discarded. By default, valid token characters are
letters, numbers and the underscore (i.e. [A-Za-z0-9 ]). However if the old and/or new token contains either
a hyphen or period, BOTH hyphen and period are treated as valid (i.e. [A-Za-z0-9 .-]).
The set of valid characters can be customized using the –token-chars option. The argument must be
surrounded by square brackets. If a hyphen occurs between two characters in the set, it is treated as a set
range. For example, in most locales [A-Z] denotes all uppercase letters. If the first character is a caret, valid
tokens are taken to be the complement of the remaining characters. For example, [ˆ:\n] could be used to
match fields in the passwd(5), where records and fields are separated by newlines and colons respectively.
If you choose to use –token-chars, you are STRONGLY encouraged to do so consistently. The consequences of using multiple replace patches with different –token-chars arguments on the same file are not well
tested nor well understood.
By default Darcs will refuse to perform a replacement if the new token is already in use, because the
replacements would be not be distinguishable from the existing tokens. This behaviour can be overridden by
supplying the –force option, but an attempt to ‘darcs rollback’ the resulting patch will affect these existing
tokens.
Limitations:
The tokenizer treats files as byte strings, so it is not possible for –token-chars to include multi-byte
characters, such as the non-ASCII parts of UTF-8. Similarly, trying to replace a ‘high-bit’ character from
a unibyte encoding will also result in replacement of the same byte in files with different encodings. For
example, an acute a from ISO 8859-1 will also match an alpha from ISO 8859-7.
35