142 return _parsestoredpatterns(spec) |
142 return _parsestoredpatterns(spec) |
143 |
143 |
144 def save(repo, includepats, excludepats): |
144 def save(repo, includepats, excludepats): |
145 spec = format(includepats, excludepats) |
145 spec = format(includepats, excludepats) |
146 repo.vfs.write(FILENAME, spec) |
146 repo.vfs.write(FILENAME, spec) |
|
147 |
|
148 def savebackup(vfs, backupname): |
|
149 vfs.tryunlink(backupname) |
|
150 util.copyfile(vfs.join(FILENAME), vfs.join(backupname), hardlink=True) |
|
151 |
|
152 def restorebackup(vfs, backupname): |
|
153 vfs.rename(backupname, FILENAME, checkambig=True) |
|
154 |
|
155 def clearbackup(vfs, backupname): |
|
156 vfs.unlink(backupname) |
147 |
157 |
148 def restrictpatterns(req_includes, req_excludes, repo_includes, repo_excludes): |
158 def restrictpatterns(req_includes, req_excludes, repo_includes, repo_excludes): |
149 r""" Restricts the patterns according to repo settings, |
159 r""" Restricts the patterns according to repo settings, |
150 results in a logical AND operation |
160 results in a logical AND operation |
151 |
161 |