ThomasEdwin
ThomasEdwin

Reputation: 2145

character escapes in path name cause mercurial confusion

Top directory keeps appearing in hg status as untracked.

? .

hg add . returns strange result:

adding .
abort: '\n' and '\r' disallowed in filenames: '.\r'

hg verify states no problem:

checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
7044 files, 8094 changesets, 50081 total revisions

Other clones from same repository does not exhibit this behavior. I tried both hg 3.0.1 and 2.7.2. Any idea why this happens?

Upvotes: 0

Views: 50

Answers (1)

Ry4an Brase
Ry4an Brase

Reputation: 78340

It looks like you actually have a file whose name is a single dot followed by a carriage return. Notice: disallowed in filenames: '.\r'

Here's me simulating that:

$ hg init Thomas
$ cd Thomas/
$ echo -e '.\r'
.
$ touch $(echo -e '.\r')
$ ls -A
.?  .hg/
$ hg status
? .
$ hg add .
adding .
abort: '\n' and '\r' disallowed in filenames: '.\r'

You've got a file whose name is a really bad idea, and it wasn't created by Mercurial.

Upvotes: 3

Related Questions