コード例 #1
0
 def _get_patch_data_text(self, h):
     patch_status_text = runext.run_cmd(["hg", "status", "-mardC"] +
                                        self._file_paths_filter).stdout
     h.update(patch_status_text)
     resolve_list_text = runext.run_cmd(["hg", "resolve", "--list"] +
                                        self._file_paths_filter).stdout
     h.update(resolve_list_text)
     return (patch_status_text, resolve_list_text)
コード例 #2
0
 def _get_file_data_text(self, h):
     file_data_text = runext.run_cmd(["hg", "status", "-marduiC"] +
                                     self._cmd_rev).stdout
     h.update(file_data_text)
     unresolved_file_text = runext.run_cmd(["hg", "resolve",
                                            "--list"]).stdout
     h.update(unresolved_file_text)
     return (file_data_text, unresolved_file_text)
コード例 #3
0
 def _get_patch_data_text(self, h):
     if self._parent_rev is None:
         return ("", "")
     patch_status_text = runext.run_cmd(
         ["hg", "status", "-mardC", "--rev", self._parent_rev]).stdout
     h.update(patch_status_text)
     resolve_list_text = runext.run_cmd(["hg", "resolve", "--list"]).stdout
     h.update(resolve_list_text)
     return (patch_status_text, resolve_list_text)
コード例 #4
0
 def _get_patch_data_text(self, h):
     if self._is_applied:
         patch_status_text = runext.run_cmd(
             ["hg", "status", "-mardC", "--change",
              self._patch_name]).stdout
     else:
         patch_status_text = utils.get_file_contents(self._patch_file_path)
     h.update(patch_status_text)
     return patch_status_text
コード例 #5
0
 def _get_patch_data_text(self, h):
     cmd = [
         "hg", "-q", "incoming", "--template",
         "{files}\\n{file_adds}\\n{file_dels}\\n", "-nl", "1", "--rev",
         str(self._rev)
     ]
     if self._path:
         cmd.append(self._path)
     result = runext.run_cmd(cmd)
     return result.stdout if result.ecode == 0 else ""
コード例 #6
0
 def _get_parent_rev():
     result = runext.run_cmd(["hg", "qapplied"])
     if result.ecode != 0: return None  # we're not in a repo so no patches
     applied_patches = result.stdout.splitlines()
     if not applied_patches:
         return None
     elif len(applied_patches) > 1:
         return applied_patches[-2]
     else:
         return get_qparent()
コード例 #7
0
def get_qparent():
    result = runext.run_cmd(["hg", "log", "--template", "{rev}", "-rqparent"])
    return result.stdout if result.ecode == 0 else None
コード例 #8
0
 def _get_patch_data_text(self, h):
     return runext.run_cmd(
         ["hg", "status", "-mardC", "--change",
          str(self._rev)]).stdout
コード例 #9
0
 def _get_current_is_applied(self):
     result = runext.run_cmd(["hg", "qapplied"])
     return False if result.ecode else self._patch_name in result.stdout.splitlines(
     )