In mercurial, how to deal with an identically named file and directory in two versions?

The problem can be trivially illustrated:

hg init temp cd temp touch a hg ci -A -m file hg rm a mkdir a hg ci -m dir hg up -r0 

The last command failed with abort: Is a directory: a (or the more cryptic Access is denied on Windows).

Is there a workaround?

I ran into this exact issue when converting an obsolete code base. I really need to fully automate the conversion, since I have dozens of versions of a huge code base to work with, and the synonymous / dir file can happen anytime.

+4
source share
1 answer

Add

 hg purge 

until the last update to get rid of the empty directory. Please note that even if you add a directory, it will still not be tracked; Mercurial does not track empty directories (it tracks non-empty characters implicitly).

purge deletes Unknown Files and Empty Directories.

+7
source

Source: https://habr.com/ru/post/1332445/


All Articles