##// END OF EJS Templates
histedit: abort if there are multiple roots in "--outgoing" revisions...
FUJIWARA Katsunori -
r19835:44d7bfe0 default
parent child Browse files
Show More
@@ -422,7 +422,12 b' def findoutgoing(ui, repo, remote=None, '
422 outgoing = discovery.findcommonoutgoing(repo, other, revs, force=force)
422 outgoing = discovery.findcommonoutgoing(repo, other, revs, force=force)
423 if not outgoing.missing:
423 if not outgoing.missing:
424 raise util.Abort(_('no outgoing ancestors'))
424 raise util.Abort(_('no outgoing ancestors'))
425 return outgoing.missing[0]
425 roots = list(repo.revs("roots(%ln)", outgoing.missing))
426 if 1 < len(roots):
427 msg = _('there are ambiguous outgoing revisions')
428 hint = _('see "hg help histedit" for more detail')
429 raise util.Abort(msg, hint=hint)
430 return repo.lookup(roots[0])
426
431
427 actiontable = {'p': pick,
432 actiontable = {'p': pick,
428 'pick': pick,
433 'pick': pick,
@@ -102,4 +102,38 b' test sensitivity to branch in URL:'
102 # m, mess = edit message without changing commit content
102 # m, mess = edit message without changing commit content
103 #
103 #
104 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
105
106 test to check number of roots in outgoing revisions
107
108 $ hg -q outgoing -G --template '{node|short}({branch})' '../r'
109 @ f26599ee3441(foo)
110
111 o 652413bf663e(default)
112 |
113 o e860deea161a(default)
114 |
115 o 055a42cdd887(default)
116
117 $ HGEDITOR=cat hg -q histedit --outgoing '../r'
118 abort: there are ambiguous outgoing revisions
119 (see "hg help histedit" for more detail)
120 [255]
121
122 $ hg -q update -C 2
123 $ echo aa >> a
124 $ hg -q commit -m 'another head on default'
125 $ hg -q outgoing -G --template '{node|short}({branch})' '../r#default'
126 @ 3879dc049647(default)
127
128 o 652413bf663e(default)
129 |
130 o e860deea161a(default)
131 |
132 o 055a42cdd887(default)
133
134 $ HGEDITOR=cat hg -q histedit --outgoing '../r#default'
135 abort: there are ambiguous outgoing revisions
136 (see "hg help histedit" for more detail)
137 [255]
138
105 $ cd ..
139 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now