def main(force=False, no_deliver=False, initial=False): validateCC() global IGNORE_CONFLICTS if force: IGNORE_CONFLICTS=True cc_exec(['update', '.'], errors=False) log = ['log', '-z', '--first-parent', '--reverse', '--pretty=format:'+ LOG_FORMAT ] if not initial: log.append(CI_TAG + '..') log = git_exec(log) if not log: return cc.rebase() first = initial for line in log.split('\x00'): id, comment = line.split('\x01') statuses = getStatuses(id, first) first = False checkout(statuses, comment.strip(), initial) tag(CI_TAG, id) if not no_deliver: cc.commit() if initial: git_exec(['commit', '--allow-empty', '-m', 'Empty commit']) reset.main('HEAD')
def main(stash=False, dry_run=False, lshistory=False, load=None): validateCC() if not (stash or dry_run or lshistory): checkPristine() cc_exec(["update"]) since = getSince() cache.start() if load: history = open(load, 'r').read().decode(ENCODING) else: cc.rebase() history = getHistory(since) write(join(GIT_DIR, '.git', 'lshistory.bak'), history.encode(ENCODING)) if lshistory: print(history) else: cs = parseHistory(history) cs = reversed(cs) cs = mergeHistory(cs) if dry_run: return printGroups(cs) if not len(cs): return doStash(lambda: doCommit(cs), stash)
def main(force=False, no_deliver=False, initial=False, all=False, cclabel=''): validateCC() global IGNORE_CONFLICTS global CC_LABEL if cclabel: CC_LABEL = cclabel if force: IGNORE_CONFLICTS = True cc_exec(['update', '.'], errors=False) log = ['log', '-z', '--reverse', '--pretty=format:' + LOG_FORMAT] if not all: log.append('--first-parent') if not initial: log.append(CI_TAG + '..') log = git_exec(log) if not log: return cc.rebase() for line in log.split('\x00'): id, comment = line.split('\x01') statuses = getStatuses(id, initial) checkout(statuses, comment.strip(), initial) tag(CI_TAG, id) if not no_deliver: cc.commit() if initial: git_exec(['commit', '--allow-empty', '-m', 'Empty commit']) reset.main('HEAD')
def main(stash=False, dry_run=False, lshistory=False, load=None): validateCC() if not (stash or dry_run or lshistory): checkPristine() cc_exec(["update"], errors=False) since = getSince() cache.start() if load: history = open(load, 'r').read().decode(ENCODING) else: cc.rebase() history = getHistory(since) write(join(GIT_DIR, '.git', 'lshistory.bak'), history.encode(ENCODING)) if lshistory: print(history) else: cs = parseHistory(history) cs = reversed(cs) cs = mergeHistory(cs) if dry_run: return printGroups(cs) if not len(cs): return doStash(lambda: doCommit(cs), stash)
def main(stash=False, dry_run=False, lshistory=False, load=None): if not (stash or dry_run or lshistory): checkPristine() since = getSince() if load: history = open(load, 'r').read() else: cc.rebase() history = getHistory(since) if lshistory: print(history) else: cs = parseHistory(history,getCurrentVersions()) cs.sort(key = lambda x: x.date) cs = mergeHistory(cs) if dry_run: return printGroups(cs) if not len(cs): return doStash(lambda: doCommit(cs), stash)