Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
e7af22a6
Commit
e7af22a6
authored
Sep 08, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codereview: Mercurial 1.9 fix for hg diff @nnn
R=golang-dev, adg CC=golang-dev
https://golang.org/cl/4969063
parent
cf0d8c09
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
lib/codereview/codereview.py
lib/codereview/codereview.py
+9
-6
No files found.
lib/codereview/codereview.py
View file @
e7af22a6
...
...
@@ -946,18 +946,20 @@ def CommandLineCL(ui, repo, pats, opts, defaultcc=None):
# which expands the syntax @clnumber to mean the files
# in that CL.
original_match
=
None
def
ReplacementForCmdutilMatch
(
repo
,
pats
=
None
,
opts
=
None
,
globbed
=
False
,
default
=
'relpath'
):
global_repo
=
None
def
ReplacementForCmdutilMatch
(
ctx
,
pats
=
None
,
opts
=
None
,
globbed
=
False
,
default
=
'relpath'
):
taken
=
[]
files
=
[]
pats
=
pats
or
[]
opts
=
opts
or
{}
for
p
in
pats
:
if
p
.
startswith
(
'@'
):
taken
.
append
(
p
)
clname
=
p
[
1
:]
if
not
GoodCLName
(
clname
):
raise
util
.
Abort
(
"invalid CL name "
+
clname
)
cl
,
err
=
LoadCL
(
repo
.
ui
,
repo
,
clname
,
web
=
False
)
cl
,
err
=
LoadCL
(
global_repo
.
ui
,
global_
repo
,
clname
,
web
=
False
)
if
err
!=
''
:
raise
util
.
Abort
(
"loading CL "
+
clname
+
": "
+
err
)
if
not
cl
.
files
:
...
...
@@ -966,10 +968,9 @@ def ReplacementForCmdutilMatch(repo, pats=None, opts=None, globbed=False, defaul
pats
=
Sub
(
pats
,
taken
)
+
[
'path:'
+
f
for
f
in
files
]
# work-around for http://selenic.com/hg/rev/785bbc8634f8
if
hgversion
>=
'1.9'
and
not
hasattr
(
repo
,
'match'
):
repo
=
repo
[
None
]
return
original_match
(
repo
,
pats
=
pats
,
opts
=
opts
,
globbed
=
globbed
,
default
=
default
)
if
hgversion
>=
'1.9'
and
not
hasattr
(
ctx
,
'match'
):
ctx
=
ctx
[
None
]
return
original_match
(
ctx
,
pats
=
pats
,
opts
=
opts
,
globbed
=
globbed
,
default
=
default
)
def
RelativePath
(
path
,
cwd
):
n
=
len
(
cwd
)
...
...
@@ -1616,6 +1617,8 @@ def pending(ui, repo, *pats, **opts):
def
reposetup
(
ui
,
repo
):
global
original_match
if
original_match
is
None
:
global
global_repo
global_repo
=
repo
start_status_thread
()
original_match
=
scmutil
.
match
scmutil
.
match
=
ReplacementForCmdutilMatch
...
...
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