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
238c8f80
Commit
238c8f80
authored
Mar 25, 2013
by
Matthias Putz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linkin fix
parent
7df87662
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
main.py
main.py
+4
-0
portable.py
portable.py
+14
-10
No files found.
main.py
View file @
238c8f80
...
...
@@ -46,6 +46,8 @@ from pager import _SelectPager
from
subcmds
import
all_commands
from
repo_trace
import
REPO_TRACE
,
IsTrace
,
Trace
global_options
=
optparse
.
OptionParser
(
usage
=
"repo [-p|--paginate|--no-pager|--piped-into-less] COMMAND [ARGS]"
)
global_options
.
add_option
(
'-p'
,
'--paginate'
,
...
...
@@ -412,6 +414,8 @@ def _WindowsPager(repo):
args2
=
args
[
argsSplit
+
1
:]
pager
=
_SelectPager
(
cmd
.
manifest
.
globalConfig
)
shellCommand
=
[
python
,
thisScript
]
+
args1
+
[
'--'
,
'--piped-into-pager'
,
'--no-pager'
]
+
args2
+
[
'|'
,
pager
]
if
IsTrace
():
Trace
(
' '
.
join
(
shellCommand
))
subprocess
.
call
(
shellCommand
,
shell
=
True
)
return
True
else
:
...
...
portable.py
View file @
238c8f80
...
...
@@ -10,6 +10,8 @@ import subprocess
import
sys
import
stat
from
repo_trace
import
REPO_TRACE
,
IsTrace
,
Trace
SYNC_REPO_PROGRAM
=
False
SUBPROCESSES
=
[]
...
...
@@ -45,19 +47,21 @@ def os_link(src, dst):
src
=
os
.
path
.
relpath
(
src
,
os
.
path
.
dirname
(
dst
))
os
.
symlink
(
src
,
dst
)
else
:
dst
=
toUnixPath
(
dst
)
#subprocess.call(["ln", "-s", src, dst])
src
=
os
.
path
.
relpath
(
src
,
os
.
path
.
dirname
(
dst
))
src
=
toWindowsPath
(
src
)
dst
=
toWindowsPath
(
dst
)
# ln in MinGW does not create hard links? - it copies
# call windows cmd tool 'mklink' from git bash (mingw)
if
os
.
path
.
isdir
(
src
):
src
=
toWindowsPath
(
src
)
dst
=
toWindowsPath
(
dst
)
# symlink does create soft links in windows for directories => use mklink
# call windows cmd tool 'mklink' from git bash (mingw)
subprocess
.
Popen
(
'cmd /c mklink /J
%
s
%
s'
%
(
dst
,
src
),
stdout
=
subprocess
.
PIPE
)
cmd
=
'cmd /c mklink /D "
%
s" "
%
s"'
%
(
dst
,
src
)
if
IsTrace
():
Trace
(
cmd
)
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
)
else
:
# requires paths in relation to current dir (not in relation to target file)
src
=
toUnixPath
(
src
)
os
.
link
(
src
,
dst
)
cmd
=
'cmd /c mklink "
%
s" "
%
s"'
%
(
dst
,
src
)
if
IsTrace
():
Trace
(
cmd
)
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
)
def
removeReadOnlyFilesHandler
(
fn
,
path
,
excinfo
):
removeReadOnlyFiles
(
fn
,
path
)
...
...
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