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
1d6eb746
Commit
1d6eb746
authored
May 24, 2010
by
Peter Williams
Committed by
Russ Cox
May 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codereview: work better with mq
R=rsc CC=golang-dev
https://golang.org/cl/1140043
parent
e30bf71b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
codereview.py
lib/codereview/codereview.py
+13
-3
No files found.
lib/codereview/codereview.py
View file @
1d6eb746
...
...
@@ -533,11 +533,18 @@ _change_prolog = """# Change list.
#######################################################################
# Mercurial helper functions
# Get effective change nodes taking into account applied MQ patches
def
effective_revpair
(
repo
):
try
:
return
cmdutil
.
revpair
(
repo
,
[
'qparent'
])
except
:
return
cmdutil
.
revpair
(
repo
,
None
)
# Return list of changed files in repository that match pats.
def
ChangedFiles
(
ui
,
repo
,
pats
,
opts
):
# Find list of files being operated on.
matcher
=
cmdutil
.
match
(
repo
,
pats
,
opts
)
node1
,
node2
=
cmdutil
.
revpair
(
repo
,
None
)
node1
,
node2
=
effective_revpair
(
repo
)
modified
,
added
,
removed
=
repo
.
status
(
node1
,
node2
,
matcher
)[:
3
]
l
=
modified
+
added
+
removed
l
.
sort
()
...
...
@@ -546,7 +553,7 @@ def ChangedFiles(ui, repo, pats, opts):
# Return list of changed files in repository that match pats and still exist.
def
ChangedExistingFiles
(
ui
,
repo
,
pats
,
opts
):
matcher
=
cmdutil
.
match
(
repo
,
pats
,
opts
)
node1
,
node2
=
cmdutil
.
revpair
(
repo
,
None
)
node1
,
node2
=
effective_revpair
(
repo
)
modified
,
added
,
_
=
repo
.
status
(
node1
,
node2
,
matcher
)[:
3
]
l
=
modified
+
added
l
.
sort
()
...
...
@@ -2827,9 +2834,12 @@ class MercurialVCS(VersionControlSystem):
self
.
subdir
=
cwd
[
len
(
self
.
repo_dir
):]
.
lstrip
(
r"\/"
)
if
self
.
options
.
revision
:
self
.
base_rev
=
self
.
options
.
revision
else
:
mqparent
,
err
=
RunShellWithReturnCode
([
'hg'
,
'log'
,
'--rev'
,
'qparent'
,
'--template={node}'
])
if
not
err
:
self
.
base_rev
=
mqparent
else
:
self
.
base_rev
=
RunShell
([
"hg"
,
"parent"
,
"-q"
])
.
split
(
':'
)[
1
]
.
strip
()
def
_GetRelPath
(
self
,
filename
):
"""Get relative path of a file according to the current directory,
given its logical path in the repo."""
...
...
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