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
cef9eaae
Commit
cef9eaae
authored
5 years ago
by
Kevin Bullock
Browse files
Options
Downloads
Patches
Plain Diff
compat: drop compatibility check for ignore module
parent
60c2da67
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/__init__.py
+0
-13
0 additions, 13 deletions
hggit/__init__.py
hggit/gitdirstate.py
+4
-18
4 additions, 18 deletions
hggit/gitdirstate.py
with
4 additions
and
31 deletions
hggit/__init__.py
+
0
−
13
View file @
cef9eaae
...
@@ -59,14 +59,6 @@
...
@@ -59,14 +59,6 @@
# We only *use* the exchange module in hg 3.2+, so this is safe
# We only *use* the exchange module in hg 3.2+, so this is safe
pass
pass
# COMPAT: hg 3.5 - ignore module was removed
try
:
from
mercurial
import
ignore
ignore
.
readpats
ignoremod
=
True
except
(
AttributeError
,
ImportError
):
ignoremod
=
False
# COMPAT: hg 3.0 - revset.baseset was added
# COMPAT: hg 3.0 - revset.baseset was added
baseset
=
set
baseset
=
set
try
:
try
:
...
@@ -224,8 +216,7 @@
...
@@ -224,8 +216,7 @@
if
not
isinstance
(
repo
,
gitrepo
.
gitrepo
):
if
not
isinstance
(
repo
,
gitrepo
.
gitrepo
):
if
(
getattr
(
dirstate
,
'
rootcache
'
,
False
)
and
if
(
getattr
(
dirstate
,
'
rootcache
'
,
False
)
and
(
not
ignoremod
or
getattr
(
ignore
,
'
readpats
'
,
False
))
and
hgutil
.
safehasattr
(
repo
,
'
vfs
'
)
and
hgutil
.
safehasattr
(
repo
,
'
vfs
'
)
and
os
.
path
.
exists
(
compat
.
gitvfs
(
repo
).
join
(
'
git
'
))):
os
.
path
.
exists
(
compat
.
gitvfs
(
repo
).
join
(
'
git
'
))):
# only install our dirstate wrapper if it has a hope of working
# only install our dirstate wrapper if it has a hope of working
import
gitdirstate
import
gitdirstate
...
@@ -228,11 +219,7 @@
...
@@ -228,11 +219,7 @@
hgutil
.
safehasattr
(
repo
,
'
vfs
'
)
and
hgutil
.
safehasattr
(
repo
,
'
vfs
'
)
and
os
.
path
.
exists
(
compat
.
gitvfs
(
repo
).
join
(
'
git
'
))):
os
.
path
.
exists
(
compat
.
gitvfs
(
repo
).
join
(
'
git
'
))):
# only install our dirstate wrapper if it has a hope of working
# only install our dirstate wrapper if it has a hope of working
import
gitdirstate
import
gitdirstate
if
ignoremod
:
def
ignorewrap
(
orig
,
*
args
,
**
kwargs
):
return
gitdirstate
.
gignore
(
*
args
,
**
kwargs
)
extensions
.
wrapfunction
(
ignore
,
'
ignore
'
,
ignorewrap
)
dirstate
.
dirstate
=
gitdirstate
.
gitdirstate
dirstate
.
dirstate
=
gitdirstate
.
gitdirstate
klass
=
hgrepo
.
generate_repo_subclass
(
repo
.
__class__
)
klass
=
hgrepo
.
generate_repo_subclass
(
repo
.
__class__
)
...
...
This diff is collapsed.
Click to expand it.
hggit/gitdirstate.py
+
4
−
18
View file @
cef9eaae
...
@@ -13,14 +13,6 @@
...
@@ -13,14 +13,6 @@
import
compat
import
compat
# COMPAT: hg 3.5 - ignore module was removed
try
:
from
mercurial
import
ignore
ignore
.
readpats
ignoremod
=
True
except
(
AttributeError
,
ImportError
):
ignoremod
=
False
# COMPAT: hg 2.9 - pathauditor moved to pathutil
# COMPAT: hg 2.9 - pathauditor moved to pathutil
try
:
try
:
from
mercurial
import
pathutil
from
mercurial
import
pathutil
...
@@ -78,11 +70,7 @@
...
@@ -78,11 +70,7 @@
def
gignore
(
root
,
files
,
warn
,
extrapatterns
=
None
):
def
gignore
(
root
,
files
,
warn
,
extrapatterns
=
None
):
allpats
=
[]
allpats
=
[]
pats
=
[]
pats
=
[(
f
,
[
'
include:%s
'
%
f
])
for
f
in
files
]
if
ignoremod
:
pats
=
ignore
.
readpats
(
root
,
files
,
warn
)
else
:
pats
=
[(
f
,
[
'
include:%s
'
%
f
])
for
f
in
files
]
for
f
,
patlist
in
pats
:
for
f
,
patlist
in
pats
:
allpats
.
extend
(
patlist
)
allpats
.
extend
(
patlist
)
...
@@ -97,11 +85,9 @@
...
@@ -97,11 +85,9 @@
try
:
try
:
matchmod
.
match
(
root
,
''
,
[],
patlist
)
matchmod
.
match
(
root
,
''
,
[],
patlist
)
except
error
.
Abort
,
inst
:
except
error
.
Abort
,
inst
:
if
not
ignoremod
:
# in this case, patlist is ['include: FILE'], and
# in this case, patlist is ['include: FILE'], and
# inst[0] should already include FILE
# inst[0] should already include FILE
raise
raise
raise
error
.
Abort
(
'
%s: %s
'
%
(
f
,
inst
[
0
]))
if
extrapatterns
:
if
extrapatterns
:
try
:
try
:
matchmod
.
match
(
root
,
''
,
[],
extrapatterns
)
matchmod
.
match
(
root
,
''
,
[],
extrapatterns
)
...
...
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