Files Vanish If Deleted Before Committing a Merge
Jensen, Aaron
ajensen at webmd.net
Sat Apr 28 03:07:02 UTC 2012
> I notice that you removed a file from tracking (hg remove) between a merge and its commit,
No. I never used the hg remove command. I used the rm command in my example to show that I DID NOT issue an hg remove command.
> Protecting you against yourself is more typical of Windows than of Unix.
If I tell Mercurial to add some files, when I commit those additions, shouldn't Mercurial warn me if those files have disappeared? I've clearly asked it to do something it can't do (add a file that doesn't exist). Mercurial warns me if I add one file, delete it, and try to commit it. If I add two files, accidentally delete one, and commit, I get no warning. If I add files, merge that changeset to a different branch, accidentally delete some of those files, and commit, I get no warning, files are removed, and there is no record that anything happened. I'd like to see a warning "Hey! You've asked me to do something I can't do."
We have a repo with 80,000 files and several team branches. Some of our team branches go a couple weeks between merges. During the merge, thousands of files get updated/modified/removed/added. I'm not sure how careful it's possible to be in that situation, especially when the majority of changes being merged belong to other teams and developers.
This has hit us a few times this past week. We have a web-based product split across two repositories. We symlink/junction web directories from one repository to the other. We have scripts that keep these symlinks/junctions in place. Recently, some web files were moved between repositories. Several times over the past week, developers merged between branches and before committing somehow managed to delete one of the old symlinks, possibly from running our update script. When the merges were commited, this caused various files and directories to vanish from Mercurial, with no record they were removed.
<:> Aaron
More information about the Mercurial
mailing list