Wednesday, June 7, 2017

Is there a way to tell mercurial 'delete all files that are deleted in local' during a merge?

Leave a Comment

I've been assigned the task to do a huge merge, ~1500 commits, on a mercurial project.

In the local fork we have deleted about ~200 files, right now I need to press d and enter for each file:

remote changed file/that/is/deleted/in/local which local deleted use (c)hanged version or leave (d)eleted? 

Is there a way to tell mercurial to choose to delete all those files?

4 Answers

Answers 1

Are you on a Unix-like system? If so, this command will automate answering "d" to all questions. That's what it's for. (Will only work if there are no other issues requesting manual intervention, of course.)

yes d | hg merge ... 

If you're not, you could implement it yourself :-) E.g.,

perl -e "for (;1;) { print \"d\n\"; }" | hg merge ... 

Or write a Windows batch file with an infinite loop (etc.)

YES.BAT | hg merge ... 

Answers 2

since you are on windows, try using tortoise https://tortoisehg.bitbucket.io/

add your project. then your working directory, you will be able to see the files affected, you can then

Answers 3

You deleted them on local? You can't just do an hg addremove? If they changed after removal, but before pushing I think you are out of luck :(

Answers 4

Wouldn't

hg merge ... --tool internal:local 

work?

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment