Reverting a deleted file overwrites any current contents of the file w/o confirmation or backup

Klaas van Schelven klaas at vanschelven.com
Mon Dec 23 18:44:42 CST 2013


The subject says it all

Given that I just had to reproduce my work to much chagrin I might not be
in the best position to judge whether this is a bug or a feature.
Hope the bug description is helpful.

---

hg init experiment
cd experiment/

echo 'old stuff' > importantfile
hg add importantfile
hg ci -m "baseline"

# real test starts below this line.

hg rm importantfile

echo "your full day's work" > importantfile

hg revert importantfile

ls
cat importantfile

------------

I'm on mercurial 1.4.3

--------------

I think this is very un-mercurial-like behavior: I'm always quite confident
that revert gives me .orig files. I've lost some of that confidence today.

My particular scenario was:

1] cut up a big test file into various parts, throwing away (also in hg)
the original file
2] change of mind, open the file in the editor again, rewrite it completely.
3] tests don't run for some reason. whatever, I'll just revert with --all,
and move .orig files back one by one to figure out what the difference is.
4] !!! where's my days' work?

-- 
Klaas van Schelven
+31 6 811 599 10
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20131224/afaf5703/attachment.html>


More information about the Mercurial-devel mailing list