Ejemplo n.º 1
0
  def testParsePatchDeps(self):
    """Tests that we can parse the dependency specified by the user."""
    change_id = self.VALID_CHANGE_ID
    vals = ['CL:12345', 'project~branch~%s' % change_id, change_id,
            change_id[1:]]
    for val in vals:
      self.assertTrue(cros_patch.ParsePatchDep(val) is not None)

    self._assertBad(cros_patch.ParsePatchDep,
                    ['145462399', 'I47ea3', 'i47ea3'.ljust(41, '0')])
Ejemplo n.º 2
0
def GetGerritPatchInfo(patches):
    """Query Gerrit server for patch information using string queries.

  Args:
    patches: A list of patch IDs to query. Internal patches start with a '*'.

  Returns:
    A list of GerritPatch objects describing each patch.  Only the first
    instance of a requested patch is returned.

  Raises:
    PatchException if a patch can't be found.
    ValueError if a query string cannot be converted to a PatchQuery object.
  """
    return GetGerritPatchInfoWithPatchQueries(
        [cros_patch.ParsePatchDep(p) for p in patches])
 def PaladinDependencies(self, patch, path):
     self._assertPath(patch, path)
     return [cros_patch.ParsePatchDep(x) for x in self.cq[patch.id]]
 def GerritDependencies(self, patch):
     return [cros_patch.ParsePatchDep(x) for x in self.parents[patch.id]]