Ejemplo n.º 1
0
 def set_last_modified(self, dest_path, time_stamp, dry_run):
     """Set last modified time for destPath to timeStamp on epoch-format"""
     # Translate time from RFC 1123 to seconds since epoch format
     secs = util.parse_time_string(time_stamp)
     if not dry_run:
         os.utime(self._file_path, (secs, secs))
     return True
Ejemplo n.º 2
0
    def _get_log(self, limit=None):
        """Read log entries into a list of dictionaries."""
        self.ui.pushbuffer()
        commands.log(self.ui,
                     self.repo,
                     limit=limit,
                     date=None,
                     rev=None,
                     user=None)
        res = self.ui.popbuffer().strip()

        logList = []
        for logentry in res.split("\n\n"):
            log = {}
            logList.append(log)
            for line in logentry.split("\n"):
                k, v = line.split(":", 1)
                assert k in ("changeset", "tag", "user", "date", "summary")
                log[k.strip()] = v.strip()
            log["parsed_date"] = util.parse_time_string(log["date"])
            local_id, unid = log["changeset"].split(":")
            log["local_id"] = int(local_id)
            log["unid"] = unid
#        pprint(logList)
        return logList
Ejemplo n.º 3
0
 def set_last_modified(self, dest_path, time_stamp, dry_run):
     """Set last modified time for destPath to timeStamp on epoch-format"""
     # Translate time from RFC 1123 to seconds since epoch format
     secs = util.parse_time_string(time_stamp)
     if not dry_run:
         os.utime(self._file_path, (secs, secs))
     return True
Ejemplo n.º 4
0
 def set_last_modified(self, dest_path, time_stamp, dry_run):
     """Set last modified time for destPath to timeStamp on epoch-format"""
     # Translate time from RFC 1123 to seconds since epoch format
     secs = util.parse_time_string(time_stamp)
     if not dry_run:
         obj = self.db._dir_model.get_by_name(name=dest_path)
         obj.epoch = int(secs)
         obj.save()
     return True
Ejemplo n.º 5
0
    def _get_log(self, limit=None):
        """Read log entries into a list of dictionaries."""
        self.ui.pushbuffer()
        commands.log(self.ui, self.repo, limit=limit, date=None, rev=None, user=None)
        res = self.ui.popbuffer().strip()

        logList = []
        for logentry in res.split("\n\n"):
            log = {}
            logList.append(log)
            for line in logentry.split("\n"):
                k, v = line.split(":", 1)
                assert k in ("changeset", "tag", "user", "date", "summary")
                log[k.strip()] = v.strip()
            log["parsed_date"] = util.parse_time_string(log["date"])
            local_id, unid = log["changeset"].split(":")
            log["local_id"] = int(local_id)
            log["unid"] = unid
        #        pprint(logList)
        return logList