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
4138ced9
Commit
4138ced9
authored
Mar 22, 2013
by
Matthias Putz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
5b597ea3
954b243a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
12 deletions
+27
-12
NOTES.mkd
NOTES.mkd
+4
-0
main.py
main.py
+2
-2
manifest_xml.py
manifest_xml.py
+0
-3
portable.py
portable.py
+12
-1
project.py
project.py
+1
-1
repo
repo
+3
-1
init.py
subcmds/init.py
+2
-1
sync.py
subcmds/sync.py
+3
-3
No files found.
NOTES.mkd
View file @
4138ced9
...
...
@@ -14,6 +14,10 @@
*
enable debugging: -d
*
set debug host: --debug-host=172.31.0.250
*
(used port is 19499)
*
using local git-repo (in $GIT_REPO; branch 'dev') and local git repositories (in $REPOS)
$GIT_REPO/repo init -u $REPOS/manifest/ --no-repo-verify --repo-branch=dev
*
Tracing: set environment variable
export REPO_TRACE=1
# repo functionality
...
...
main.py
View file @
4138ced9
...
...
@@ -150,10 +150,10 @@ class _Repo(object):
try
:
result
=
cmd
.
Execute
(
copts
,
cargs
)
except
DownloadError
as
e
:
print
(
'error:
%
s'
%
str
(
e
),
file
=
sys
.
stderr
)
print
(
'error:
DownloadError:
%
s'
%
str
(
e
),
file
=
sys
.
stderr
)
result
=
1
except
ManifestInvalidRevisionError
as
e
:
print
(
'error:
%
s'
%
str
(
e
),
file
=
sys
.
stderr
)
print
(
'error:
ManifestInvalidRevisionError:
%
s'
%
str
(
e
),
file
=
sys
.
stderr
)
result
=
1
except
NoManifestException
as
e
:
print
(
'error: manifest required for this command -- please run init'
,
...
...
manifest_xml.py
View file @
4138ced9
...
...
@@ -130,10 +130,7 @@ 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
(
'./.repo/
%
s'
%
src
,
self
.
manifestFile
)
except
OSError
as
e
:
raise
ManifestParseError
(
'cannot link manifest
%
s:
%
s'
%
(
name
,
str
(
e
)))
...
...
portable.py
View file @
4138ced9
...
...
@@ -8,6 +8,7 @@ import os
import
platform
import
subprocess
import
sys
import
stat
SYNC_REPO_PROGRAM
=
False
SUBPROCESSES
=
[]
...
...
@@ -56,4 +57,14 @@ def os_link(src, dst):
else
:
# requires paths in relation to current dir (not in relation to target file)
src
=
toUnixPath
(
src
)
os
.
link
(
src
,
dst
)
\ No newline at end of file
os
.
link
(
src
,
dst
)
def
removeReadOnlyFilesHandler
(
fn
,
path
,
excinfo
):
removeReadOnlyFiles
(
fn
,
path
)
def
removeReadOnlyFiles
(
fn
,
path
):
if
not
os
.
access
(
path
,
os
.
W_OK
):
os
.
chmod
(
path
,
stat
.
S_IWUSR
)
fn
(
path
)
else
:
raise
Exception
(
"Could not delete
%
s"
%
path
)
\ No newline at end of file
project.py
View file @
4138ced9
...
...
@@ -54,7 +54,7 @@ def _lwrite(path, content):
def
_error
(
fmt
,
*
args
):
msg
=
fmt
%
args
print
(
'error:
%
s'
%
msg
,
file
=
sys
.
stderr
)
print
(
'error
in project
:
%
s'
%
msg
,
file
=
sys
.
stderr
)
def
not_rev
(
r
):
return
'^'
+
r
...
...
repo
View file @
4138ced9
...
...
@@ -3,6 +3,8 @@
import
sys
# copied from portable
import
portable
def
stream2str
(
stream
):
return
str
(
stream
,
encoding
=
'UTF-8'
)
...
...
@@ -662,7 +664,7 @@ def main(orig_args):
except
CloneFailure
:
for
root
,
dirs
,
files
in
os
.
walk
(
repodir
,
topdown
=
False
):
for
name
in
files
:
os
.
remove
(
os
.
path
.
join
(
root
,
name
))
portable
.
removeReadOnlyFiles
(
os
.
remove
,
os
.
path
.
join
(
root
,
name
))
for
name
in
dirs
:
os
.
rmdir
(
os
.
path
.
join
(
root
,
name
))
os
.
rmdir
(
repodir
)
...
...
subcmds/init.py
View file @
4138ced9
...
...
@@ -23,6 +23,7 @@ import sys
from
color
import
Coloring
from
command
import
InteractiveCommand
,
MirrorSafeCommand
from
error
import
ManifestParseError
import
portable
from
project
import
SyncBuffer
from
git_config
import
GitConfig
from
git_command
import
git_require
,
MIN_GIT_VERSION
...
...
@@ -193,7 +194,7 @@ to update the working directory files.
# Better delete the manifest git dir if we created it; otherwise next
# time (when user fixes problems) we won't go through the "is_new" logic.
if
is_new
:
shutil
.
rmtree
(
m
.
gitdir
)
shutil
.
rmtree
(
m
.
gitdir
,
onerror
=
portable
.
removeReadOnlyFilesHandler
)
sys
.
exit
(
1
)
if
opt
.
manifest_branch
:
...
...
subcmds/sync.py
View file @
4138ced9
...
...
@@ -412,7 +412,7 @@ later is required to fix a server side protocol bug.
else
:
print
(
'Deleting obsolete path
%
s'
%
project
.
worktree
,
file
=
sys
.
stderr
)
shutil
.
rmtree
(
project
.
worktree
)
shutil
.
rmtree
(
project
.
worktree
,
onerror
=
portable
.
removeReadOnlyFilesHandler
)
# Try deleting parent subdirs if they are empty
project_dir
=
os
.
path
.
dirname
(
project
.
worktree
)
while
project_dir
!=
self
.
manifest
.
topdir
:
...
...
@@ -496,7 +496,7 @@ later is required to fix a server side protocol bug.
except
netrc
.
NetrcParseError
as
e
:
print
(
'Error parsing .netrc file:
%
s'
%
e
,
file
=
sys
.
stderr
)
if
(
username
and
password
)
:
if
username
and
password
:
manifest_server
=
manifest_server
.
replace
(
'://'
,
'://
%
s:
%
s@'
%
(
username
,
password
),
1
)
...
...
@@ -538,7 +538,7 @@ later is required to fix a server side protocol bug.
sys
.
exit
(
1
)
self
.
manifest
.
Override
(
manifest_name
)
else
:
print
(
'error:
%
s'
%
manifest_str
,
file
=
sys
.
stderr
)
print
(
'error
in getting manifest
:
%
s'
%
manifest_str
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
except
(
socket
.
error
,
IOError
,
xmlrpc
.
client
.
Fault
)
as
e
:
print
(
'error: cannot connect to manifest server
%
s:
\n
%
s'
...
...
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