Billy ONeal
Billy ONeal

Reputation: 106530

Is there an easy way to clear a mercurial repository of artifacts?

Sometimes I have to return to a really old branch when I depended on a ton of external libraries. Updating to the current branch removes the source files for those dependencies, but the artifacts are left there, as well as a few folders and such.

I would like to have a way to force a mercurial repo to be as if I had just cloned it from the remote (master) repository. I don't want to just nuke my repo and re-clone it, because that forces me to download hundreds of MB from the remote server.

Upvotes: 6

Views: 693

Answers (2)

tonfa
tonfa

Reputation: 24491

You can use the purge extension, or if you are on an UNIX-like system: hg st -nu0 | xargs -0 rm.

Upvotes: 3

Why don't you clone not from remote server, but from your local repository? After that you could nuke your repo with old untracked files.

hg clone path_to_your_local_repo your_new_repo

After this you could map your new repo to your remote server in hgrc file

Upvotes: 4

Related Questions