Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
git-repo
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux-tools
git-repo
Commits
7288b06b
Commit
7288b06b
authored
Mar 14, 2013
by
Matthias Putz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extracted some changes to portable module + solved stringio problem
parent
ef40ad0e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
151 additions
and
91 deletions
+151
-91
workspace.xml
.idea/workspace.xml
+133
-78
git_command.py
git_command.py
+2
-1
git_config.py
git_config.py
+3
-1
portable.py
portable.py
+3
-0
project.py
project.py
+3
-3
repo.iml
repo.iml
+1
-2
cherry_pick.py
subcmds/cherry_pick.py
+2
-1
grep.py
subcmds/grep.py
+2
-1
status.py
subcmds/status.py
+2
-4
No files found.
.idea/workspace.xml
View file @
7288b06b
This diff is collapsed.
Click to expand it.
git_command.py
View file @
7288b06b
...
...
@@ -20,6 +20,7 @@ import subprocess
import
tempfile
from
signal
import
SIGTERM
from
error
import
GitError
import
portable
from
repo_trace
import
REPO_TRACE
,
IsTrace
,
Trace
GIT
=
'git'
...
...
@@ -79,7 +80,7 @@ class _GitCall(object):
def
version
(
self
):
p
=
GitCommand
(
None
,
[
'--version'
],
capture_stdout
=
True
)
if
p
.
Wait
()
==
0
:
return
str
(
p
.
stdout
,
encoding
=
'UTF-8'
)
return
portable
.
stream2str
(
p
.
stdout
)
return
None
def
version_tuple
(
self
):
...
...
git_config.py
View file @
7288b06b
...
...
@@ -19,6 +19,8 @@ import os
import
re
import
subprocess
import
sys
import
portable
try
:
import
threading
as
_threading
except
ImportError
:
...
...
@@ -324,7 +326,7 @@ class GitConfig(object):
capture_stdout
=
True
,
capture_stderr
=
True
)
if
p
.
Wait
()
==
0
:
return
str
(
p
.
stdout
,
encoding
=
'UTF-8'
)
return
portable
.
stream2str
(
p
.
stdout
)
else
:
GitError
(
'git config
%
s:
%
s'
%
(
str
(
args
),
p
.
stderr
))
...
...
portable.py
View file @
7288b06b
...
...
@@ -10,6 +10,9 @@ import subprocess
SYNC_REPO_PROGRAM
=
False
def
stream2str
(
stream
):
return
str
(
stream
,
encoding
=
'UTF-8'
)
def
isLinux
():
if
platform
.
system
()
==
"Windows"
:
return
False
...
...
project.py
View file @
7288b06b
...
...
@@ -735,7 +735,7 @@ class Project(object):
return
'CLEAN'
out
=
StatusColoring
(
self
.
config
)
if
not
output_redir
==
None
:
if
not
output_redir
is
None
:
out
.
redirect
(
output_redir
)
out
.
project
(
'project
%-40
s'
,
self
.
relpath
+
'/'
)
...
...
@@ -2019,7 +2019,7 @@ class Project(object):
if
p
.
Wait
()
==
0
:
out
=
p
.
stdout
if
out
:
return
out
[:
-
1
]
.
split
(
'
\0
'
)
# pylint: disable=W1401
return
portable
.
stream2str
(
out
)
[:
-
1
]
.
split
(
'
\0
'
)
# pylint: disable=W1401
# Backslash is not anomalous
return
[]
...
...
repo.iml
View file @
7288b06b
...
...
@@ -16,9 +16,8 @@
<excludeFolder
url=
"file://$MODULE_DIR$/docs"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/hooks"
/>
</content>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.
2.3 (/usr/bin/python
3)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.
3.0 (/usr/bin/python3.
3)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
name=
"Python 3.2.3 (/usr/bin/python3) interpreter library"
level=
"application"
/>
</component>
</module>
subcmds/cherry_pick.py
View file @
7288b06b
...
...
@@ -18,6 +18,7 @@ import re
import
sys
from
command
import
Command
from
git_command
import
GitCommand
import
portable
CHANGE_ID_RE
=
re
.
compile
(
r'^\s*Change-Id: I([0-9a-f]{40})\s*$'
)
...
...
@@ -55,7 +56,7 @@ change id will be added.
if
p
.
Wait
()
!=
0
:
print
(
"error: Failed to retrieve old commit message"
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
old_msg
=
self
.
_StripHeader
(
str
(
p
.
stdout
,
encoding
=
'UTF-8'
))
old_msg
=
self
.
_StripHeader
(
portable
.
stream2str
(
p
.
stdout
))
p
=
GitCommand
(
None
,
[
'cherry-pick'
,
sha1
],
...
...
subcmds/grep.py
View file @
7288b06b
...
...
@@ -18,6 +18,7 @@ import sys
from
color
import
Coloring
from
command
import
PagedCommand
from
git_command
import
git_require
,
GitCommand
import
portable
class
GrepColoring
(
Coloring
):
def
__init__
(
self
,
config
):
...
...
@@ -210,7 +211,7 @@ contain a line that matches both expressions:
# We cut the last element, to avoid a blank line.
#
r
=
str
(
p
.
stdout
,
encoding
=
'UTF-8'
)
.
split
(
'
\n
'
)
r
=
portable
.
stream2str
(
p
.
stdout
)
.
split
(
'
\n
'
)
r
=
r
[
0
:
-
1
]
if
have_rev
and
full_name
:
...
...
subcmds/status.py
View file @
7288b06b
...
...
@@ -142,11 +142,9 @@ the following meanings:
for
project
in
all_projects
:
sem
.
acquire
()
class
BufList
(
io
.
StringIO
.
StringIO
):
class
BufList
(
io
.
StringIO
):
def
dump
(
self
,
ostream
):
for
entry
in
self
.
buflist
:
ostream
.
write
(
entry
)
ostream
.
write
(
self
.
getvalue
())
output
=
BufList
()
t
=
_threading
.
Thread
(
target
=
self
.
_StatusHelper
,
...
...
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