Mercurial > public > mercurial-scm > hg
comparison mercurial/scmutil.py @ 24934:5abd0a76bc8f
requires: move requires file writing func from localrepo to scmutil
The logic to read a requires file resides in scmutil, so it's only logical that
the logic to write the file should be there too.
And now I've typed logic too many times it no longer looks like a word.
Logically.
author | Drew Gottlieb <drgott@google.com> |
---|---|
date | Mon, 13 Apr 2015 18:11:47 -0400 |
parents | cd89f4e6faf2 |
children | 755d23a49170 |
comparison
equal
deleted
inserted
replaced
24932:022282152632 | 24934:5abd0a76bc8f |
---|---|
1009 % " ".join(missings), | 1009 % " ".join(missings), |
1010 hint=_("see http://mercurial.selenic.com/wiki/MissingRequirement" | 1010 hint=_("see http://mercurial.selenic.com/wiki/MissingRequirement" |
1011 " for more information")) | 1011 " for more information")) |
1012 return requirements | 1012 return requirements |
1013 | 1013 |
1014 def writerequires(opener, requirements): | |
1015 reqfile = opener("requires", "w") | |
1016 for r in sorted(requirements): | |
1017 reqfile.write("%s\n" % r) | |
1018 reqfile.close() | |
1019 | |
1014 class filecachesubentry(object): | 1020 class filecachesubentry(object): |
1015 def __init__(self, path, stat): | 1021 def __init__(self, path, stat): |
1016 self.path = path | 1022 self.path = path |
1017 self.cachestat = None | 1023 self.cachestat = None |
1018 self._cacheable = None | 1024 self._cacheable = None |