1. Martin Vejnár
  2. hgdeps

Commits

Martin Vejnár  committed 7b01fcd

Fixed error reporting related to invalid or mismatched scm types.

  • Participants
  • Parent commits 6967d5f
  • Branches default

Comments (0)

Files changed (1)

File deps.py

View file
     def get_revision(self, readable):
         return '?'
     
+    def fetch(self, aliases, rev):
+        self.alias = aliases[self.alias_name]
+    
+    def update(self, rev):
+        raise util.Abort(_('cannot update a dependency of unknown type: %s, %s')
+            % (self.alias_name, self.alias.scmtype))
+    
     def move(self, dest):
         item = self.manifest[self.alias_name]
         
             alias = aliases[self.alias_name]
             if alias.scmtype != 'hg':
                 raise util.Abort(_('scmtype mismatch (try running "hg deppurge %s")')
-                    % self.alias.name)
+                    % alias.name)
             otherrepo = hg.repository(self.ui, alias.location)
             targetnode = otherrepo.lookup(rev)
             deprepo.pull(otherrepo, heads=[targetnode])
         hg.update(current_repo, current_repo.lookup(rev))
 
 class scm_cmd(scm_unknown):
-    def fetch(self, aliases, rev):
-        self.alias = aliases[self.alias_name]
-    
     def update(self, rev):
         if self.alias is None:
             raise util.Abort(_('cannot update unfetched dependency: %s') % self.alias_name)
         dir = self.manifest.get_dir(self.alias_name)
         path = self._make_deppath(dir)
         
+        if self.alias.scmtype != 'cmd':
+            raise util.Abort(_('scmtype mismatch (try running "hg deppurge %s")')
+                % self.alias.name)
+
         s = Template(self.alias.location)
         cmd = s.substitute(rev = rev, dest = path)