Mercurial > hg-git
comparison hggit/gitdirstate.py @ 1128:6141895a53c9
compat: switch from hgutil.Abort to error.Abort
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Wed, 02 May 2018 20:43:17 -0500 |
parents | 8ed6c0cae9b8 |
children | c4703246f350 |
comparison
equal
deleted
inserted
replaced
1127:108d9303ef71 | 1128:6141895a53c9 |
---|---|
3 import re | 3 import re |
4 import errno | 4 import errno |
5 | 5 |
6 from mercurial import ( | 6 from mercurial import ( |
7 dirstate, | 7 dirstate, |
8 error, | |
8 match as matchmod, | 9 match as matchmod, |
9 scmutil, | 10 scmutil, |
10 util, | 11 util, |
11 ) | 12 ) |
12 | 13 |
86 allpats.extend(extrapatterns) | 87 allpats.extend(extrapatterns) |
87 if not allpats: | 88 if not allpats: |
88 return util.never | 89 return util.never |
89 try: | 90 try: |
90 ignorefunc = matchmod.match(root, '', [], allpats) | 91 ignorefunc = matchmod.match(root, '', [], allpats) |
91 except util.Abort: | 92 except error.Abort: |
92 for f, patlist in pats: | 93 for f, patlist in pats: |
93 try: | 94 try: |
94 matchmod.match(root, '', [], patlist) | 95 matchmod.match(root, '', [], patlist) |
95 except util.Abort, inst: | 96 except error.Abort, inst: |
96 if not ignoremod: | 97 if not ignoremod: |
97 # in this case, patlist is ['include: FILE'], and | 98 # in this case, patlist is ['include: FILE'], and |
98 # inst[0] should already include FILE | 99 # inst[0] should already include FILE |
99 raise | 100 raise |
100 raise util.Abort('%s: %s' % (f, inst[0])) | 101 raise error.Abort('%s: %s' % (f, inst[0])) |
101 if extrapatterns: | 102 if extrapatterns: |
102 try: | 103 try: |
103 matchmod.match(root, '', [], extrapatterns) | 104 matchmod.match(root, '', [], extrapatterns) |
104 except util.Abort, inst: | 105 except error.Abort, inst: |
105 raise util.Abort('%s: %s' % ('extra patterns', inst[0])) | 106 raise error.Abort('%s: %s' % ('extra patterns', inst[0])) |
106 return ignorefunc | 107 return ignorefunc |
107 | 108 |
108 | 109 |
109 class gitdirstate(dirstate.dirstate): | 110 class gitdirstate(dirstate.dirstate): |
110 @dirstate.rootcache('.hgignore') | 111 @dirstate.rootcache('.hgignore') |