Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
ff7343f8
Commit
ff7343f8
authored
Jan 20, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codereview: accommodate recent change to ui.prompt
Fixes #525. R=r CC=golang-dev
https://golang.org/cl/190044
parent
a6736fa4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
codereview.py
lib/codereview/codereview.py
+11
-2
No files found.
lib/codereview/codereview.py
View file @
ff7343f8
...
...
@@ -77,6 +77,15 @@ if hgversion < '1.3':
msg
+=
linuxMessage
raise
util
.
Abort
(
msg
)
def
promptyesno
(
ui
,
msg
):
# Arguments to ui.prompt changed between 1.3 and 1.3.1.
# Even so, some 1.3.1 distributions seem to have the old prompt!?!?
# What a terrible way to maintain software.
try
:
return
ui
.
promptchoice
(
msg
,
[
"&yes"
,
"&no"
],
0
)
==
0
except
AttributeError
:
return
ui
.
prompt
(
msg
,
[
"&yes"
,
"&no"
],
"y"
)
!=
"n"
# To experiment with Mercurial in the python interpreter:
# >>> repo = hg.repository(ui.ui(), path = ".")
...
...
@@ -590,7 +599,7 @@ def EditCL(ui, repo, cl):
s
=
ui
.
edit
(
s
,
ui
.
username
())
clx
,
line
,
err
=
ParseCL
(
s
,
cl
.
name
)
if
err
!=
''
:
if
ui
.
prompt
(
"error parsing change list: line
%
d:
%
s
\n
re-edit (y/n)?"
%
(
line
,
err
),
[
"&yes"
,
"&no"
],
"y"
)
==
"n"
:
if
not
promptyesno
(
ui
,
"error parsing change list: line
%
d:
%
s
\n
re-edit (y/n)?"
%
(
line
,
err
))
:
return
"change list not modified"
continue
cl
.
desc
=
clx
.
desc
;
...
...
@@ -598,7 +607,7 @@ def EditCL(ui, repo, cl):
cl
.
cc
=
clx
.
cc
cl
.
files
=
clx
.
files
if
cl
.
desc
==
''
:
if
ui
.
prompt
(
"change list should have description
\n
re-edit (y/n)?"
,
[
"&yes"
,
"&no"
],
"y"
)
!=
"n"
:
if
promptyesno
(
ui
,
"change list should have description
\n
re-edit (y/n)?"
)
:
continue
break
return
""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment