Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
be1377d1
Commit
be1377d1
authored
13 years ago
by
Greg Ward
Browse files
Options
Downloads
Patches
Plain Diff
largefiles: test lfconvert error handling; remove redundant code
parent
f4b29792
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hgext/largefiles/lfcommands.py
+8
-20
8 additions, 20 deletions
hgext/largefiles/lfcommands.py
tests/test-lfconvert.t
+17
-0
17 additions, 0 deletions
tests/test-lfconvert.t
with
25 additions
and
20 deletions
hgext/largefiles/lfcommands.py
+
8
−
20
View file @
be1377d1
...
...
@@ -43,26 +43,14 @@
else
:
tolfile
=
True
size
=
lfutil
.
getminsize
(
ui
,
True
,
opts
.
get
(
'
size
'
),
default
=
None
)
try
:
rsrc
=
hg
.
repository
(
ui
,
src
)
if
not
rsrc
.
local
():
raise
util
.
Abort
(
_
(
'
%s is not a local Mercurial repo
'
)
%
src
)
except
error
.
RepoError
,
err
:
ui
.
traceback
()
raise
util
.
Abort
(
err
.
args
[
0
])
if
os
.
path
.
exists
(
dest
):
if
not
os
.
path
.
isdir
(
dest
):
raise
util
.
Abort
(
_
(
'
destination %s already exists
'
)
%
dest
)
elif
os
.
listdir
(
dest
):
raise
util
.
Abort
(
_
(
'
destination %s is not empty
'
)
%
dest
)
try
:
ui
.
status
(
_
(
'
initializing destination %s
\n
'
)
%
dest
)
rdst
=
hg
.
repository
(
ui
,
dest
,
create
=
True
)
if
not
rdst
.
local
():
raise
util
.
Abort
(
_
(
'
%s is not a local Mercurial repo
'
)
%
dest
)
except
error
.
RepoError
:
ui
.
traceback
()
raise
util
.
Abort
(
_
(
'
%s is not a repo
'
)
%
dest
)
rsrc
=
hg
.
repository
(
ui
,
src
)
if
not
rsrc
.
local
():
raise
util
.
Abort
(
_
(
'
%s is not a local Mercurial repo
'
)
%
src
)
ui
.
status
(
_
(
'
initializing destination %s
\n
'
)
%
dest
)
rdst
=
hg
.
repository
(
ui
,
dest
,
create
=
True
)
if
not
rdst
.
local
():
raise
util
.
Abort
(
_
(
'
%s is not a local Mercurial repo
'
)
%
dest
)
success
=
False
try
:
...
...
This diff is collapsed.
Click to expand it.
tests/test-lfconvert.t
+
17
−
0
View file @
be1377d1
$
cat
>>
$HGRCPATH
<<
EOF
>
[
extensions
]
>
largefiles
=
>
share
=
>
[
largefiles
]
>
minsize
=
0.5
>
patterns
=
**.
dat
...
...
@@ -41,5 +42,20 @@
$
cat
.
hglf
/a-large-file .hglf/ano
ther
-
large
-
file
2e000
fa7e85759c7f4c254d4d9c33ef481e459a7
3
b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
$
cd
..
"
lfconvert
"
error
cases
$
hg
lfconvert
nosuchrepo
foo
abort:
repository
nosuchrepo
not
found
!
[
255
]
$
hg
share
-
q -U
bigfile
-
repo
shared
$
echo
-
n
bogus
>
shared
/.hg/s
haredpath
$
hg
lfconvert
shared
foo
abort:
.
hg
/sharedpath points to nonexistent directory $TESTTMP/
bogus
!
[
255
]
$
hg
lfconvert
bigfile
-
repo
largefiles
-
repo
initializing
destination
largefiles
-
repo
abort:
repository
largefiles
-
repo
already
exists
!
[
255
]
Convert
back
to
a
normal
(
non
-
largefiles
)
repo
...
...
@@ -44,5 +60,6 @@
Convert
back
to
a
normal
(
non
-
largefiles
)
repo
$
cd
largefiles
-
repo
$
hg
lfconvert
--
to
-
normal
.
../
normal
-
repo
initializing
destination
../
normal
-
repo
$
cd
../
normal
-
repo
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment