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
7bf91ad2
Commit
7bf91ad2
authored
Mar 14, 2013
by
Matthias Putz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working init for win+linux
parent
9da5bff1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
157 additions
and
136 deletions
+157
-136
workspace.xml
.idea/workspace.xml
+136
-119
git_config.py
git_config.py
+3
-3
manifest_xml.py
manifest_xml.py
+5
-5
portable.py
portable.py
+6
-5
project.py
project.py
+7
-4
No files found.
.idea/workspace.xml
View file @
7bf91ad2
This diff is collapsed.
Click to expand it.
git_config.py
View file @
7bf91ad2
...
...
@@ -537,8 +537,8 @@ class Remote(object):
self
.
url
=
self
.
_Get
(
'url'
)
self
.
review
=
self
.
_Get
(
'review'
)
self
.
projectname
=
self
.
_Get
(
'projectname'
)
self
.
fetch
=
map
(
RefSpec
.
FromString
,
self
.
_Get
(
'fetch'
,
all_keys
=
True
))
self
.
fetch
=
list
(
map
(
RefSpec
.
FromString
,
self
.
_Get
(
'fetch'
,
all_keys
=
True
))
)
self
.
_review_url
=
None
def
_InsteadOf
(
self
):
...
...
@@ -657,7 +657,7 @@ class Remote(object):
self
.
_Set
(
'url'
,
self
.
url
)
self
.
_Set
(
'review'
,
self
.
review
)
self
.
_Set
(
'projectname'
,
self
.
projectname
)
self
.
_Set
(
'fetch'
,
map
(
str
,
self
.
fetch
))
self
.
_Set
(
'fetch'
,
list
(
map
(
str
,
self
.
fetch
)
))
def
_Set
(
self
,
key
,
value
):
key
=
'remote.
%
s.
%
s'
%
(
self
.
name
,
key
)
...
...
manifest_xml.py
View file @
7bf91ad2
...
...
@@ -130,11 +130,11 @@ class XmlManifest(object):
try
:
if
os
.
path
.
lexists
(
self
.
manifestFile
):
os
.
remove
(
self
.
manifestFile
)
if
portable
.
isLinux
():
src
=
'manifests/
%
s'
%
name
else
:
src
=
self
.
manifestProject
.
relpath
+
'/
%
s'
%
name
portable
.
os_link
(
src
,
self
.
manifestFile
)
#
if portable.isLinux():
src
=
'manifests/
%
s'
%
name
#
else:
#
src = self.manifestProject.relpath + '/%s' % name
portable
.
os_link
(
'./.repo/
%
s'
%
src
,
self
.
manifestFile
)
except
OSError
as
e
:
raise
ManifestParseError
(
'cannot link manifest
%
s:
%
s'
%
(
name
,
str
(
e
)))
...
...
portable.py
View file @
7bf91ad2
...
...
@@ -22,19 +22,20 @@ def pathToWindows(path):
def
os_link
(
src
,
dst
):
if
isLinux
():
os
.
symlink
(
os
.
path
.
relpath
(
src
,
os
.
path
.
dirname
(
dst
)),
dst
)
# requires src in relation to dst
src
=
os
.
path
.
relpath
(
src
,
os
.
path
.
dirname
(
dst
))
os
.
symlink
(
src
,
dst
)
else
:
dst
=
pathToLinux
(
dst
)
#subprocess.call(["ln", "-s", src, dst])
# ln in MinGW does not create hard links? - it copies
# python internal link
if
os
.
path
.
isdir
(
src
):
src
=
os
.
path
.
relpath
(
src
,
os
.
path
.
dirname
(
dst
))
src
=
pathToWindows
(
src
)
# symlink does create soft links in windows for directories
#
os.symlink(src, dst, True)
dst
=
pathToWindows
(
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
))
else
:
# requires paths in relation to current dir (not in relation to target file)
src
=
pathToLinux
(
src
)
os
.
link
(
src
,
dst
)
\ No newline at end of file
project.py
View file @
7bf91ad2
...
...
@@ -1949,6 +1949,11 @@ class Project(object):
if
not
os
.
path
.
exists
(
dotgit
):
os
.
makedirs
(
dotgit
)
# create dir - since on Linux a broken link will be created, which is not allowed on windows
rr_cache
=
os
.
path
.
join
(
self
.
gitdir
,
'rr-cache'
)
if
not
os
.
path
.
exists
(
rr_cache
):
os
.
makedirs
(
rr_cache
)
for
name
in
[
'config'
,
'description'
,
'hooks'
,
...
...
@@ -1958,7 +1963,8 @@ class Project(object):
'packed-refs'
,
'refs'
,
'rr-cache'
,
'svn'
]:
#'svn'
]:
try
:
src
=
os
.
path
.
join
(
self
.
gitdir
,
name
)
dst
=
os
.
path
.
join
(
dotgit
,
name
)
...
...
@@ -1980,9 +1986,6 @@ class Project(object):
if
GitCommand
(
self
,
cmd
)
.
Wait
()
!=
0
:
raise
GitError
(
"cannot initialize work tree"
)
rr_cache
=
os
.
path
.
join
(
self
.
gitdir
,
'rr-cache'
)
if
not
os
.
path
.
exists
(
rr_cache
):
os
.
makedirs
(
rr_cache
)
self
.
_CopyFiles
()
...
...
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