Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i recursively remove folders from mercurial tracking system

Tags:

mercurial

I have a working directory structure like the below one :

mercurial_working_dir:

  • project1
  • project2
  • project3

Under each project folder there are common folders that i want to untrack from mercurial.e.g: i dont want any file to be tracked under /metadata folder which is common at the 3 projects. As far as i know i should use hg remove -Af command with the specifing files.Is there any way to define regular exps at the command in order to recursively "remove" the current version of any file under the metadata folder which is placed at all my projects?

like image 512
curious Avatar asked Jan 28 '11 12:01

curious


People also ask

How do I remove untracked files from mercurial?

To remove all untracked files, you can use the purge extension and run hg purge .

What does HG update do?

Description. Update the repository's working directory to the specified changeset. If no changeset is specified, update to the tip of the current named branch and move the active bookmark (see hg help bookmarks). Update sets the working directory's parent revision to the specified changeset (see hg help parents).


1 Answers

Take a look at the chapter about file names and pattern matching in the mercurial book. You can use a pattern like this:

hg rm "glob:**/metadata/**"

If you prefer regular expressions, you can also use the re: prefix instead of glob:.

like image 85
Wim Coenen Avatar answered Sep 28 '22 08:09

Wim Coenen