973 if refresh: |
973 if refresh: |
974 raise util.Abort(_("local changes found, refresh first")) |
974 raise util.Abort(_("local changes found, refresh first")) |
975 else: |
975 else: |
976 raise util.Abort(_("local changes found")) |
976 raise util.Abort(_("local changes found")) |
977 |
977 |
|
978 def localchangedsubreposfound(self, refresh=True): |
|
979 if refresh: |
|
980 raise util.Abort(_("local changed subrepos found, refresh first")) |
|
981 else: |
|
982 raise util.Abort(_("local changed subrepos found")) |
|
983 |
978 def checklocalchanges(self, repo, force=False, refresh=True): |
984 def checklocalchanges(self, repo, force=False, refresh=True): |
979 cmdutil.checkunfinished(repo) |
985 cmdutil.checkunfinished(repo) |
980 m, a, r, d = repo.status()[:4] |
986 m, a, r, d = repo.status()[:4] |
981 if (m or a or r or d) and not force: |
987 if not force: |
982 self.localchangesfound(refresh) |
988 if (m or a or r or d): |
|
989 self.localchangesfound(refresh) |
|
990 if self.checksubstate(repo): |
|
991 self.localchangedsubreposfound(refresh) |
983 return m, a, r, d |
992 return m, a, r, d |
984 |
993 |
985 _reserved = ('series', 'status', 'guards', '.', '..') |
994 _reserved = ('series', 'status', 'guards', '.', '..') |
986 def checkreservedname(self, name): |
995 def checkreservedname(self, name): |
987 if name in self._reserved: |
996 if name in self._reserved: |