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
e8d2f9de
Commit
e8d2f9de
authored
Mar 20, 2013
by
Matthias Putz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--amend
parent
c0bbe1bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
git_command.py
git_command.py
+2
-0
main.py
main.py
+3
-0
portable.py
portable.py
+7
-1
No files found.
git_command.py
View file @
e8d2f9de
...
@@ -225,6 +225,7 @@ class GitCommand(object):
...
@@ -225,6 +225,7 @@ class GitCommand(object):
if
ssh_proxy
:
if
ssh_proxy
:
_add_ssh_client
(
p
)
_add_ssh_client
(
p
)
portable
.
SUBPROCESSES
.
append
(
p
)
self
.
process
=
p
self
.
process
=
p
self
.
stdin
=
p
.
stdin
self
.
stdin
=
p
.
stdin
...
@@ -233,6 +234,7 @@ class GitCommand(object):
...
@@ -233,6 +234,7 @@ class GitCommand(object):
p
=
self
.
process
p
=
self
.
process
(
self
.
stdout
,
self
.
stderr
)
=
p
.
communicate
()
(
self
.
stdout
,
self
.
stderr
)
=
p
.
communicate
()
rc
=
p
.
returncode
rc
=
p
.
returncode
portable
.
SUBPROCESSES
.
remove
(
p
)
finally
:
finally
:
_remove_ssh_client
(
p
)
_remove_ssh_client
(
p
)
return
rc
return
rc
main.py
View file @
e8d2f9de
...
@@ -25,6 +25,7 @@ import sys
...
@@ -25,6 +25,7 @@ import sys
import
traceback
import
traceback
import
time
import
time
import
urllib.request
import
urllib.request
import
signal
import
portable
import
portable
from
repo_trace
import
SetTrace
from
repo_trace
import
SetTrace
from
git_command
import
git
,
GitCommand
from
git_command
import
git
,
GitCommand
...
@@ -424,6 +425,8 @@ def _WindowsPager(repo):
...
@@ -424,6 +425,8 @@ def _WindowsPager(repo):
def
_Main
(
argv
):
def
_Main
(
argv
):
result
=
0
result
=
0
signal
.
signal
(
signal
.
SIGTERM
,
portable
.
terminateHandle
())
opt
=
optparse
.
OptionParser
(
usage
=
"repo wrapperinfo -- ..."
)
opt
=
optparse
.
OptionParser
(
usage
=
"repo wrapperinfo -- ..."
)
opt
.
add_option
(
"--repo-dir"
,
dest
=
"repodir"
,
opt
.
add_option
(
"--repo-dir"
,
dest
=
"repodir"
,
help
=
"path to .repo/"
)
help
=
"path to .repo/"
)
...
...
portable.py
View file @
e8d2f9de
...
@@ -9,6 +9,12 @@ import platform
...
@@ -9,6 +9,12 @@ import platform
import
subprocess
import
subprocess
SYNC_REPO_PROGRAM
=
False
SYNC_REPO_PROGRAM
=
False
SUBPROCESSES
=
[]
def
terminateHandle
():
for
cmd
in
SUBPROCESSES
:
if
cmd
:
cmd
.
terminate
()
def
stream2str
(
stream
):
def
stream2str
(
stream
):
return
str
(
stream
,
encoding
=
'UTF-8'
)
return
str
(
stream
,
encoding
=
'UTF-8'
)
...
@@ -44,7 +50,7 @@ def os_link(src, dst):
...
@@ -44,7 +50,7 @@ def os_link(src, dst):
dst
=
toWindowsPath
(
dst
)
dst
=
toWindowsPath
(
dst
)
# symlink does create soft links in windows for directories => use mklink
# symlink does create soft links in windows for directories => use mklink
# call windows cmd tool 'mklink' from git bash (mingw)
# call windows cmd tool 'mklink' from git bash (mingw)
subprocess
.
Popen
(
'cmd /c mklink /J
%
s
%
s'
%
(
dst
,
src
))
subprocess
.
Popen
(
'cmd /c mklink /J
%
s
%
s'
%
(
dst
,
src
)
,
stdout
=
subprocess
.
PIPE
)
else
:
else
:
# requires paths in relation to current dir (not in relation to target file)
# requires paths in relation to current dir (not in relation to target file)
src
=
toUnixPath
(
src
)
src
=
toUnixPath
(
src
)
...
...
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