Show More
@@ -417,6 +417,14 b' impl Repo {' | |||||
417 | ) |
|
417 | ) | |
418 | } |
|
418 | } | |
419 |
|
419 | |||
|
420 | pub fn has_subrepos(&self) -> Result<bool, DirstateError> { | |||
|
421 | if let Some(entry) = self.dirstate_map()?.get(HgPath::new(".hgsub"))? { | |||
|
422 | Ok(entry.state().is_tracked()) | |||
|
423 | } else { | |||
|
424 | Ok(false) | |||
|
425 | } | |||
|
426 | } | |||
|
427 | ||||
420 | pub fn filelog(&self, path: &HgPath) -> Result<Filelog, HgError> { |
|
428 | pub fn filelog(&self, path: &HgPath) -> Result<Filelog, HgError> { | |
421 | Filelog::open(self, path) |
|
429 | Filelog::open(self, path) | |
422 | } |
|
430 | } |
@@ -29,7 +29,7 b' fn main_with_result(' | |||||
29 | repo: Result<&Repo, &NoRepoInCwdError>, |
|
29 | repo: Result<&Repo, &NoRepoInCwdError>, | |
30 | config: &Config, |
|
30 | config: &Config, | |
31 | ) -> Result<(), CommandError> { |
|
31 | ) -> Result<(), CommandError> { | |
32 | check_unsupported(config, ui)?; |
|
32 | check_unsupported(config, repo, ui)?; | |
33 |
|
33 | |||
34 | let app = App::new("rhg") |
|
34 | let app = App::new("rhg") | |
35 | .global_setting(AppSettings::AllowInvalidUtf8) |
|
35 | .global_setting(AppSettings::AllowInvalidUtf8) | |
@@ -643,6 +643,7 b' fn check_extensions(config: &Config) -> ' | |||||
643 |
|
643 | |||
644 | fn check_unsupported( |
|
644 | fn check_unsupported( | |
645 | config: &Config, |
|
645 | config: &Config, | |
|
646 | repo: Result<&Repo, &NoRepoInCwdError>, | |||
646 | ui: &ui::Ui, |
|
647 | ui: &ui::Ui, | |
647 | ) -> Result<(), CommandError> { |
|
648 | ) -> Result<(), CommandError> { | |
648 | check_extensions(config)?; |
|
649 | check_extensions(config)?; | |
@@ -653,6 +654,12 b' fn check_unsupported(' | |||||
653 | Err(CommandError::unsupported("$HG_PENDING"))? |
|
654 | Err(CommandError::unsupported("$HG_PENDING"))? | |
654 | } |
|
655 | } | |
655 |
|
656 | |||
|
657 | if let Ok(repo) = repo { | |||
|
658 | if repo.has_subrepos()? { | |||
|
659 | Err(CommandError::unsupported("sub-repositories"))? | |||
|
660 | } | |||
|
661 | } | |||
|
662 | ||||
656 | if config.has_non_empty_section(b"encode") { |
|
663 | if config.has_non_empty_section(b"encode") { | |
657 | Err(CommandError::unsupported("[encode] config"))? |
|
664 | Err(CommandError::unsupported("[encode] config"))? | |
658 | } |
|
665 | } |
General Comments 0
You need to be logged in to leave comments.
Login now