##// END OF EJS Templates
[PATCH] Don't prompt user for keep-vs-delete when the merge is about to be aborted...
mpm@selenic.com -
r415:c2b9502a default
parent child Browse files
Show More
@@ -0,0 +1,21 b''
1 #!/bin/sh -x
2
3 mkdir t
4 cd t
5 hg init
6 echo This is file a1 > a
7 echo This is file b1 > b
8 hg add a b
9 hg commit -t "commit #0" -d "0 0" -u user
10 echo This is file b22 > b
11 hg commit -t"comment #1" -d "0 0" -u user
12 hg update 0
13 rm b
14 hg commit -A -t"comment #2" -d "0 0" -u user
15 # in theory, we shouldn't need the "yes k" below, but it prevents
16 # this test from hanging when "hg update" erroneously prompts the
17 # user for "keep or delete"
18 yes k | hg update 1
19 # we exit with 0 to avoid the unavoidable SIGPIPE from above causing
20 # us to fail this test
21 exit 0
@@ -0,0 +1,18 b''
1 + mkdir t
2 + cd t
3 + hg init
4 + echo This is file a1
5 + echo This is file b1
6 + hg add a b
7 + hg commit -t 'commit #0' -d '0 0' -u user
8 + echo This is file b22
9 + hg commit '-tcomment #1' -d '0 0' -u user
10 + hg update 0
11 + rm b
12 + hg commit -A '-tcomment #2' -d '0 0' -u user
13 + yes k
14 + hg update 1
15 this update spans a branch affecting the following files:
16 aborting update spanning branches!
17 (use update -m to perform a branch merge)
18 + exit 0
@@ -1092,9 +1092,11 b' class localrepository:'
1092 del m2[f]
1092 del m2[f]
1093 elif f in ma:
1093 elif f in ma:
1094 if not force and n != ma[f]:
1094 if not force and n != ma[f]:
1095 r = self.ui.prompt(
1095 r = ""
1096 (" local changed %s which remote deleted\n" % f) +
1096 if linear_path or allow:
1097 "(k)eep or (d)elete?", "[kd]", "k")
1097 r = self.ui.prompt(
1098 (" local changed %s which remote deleted\n" % f) +
1099 "(k)eep or (d)elete?", "[kd]", "k")
1098 if r == "d":
1100 if r == "d":
1099 remove.append(f)
1101 remove.append(f)
1100 else:
1102 else:
@@ -1113,9 +1115,11 b' class localrepository:'
1113 for f, n in m2.iteritems():
1115 for f, n in m2.iteritems():
1114 if f[0] == "/": continue
1116 if f[0] == "/": continue
1115 if not force and f in ma and n != ma[f]:
1117 if not force and f in ma and n != ma[f]:
1116 r = self.ui.prompt(
1118 r = ""
1117 ("remote changed %s which local deleted\n" % f) +
1119 if linear_path or allow:
1118 "(k)eep or (d)elete?", "[kd]", "k")
1120 r = self.ui.prompt(
1121 ("remote changed %s which local deleted\n" % f) +
1122 "(k)eep or (d)elete?", "[kd]", "k")
1119 if r == "d": remove.append(f)
1123 if r == "d": remove.append(f)
1120 else:
1124 else:
1121 self.ui.debug("remote created %s\n" % f)
1125 self.ui.debug("remote created %s\n" % f)
General Comments 0
You need to be logged in to leave comments. Login now