This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 122263

Summary: Revert does not work well for refactored file
Product: versioncontrol Reporter: Padraig Obriain <padraigob>
Component: MercurialAssignee: Ondrej Vrabec <ovrabec>
Status: RESOLVED WONTFIX    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: Sun   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Padraig Obriain 2007-11-19 10:30:38 UTC
If I revert a file which has been refactored the new file is deleted but the old file is not recreated.
Comment 1 Padraig Obriain 2007-11-19 16:32:42 UTC
This cannot be done for an individual file in the plug-in currently  but a directory can be reverted which results in
the new file being removed and the old one being recreated.

If none of the files specified in a hg log command is a directory we can specify --follow to get the revisions for a set
of files.

If a file was renamed after a particular revision then gf revert --rev revision new_file will delete the new file but
will not reacted the old_file. We need to also ncall hg revert --rev revision old_file.

We need to know that we should call the second hg revert command. We can know this if the file does not exist after the
first hg revert call. We also need to get the name for old_file. We can do this by calling hg log --follow -v and trek
through each revision to find when the file was renamed and what the old name was.    
Comment 2 Padraig Obriain 2007-11-20 08:05:44 UTC
I have logged http://www.selenic.com/mercurial/bts/issue834.

It does not make sense to try to fix this issue until the mercurial bug is resolved.
Comment 3 Padraig Obriain 2008-04-01 11:34:26 UTC
We need the mercurial bug to be addressed.
Comment 4 Ondrej Vrabec 2012-11-02 09:29:00 UTC
i don't think this will ever be fixed on our side.