- old_git_revision: str
- table: Dict[str, ChannelTableEntry]
-
-
-class GitSearchPath(TarrableSearchPath):
- def pin(self, v: Verification) -> GitPin:
- if hasattr(self, 'git_revision'):
- self.old_git_revision = self.git_revision
- del self.git_revision
-
- git_fetch(v, self)
- return GitPin(release_name=git_revision_name(v, self),
- git_revision=self.git_revision)
-
- def fetch(self, v: Verification, section: str,
- conf: configparser.SectionProxy) -> str:
- if 'git_revision' not in conf or 'release_name' not in conf:
- raise Exception(
- 'Cannot update unpinned channel "%s" (Run "pin" before "update")' %
- section)
-
- ensure_git_rev_available(v, self)
- return git_get_tarball(v, self)
-
-
-class ChannelSearchPath(TarrableSearchPath):
- def pin(self, v: Verification) -> ChannelPin:
- if hasattr(self, 'git_revision'):
- self.old_git_revision = self.git_revision
- del self.git_revision
-
- fetch(v, self)
- parse_channel(v, self)
- fetch_resources(v, self)
- ensure_git_rev_available(v, self)
- check_channel_contents(v, self)
+
+ def pin(self, v: Verification, old_pin: Optional[Pin]) -> ChannelPin:
+ if old_pin is not None:
+ assert isinstance(old_pin, ChannelPin)
+ old_revision = old_pin.git_revision if old_pin is not None else None
+
+ channel_html, forwarded_url = fetch_channel(v, self)
+ table, new_gitpin = parse_channel(v, channel_html)
+ fetch_resources(v, new_gitpin, forwarded_url, table)
+ ensure_git_rev_available(v, self, new_gitpin, old_revision)
+ check_channel_contents(v, self, table, new_gitpin)