Mercurial > hg
comparison hgext/sparse.py @ 38112:d7cecea0b254
py3: add r'' prefixes to fix kwargs handling in hgext/sparse.py
This fixes two of sparse tests which were failing on Python 3.
# skip-blame because just r'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D3634
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 20 May 2018 18:41:24 +0530 |
parents | deb851914fd7 |
children | fa88170c10bb |
comparison
equal
deleted
inserted
replaced
38111:bacbe829c2bf | 38112:d7cecea0b254 |
---|---|
136 revs = revs.filter(ctxmatch) | 136 revs = revs.filter(ctxmatch) |
137 return revs | 137 return revs |
138 extensions.wrapfunction(logcmdutil, '_initialrevs', _initialrevs) | 138 extensions.wrapfunction(logcmdutil, '_initialrevs', _initialrevs) |
139 | 139 |
140 def _clonesparsecmd(orig, ui, repo, *args, **opts): | 140 def _clonesparsecmd(orig, ui, repo, *args, **opts): |
141 include_pat = opts.get('include') | 141 include_pat = opts.get(r'include') |
142 exclude_pat = opts.get('exclude') | 142 exclude_pat = opts.get(r'exclude') |
143 enableprofile_pat = opts.get('enable_profile') | 143 enableprofile_pat = opts.get(r'enable_profile') |
144 include = exclude = enableprofile = False | 144 include = exclude = enableprofile = False |
145 if include_pat: | 145 if include_pat: |
146 pat = include_pat | 146 pat = include_pat |
147 include = True | 147 include = True |
148 if exclude_pat: | 148 if exclude_pat: |
176 entry = commands.table['^add'] | 176 entry = commands.table['^add'] |
177 entry[1].append(('s', 'sparse', None, | 177 entry[1].append(('s', 'sparse', None, |
178 'also include directories of added files in sparse config')) | 178 'also include directories of added files in sparse config')) |
179 | 179 |
180 def _add(orig, ui, repo, *pats, **opts): | 180 def _add(orig, ui, repo, *pats, **opts): |
181 if opts.get('sparse'): | 181 if opts.get(r'sparse'): |
182 dirs = set() | 182 dirs = set() |
183 for pat in pats: | 183 for pat in pats: |
184 dirname, basename = util.split(pat) | 184 dirname, basename = util.split(pat) |
185 dirs.add(dirname) | 185 dirs.add(dirname) |
186 sparse.updateconfig(repo, list(dirs), opts, include=True) | 186 sparse.updateconfig(repo, list(dirs), opts, include=True) |