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
7f958de6
Commit
7f958de6
authored
Mar 18, 2013
by
Matthias Putz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored
parent
ddccb22e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
42 deletions
+37
-42
workspace.xml
.idea/workspace.xml
+22
-21
main.py
main.py
+2
-13
portable.py
portable.py
+13
-8
No files found.
.idea/workspace.xml
View file @
7f958de6
...
...
@@ -3,12 +3,13 @@
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"2c74b80f-dc83-420e-8ea2-4ad07fb0ac68"
name=
"Default"
comment=
""
>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/main.py"
afterPath=
"$PROJECT_DIR$/main.py"
/>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/portable.py"
afterPath=
"$PROJECT_DIR$/portable.py"
/>
</list>
<ignored
path=
"git-repo.iws"
/>
<ignored
path=
".idea/workspace.xml"
/>
<file
path=
"/Dummy.txt"
changelist=
"2c74b80f-dc83-420e-8ea2-4ad07fb0ac68"
time=
"1363590315380"
ignored=
"false"
/>
<file
path=
"/main.py"
changelist=
"2c74b80f-dc83-420e-8ea2-4ad07fb0ac68"
time=
"136360
0781772
"
ignored=
"false"
/>
<file
path=
"/portable.py"
changelist=
"2c74b80f-dc83-420e-8ea2-4ad07fb0ac68"
time=
"1363
27561905
7"
ignored=
"false"
/>
<file
path=
"/main.py"
changelist=
"2c74b80f-dc83-420e-8ea2-4ad07fb0ac68"
time=
"136360
1178273
"
ignored=
"false"
/>
<file
path=
"/portable.py"
changelist=
"2c74b80f-dc83-420e-8ea2-4ad07fb0ac68"
time=
"1363
60136248
7"
ignored=
"false"
/>
<file
path=
"/a.py"
changelist=
"2c74b80f-dc83-420e-8ea2-4ad07fb0ac68"
time=
"1363252132925"
ignored=
"false"
/>
<file
path=
"/a.dummy"
changelist=
"2c74b80f-dc83-420e-8ea2-4ad07fb0ac68"
time=
"1363594579797"
ignored=
"false"
/>
<file
path=
"/git_config.py"
changelist=
"2c74b80f-dc83-420e-8ea2-4ad07fb0ac68"
time=
"1363276044335"
ignored=
"false"
/>
...
...
@@ -82,10 +83,10 @@
<splitter
split-orientation=
"horizontal"
split-proportion=
"0.684111"
>
<split-first>
<leaf>
<file
leaf-file-name=
"main.py"
pinned=
"false"
current=
"
true"
current-in-tab=
"tru
e"
>
<file
leaf-file-name=
"main.py"
pinned=
"false"
current=
"
false"
current-in-tab=
"fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/main.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
line=
"
417"
column=
"0"
selection-start=
"12997"
selection-end=
"12997"
vertical-scroll-proportion=
"0.39823008
"
>
<state
line=
"
143"
column=
"7"
selection-start=
"4420"
selection-end=
"4420"
vertical-scroll-proportion=
"0.0
"
>
<folding>
<element
signature=
"e#625#662#0"
expanded=
"true"
/>
</folding>
...
...
@@ -122,10 +123,10 @@
</provider>
</entry>
</file>
<file
leaf-file-name=
"portable.py"
pinned=
"false"
current=
"
false"
current-in-tab=
"fals
e"
>
<file
leaf-file-name=
"portable.py"
pinned=
"false"
current=
"
true"
current-in-tab=
"tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/portable.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
line=
"
12"
column=
"4"
selection-start=
"123"
selection-end=
"123"
vertical-scroll-proportion=
"0.0
"
>
<state
line=
"
30"
column=
"0"
selection-start=
"447"
selection-end=
"447"
vertical-scroll-proportion=
"0.74336284
"
>
<folding
/>
</state>
</provider>
...
...
@@ -213,7 +214,6 @@
<list>
<option
value=
"$PROJECT_DIR$/manifest_xml.py"
/>
<option
value=
"$PROJECT_DIR$/subcmds/sync.py"
/>
<option
value=
"$PROJECT_DIR$/portable.py"
/>
<option
value=
"$PROJECT_DIR$/git_command.py"
/>
<option
value=
"$PROJECT_DIR$/git_config.py"
/>
<option
value=
"$PROJECT_DIR$/subcmds/cherry_pick.py"
/>
...
...
@@ -223,6 +223,7 @@
<option
value=
"$PROJECT_DIR$/tests/linux-pager.py"
/>
<option
value=
"$PROJECT_DIR$/project.py"
/>
<option
value=
"$PROJECT_DIR$/main.py"
/>
<option
value=
"$PROJECT_DIR$/portable.py"
/>
</list>
</option>
</component>
...
...
@@ -653,13 +654,13 @@
<window_info
id=
"Changes"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"JetGradle"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Palette"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Find"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
weight=
"0.32821077"
sideWeight=
"0.48
39914
7"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Find"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
weight=
"0.32821077"
sideWeight=
"0.48
185
7"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Database"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Ant Build"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"SBT Console"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Debug"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.30406147"
sideWeight=
"0.9375667"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"IDEtalk Messages"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Event Log"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
weight=
"0.32821077"
sideWeight=
"0.51
22732
"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Event Log"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
weight=
"0.32821077"
sideWeight=
"0.51
44077
"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Favorites"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"IDEtalk"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
weight=
"0.32924107"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
...
...
@@ -754,12 +755,12 @@
</line-breakpoint>
<line-breakpoint
enabled=
"true"
type=
"python-line"
>
<url>
file://$PROJECT_DIR$/portable.py
</url>
<line>
28
</line>
<line>
33
</line>
<option
name=
"timeStamp"
value=
"17"
/>
</line-breakpoint>
<line-breakpoint
enabled=
"true"
type=
"python-line"
>
<url>
file://$PROJECT_DIR$/main.py
</url>
<line>
4
32
</line>
<line>
4
21
</line>
<option
name=
"timeStamp"
value=
"18"
/>
</line-breakpoint>
<line-breakpoint
enabled=
"true"
type=
"python-line"
>
...
...
@@ -799,12 +800,12 @@
</line-breakpoint>
<line-breakpoint
enabled=
"true"
type=
"python-line"
>
<url>
file://$PROJECT_DIR$/main.py
</url>
<line>
1
58
</line>
<line>
1
47
</line>
<option
name=
"timeStamp"
value=
"40"
/>
</line-breakpoint>
<line-breakpoint
enabled=
"true"
type=
"python-line"
>
<url>
file://$PROJECT_DIR$/main.py
</url>
<line>
4
14
</line>
<line>
4
03
</line>
<option
name=
"timeStamp"
value=
"42"
/>
</line-breakpoint>
</breakpoints>
...
...
@@ -903,13 +904,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/portable.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
line=
"12"
column=
"4"
selection-start=
"123"
selection-end=
"123"
vertical-scroll-proportion=
"0.0"
>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/pager.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
line=
"44"
column=
"4"
selection-start=
"1226"
selection-end=
"1226"
vertical-scroll-proportion=
"0.05235602"
>
...
...
@@ -937,13 +931,20 @@
</entry>
<entry
file=
"file://$PROJECT_DIR$/main.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
line=
"
417"
column=
"0"
selection-start=
"12997"
selection-end=
"12997"
vertical-scroll-proportion=
"0.39823008
"
>
<state
line=
"
143"
column=
"7"
selection-start=
"4420"
selection-end=
"4420"
vertical-scroll-proportion=
"0.0
"
>
<folding>
<element
signature=
"e#625#662#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/portable.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
line=
"30"
column=
"0"
selection-start=
"447"
selection-end=
"447"
vertical-scroll-proportion=
"0.74336284"
>
<folding
/>
</state>
</provider>
</entry>
</component>
<component
name=
"masterDetails"
>
<states>
...
...
main.py
View file @
7f958de6
...
...
@@ -45,17 +45,6 @@ from pager import _SelectPager
from
subcmds
import
all_commands
# TODO workaround: disabled git pager since ideally it would fork to use less as pager
if
portable
.
isLinux
():
# will be set to less automatically, but let it be the default
#os.environ['GIT_PAGER'] = 'less'
pass
else
:
os
.
environ
[
'GIT_PAGER'
]
=
'less'
global_options
=
optparse
.
OptionParser
(
usage
=
"repo [-p|--paginate|--no-pager] COMMAND [ARGS]"
)
...
...
@@ -152,7 +141,7 @@ class _Repo(object):
print
(
"repo was not configured, run _Config(argv) before calling _Run(..)"
)
return
1
if
portable
.
isLinux
()
and
_UsePager
(
name
,
cmd
,
gopts
,
copts
):
if
_UsePager
(
name
,
cmd
,
gopts
,
copts
):
config
=
cmd
.
manifest
.
globalConfig
RunPager
(
config
)
...
...
@@ -456,7 +445,7 @@ def _Main(argv):
repo
.
_Config
(
argv
)
# intercept here if on Windows and Pager is required
if
not
portable
.
is
Linu
x
():
if
not
portable
.
is
Posi
x
():
if
_WindowsPager
(
repo
):
# everything was already done; so exit
exit
(
0
);
...
...
portable.py
View file @
7f958de6
...
...
@@ -13,34 +13,39 @@ SYNC_REPO_PROGRAM = False
def
stream2str
(
stream
):
return
str
(
stream
,
encoding
=
'UTF-8'
)
def
is
Linu
x
():
def
is
Uni
x
():
if
platform
.
system
()
==
"Windows"
:
return
False
else
:
return
True
def
pathToLinux
(
path
):
def
isPosix
():
return
platform
.
system
()
!=
"Windows"
def
toUnixPath
(
path
):
return
path
.
replace
(
'
\\
'
,
'/'
)
def
pathToWindows
(
path
):
def
toWindowsPath
(
path
):
return
path
.
replace
(
'/'
,
'
\\
'
)
def
os_link
(
src
,
dst
):
if
is
Linu
x
():
if
is
Uni
x
():
# requires src in relation to dst
src
=
os
.
path
.
relpath
(
src
,
os
.
path
.
dirname
(
dst
))
os
.
symlink
(
src
,
dst
)
else
:
dst
=
pathToLinux
(
dst
)
dst
=
toUnixPath
(
dst
)
#subprocess.call(["ln", "-s", src, dst])
# ln in MinGW does not create hard links? - it copies
if
os
.
path
.
isdir
(
src
):
src
=
pathToWindows
(
src
)
dst
=
pathToWindows
(
dst
)
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
))
else
:
# requires paths in relation to current dir (not in relation to target file)
src
=
pathToLinux
(
src
)
src
=
toUnixPath
(
src
)
os
.
link
(
src
,
dst
)
\ No newline at end of file
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