Chris@109: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@109: Chris@109: /* Chris@109: EasyMercurial Chris@109: Chris@109: Based on HgExplorer by Jari Korhonen Chris@109: Copyright (c) 2010 Jari Korhonen Chris@109: Copyright (c) 2010 Chris Cannam Chris@109: Copyright (c) 2010 Queen Mary, University of London Chris@109: Chris@109: This program is free software; you can redistribute it and/or Chris@109: modify it under the terms of the GNU General Public License as Chris@109: published by the Free Software Foundation; either version 2 of the Chris@109: License, or (at your option) any later version. See the file Chris@109: COPYING included with this distribution for more information. Chris@109: */ Chris@109: Chris@109: #ifndef HGACTION_H Chris@109: #define HGACTION_H Chris@109: Chris@109: #include Chris@109: #include Chris@109: Chris@109: enum HGACTIONS Chris@109: { Chris@109: ACT_NONE, Chris@109: ACT_QUERY_PATHS, Chris@109: ACT_QUERY_BRANCH, Chris@109: ACT_STAT, Chris@163: ACT_RESOLVE_LIST, Chris@109: ACT_QUERY_HEADS, Chris@109: ACT_QUERY_PARENTS, Chris@109: ACT_LOG, Chris@115: ACT_LOG_INCREMENTAL, Chris@109: ACT_REMOVE, Chris@109: ACT_ADD, Chris@109: ACT_INCOMING, Chris@109: ACT_PUSH, Chris@109: ACT_PULL, Chris@109: ACT_CLONEFROMREMOTE, Chris@109: ACT_INIT, Chris@109: ACT_COMMIT, Chris@109: ACT_ANNOTATE, Chris@168: ACT_DIFF_SUMMARY, Chris@109: ACT_FOLDERDIFF, Chris@109: ACT_CHGSETDIFF, Chris@109: ACT_UPDATE, Chris@109: ACT_REVERT, Chris@109: ACT_MERGE, Chris@109: ACT_SERVE, Chris@109: ACT_RESOLVE_MARK, Chris@109: ACT_RETRY_MERGE, Chris@109: ACT_TAG, Chris@109: ACT_HG_IGNORE, Chris@109: }; Chris@109: Chris@109: struct HgAction Chris@109: { Chris@109: HGACTIONS action; Chris@109: QString workingDir; Chris@109: QStringList params; Chris@113: QString executable; // empty for normal Hg, but gets filled in by hgrunner Chris@109: Chris@109: HgAction() : action(ACT_NONE) { } Chris@109: Chris@109: HgAction(HGACTIONS _action, QString _wd, QStringList _params) : Chris@109: action(_action), workingDir(_wd), params(_params) { } Chris@109: Chris@109: bool operator==(const HgAction &a) { Chris@109: return (a.action == action && a.workingDir == workingDir && Chris@109: a.params == params && a.executable == executable); Chris@109: } Chris@109: Chris@115: bool shouldBeFast() const { Chris@115: switch (action) { Chris@115: case ACT_NONE: Chris@115: case ACT_QUERY_PATHS: Chris@115: case ACT_QUERY_BRANCH: Chris@115: case ACT_STAT: Chris@115: case ACT_QUERY_HEADS: Chris@115: case ACT_QUERY_PARENTS: Chris@115: case ACT_LOG_INCREMENTAL: Chris@115: return true; Chris@115: default: Chris@115: return false; Chris@115: } Chris@115: } Chris@115: Chris@109: bool mayBeInteractive() const { Chris@109: switch (action) { Chris@109: case ACT_INCOMING: Chris@109: case ACT_PUSH: Chris@109: case ACT_PULL: Chris@109: case ACT_CLONEFROMREMOTE: Chris@110: case ACT_FOLDERDIFF: Chris@110: case ACT_CHGSETDIFF: Chris@110: case ACT_SERVE: Chris@109: return true; Chris@109: default: Chris@109: return false; Chris@109: } Chris@109: } Chris@109: }; Chris@109: Chris@109: #endif