Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
hg-git
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
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
hg-git
Commits
56a3fc20
Commit
56a3fc20
authored
7 years ago
by
Kevin Bullock
Browse files
Options
Downloads
Patches
Plain Diff
compat: find listdir function in compat module
parent
583ac3dd
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
hggit/compat.py
+7
-0
7 additions, 0 deletions
hggit/compat.py
hggit/gitdirstate.py
+3
-7
3 additions, 7 deletions
hggit/gitdirstate.py
with
10 additions
and
7 deletions
hggit/compat.py
+
7
−
0
View file @
56a3fc20
...
...
@@ -83,6 +83,13 @@
except
TypeError
:
phases
.
advanceboundary
(
repo
,
targetphase
,
nodes
)
# hg 4.3 - osutil moved, but mercurial.util re-exports listdir
if
hgutil
.
safehasattr
(
hgutil
,
'
listdir
'
):
listdir
=
hgutil
.
listdir
else
:
from
mercurial
import
osutil
listdir
=
osutil
.
listdir
try
:
import
dulwich.client
...
...
This diff is collapsed.
Click to expand it.
hggit/gitdirstate.py
+
3
−
7
View file @
56a3fc20
...
...
@@ -11,6 +11,8 @@
util
,
)
import
compat
# COMPAT: hg 3.5 - ignore module was removed
try
:
from
mercurial
import
ignore
...
...
@@ -164,12 +166,6 @@
matchalways
=
match
.
always
()
matchtdir
=
match
.
traversedir
dmap
=
self
.
_map
# COMPAT: hg 4.3 - osutil moved, but util re-exports listdir
try
:
listdir
=
util
.
listdir
except
AttributeError
:
from
mercurial
import
osutil
listdir
=
osutil
.
listdir
lstat
=
os
.
lstat
dirkind
=
stat
.
S_IFDIR
regkind
=
stat
.
S_IFREG
...
...
@@ -209,7 +205,7 @@
else
:
skip
=
'
.hg
'
try
:
entries
=
listdir
(
join
(
nd
),
stat
=
True
,
skip
=
skip
)
entries
=
compat
.
listdir
(
join
(
nd
),
stat
=
True
,
skip
=
skip
)
except
OSError
,
inst
:
if
inst
.
errno
in
(
errno
.
EACCES
,
errno
.
ENOENT
):
fwarn
(
nd
,
inst
.
strerror
)
...
...
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