diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -275,6 +275,11 @@ class abstractsubrepo(object): """ raise NotImplementedError + def basestate(self): + """current working directory base state, disregarding .hgsubstate + state and working directory modifications""" + raise NotImplementedError + def checknested(self, path): """check if path is a subrepository within this repository""" return False @@ -446,6 +451,9 @@ class hgsubrepo(abstractsubrepo): return True return w.dirty() # working directory changed + def basestate(self): + return self._repo['.'].hex() + def checknested(self, path): return self._repo._checknested(self._repo.wjoin(path)) @@ -666,6 +674,9 @@ class svnsubrepo(abstractsubrepo): return False return True + def basestate(self): + return self._wcrev() + def commit(self, text, user, date): # user and date are out of our hands since svn is centralized changed, extchanged = self._wcchanged() @@ -907,6 +918,9 @@ class gitsubrepo(abstractsubrepo): out, code = self._gitdir(['diff-index', '--quiet', 'HEAD']) return code == 1 + def basestate(self): + return self._gitstate() + def get(self, state, overwrite=False): source, revision, kind = state if not revision: