Is it possible with Mercurial to remove all files with a certaain extension? I did an addremove and then all my binary .pyc were versioned and now I get this stopper when I do versioning:
tool kdiff3 can't handle binary
tool docdiff can't handle binary
no tool found to merge bnano-www/wtforms/widgets.pyc
keep (l)ocal or take (o)ther? o
19 files updated, 67 files merged, 0 files removed, 0 files unresolved
C:\Users\developer\bnano\bnano-www>
I don’t really know what it means except I can press o for other and go on with my work. Now I’d like to clean my repository and optimal would be to be able to do an addremove without binaries getting added but I think it is not possible.
Can you give some recommendation what to do in this case?
Thanks
HgIgnore
First of all, you can add some rules to the .hgignore file to tell Mercurial that you want to ignore some files. Then,
hg addremovewon’t add them automatically and they won’t appear in the output of the commands (iehg status) as untracked.Removing the files
To remove your files, you can use
hg remove myfile, for example, if all yourpycfiles are in the same directory, you can dohg remove *.pycand then commit the change.If your files are scattered in various repository, something like
hg remove -I *.pyc **/*should remove all.pycfiles in all directories.Exclusion patterns
FYI, will it’s better to add unwanted files in the
.hgignorefile, you can also telladdremoveto ignore some files by doinghg addremove -X *.pyc. This will add/remove every files except those having thepycextension.You can find help about a specific mercurial command using
help. For example,hg help addremove. In general everything is neatly explained !Tutorial
To explore various Mercurial concepts in more depth, I recommand this excellent tutorial : http://hginit.com