##// END OF EJS Templates
subrepo: add basestate method...
Matt Mackall -
r16072:bcb973ab default
parent child Browse files
Show More
@@ -275,6 +275,11 class abstractsubrepo(object):
275 """
275 """
276 raise NotImplementedError
276 raise NotImplementedError
277
277
278 def basestate(self):
279 """current working directory base state, disregarding .hgsubstate
280 state and working directory modifications"""
281 raise NotImplementedError
282
278 def checknested(self, path):
283 def checknested(self, path):
279 """check if path is a subrepository within this repository"""
284 """check if path is a subrepository within this repository"""
280 return False
285 return False
@@ -446,6 +451,9 class hgsubrepo(abstractsubrepo):
446 return True
451 return True
447 return w.dirty() # working directory changed
452 return w.dirty() # working directory changed
448
453
454 def basestate(self):
455 return self._repo['.'].hex()
456
449 def checknested(self, path):
457 def checknested(self, path):
450 return self._repo._checknested(self._repo.wjoin(path))
458 return self._repo._checknested(self._repo.wjoin(path))
451
459
@@ -666,6 +674,9 class svnsubrepo(abstractsubrepo):
666 return False
674 return False
667 return True
675 return True
668
676
677 def basestate(self):
678 return self._wcrev()
679
669 def commit(self, text, user, date):
680 def commit(self, text, user, date):
670 # user and date are out of our hands since svn is centralized
681 # user and date are out of our hands since svn is centralized
671 changed, extchanged = self._wcchanged()
682 changed, extchanged = self._wcchanged()
@@ -907,6 +918,9 class gitsubrepo(abstractsubrepo):
907 out, code = self._gitdir(['diff-index', '--quiet', 'HEAD'])
918 out, code = self._gitdir(['diff-index', '--quiet', 'HEAD'])
908 return code == 1
919 return code == 1
909
920
921 def basestate(self):
922 return self._gitstate()
923
910 def get(self, state, overwrite=False):
924 def get(self, state, overwrite=False):
911 source, revision, kind = state
925 source, revision, kind = state
912 if not revision:
926 if not revision:
General Comments 0
You need to be logged in to leave comments. Login now