Grzenio
Grzenio

Reputation: 36639

Locally removed files in Mercurial

I deleted a few local files that seemed to have been tracked in Mercurial, so I get:

ga1009@ga1009-dell:~/PhD/equilibrium$ hg status -q
! equilibrium/Computations/Matlab_ga/CVaR_vs_loan.p~
! equilibrium/Computations/Matlab_ga/CVaR_vs_noMargin.p~
! equilibrium/Computations/Matlab_ga/CVaR_vs_xi.p~
! equilibrium/Computations/Matlab_ga/defaults_loan3.p~
! equilibrium/Computations/Matlab_ga/defaults_loan6.p~
! equilibrium/Computations/Matlab_ga/loansBeforeDefault_loan10.p~
! equilibrium/Computations/Matlab_ga/loansBeforeDefault_loan3.p~
! equilibrium/Computations/Matlab_ga/pnl_loan6.p~
! equilibrium/Computations/Matlab_ga/pnl_loan6_alt.p~
! equilibrium/Computations/Matlab_ga/simulation.p~
! equilibrium/Computations/Matlab_ga/values_loan10.p~
! equilibrium/Computations/Matlab_ga/values_loan3.p~
! equilibrium/Computations/Vidur_120330/Chebyshev2value.m
! equilibrium/Computations/Vidur_120330/t=12.fig
! equilibrium/Computations/Vidur_120330/t=2.fig
! equilibrium/Computations/Vidur_120330/t=25.fig

Is there a way to remove these without adding anything to the repository? I have loads of files that should not be added, so using hg addremove is just not an option. I tried to do hg forget on each of these files, but I get equilibrium/Computations/Vidur_120330/t=25.fig: No such file or directory -- which is not a big surprise given that these are deleted. Any ideas how to fix it?

Upvotes: 0

Views: 88

Answers (2)

user87731
user87731

Reputation: 76

You can use hg remove --after for this. It will remove files from the repo after you've already deleted them from disk.

Type hg help remove at the command line for more info.

Upvotes: 1

Lazy Badger
Lazy Badger

Reputation: 97270

You can revert your WC and delete files in Mercurial-way

Upvotes: 1

Related Questions