开发者

abort: untracked file in working directory differs from file in requested revision: '.hgignore'

开发者 https://www.devze.com 2023-02-15 13:02 出处:网络
I am trying to pull some files and directories and I am having the following messages: When I look in my repository I can see that the files have been downloaded but all contains _ as prefix, and eve

I am trying to pull some files and directories and I am having the following messages:

When I look in my repository I can see that the files have been downloaded but all contains _ as prefix, and even the names of files and folders contain _

requesting all changes 
adding changesets 
adding manifests 
adding file changes 
added 1094 changesets with 4304 changes to 1071开发者_StackOverflow files abort:
untracked file in working directory differs from file in requested revision: '.hgignore' [command interrupted]

What is wrong?


I think you have created a .hgignore in your working directory without adding it to the repository (hg add). This file is "untracked".

Someone else, from another clone, has added this file too, committed and pushed it. Now, when you try to update your working directory, Mercurial try to add this file but sees a file with the same name in your working directory which is untracked and different.

There's two solution to your problem :

  1. Backup your .hgignore file, do the update and add the differences from the backup if necessary
  2. Add your own file to the repository with hg add, then re-run the update. It will maybe be necessary to commit the file prior to the update.

I'll advise using the first solution.


When you say the files in the repository have _ as a prefix, you're looking down inside the .hg directory aren't you? That's the data store for Mercurial itself and the files in there are revlogs, not your files. Outside of .hg you'll have a working directory where the files are the actual files you expect. You're not getting one of those now because hg update is refusing to update the working directory because doing so would overwrite your uncomitted .hgignore file.

What exact command are you running? It looks like it's doing a hg pull followed by an hg update so I'd guess hg clone but if you already have a .hgignore lying around that's not the right command to use. If instead you're using hg pull -u or hg fetch you should just use hg pull instead to get the changesets. Then you can:

hg add .hgignore  # add the hg ignore file you already have that's untracked
hg commit -m .hgignore  # commit the .hgignore file you just added
hg merge  # merge your new commit (.hgignore) with the changesets you just pulled down.
0

精彩评论

暂无评论...
验证码 换一张
取 消