src/main.cpp

changeset 9
98312f94dbdd
parent 8
6a2e20a4a8ff
child 11
127fb6a8f706
equal deleted inserted replaced
8:6a2e20a4a8ff 9:98312f94dbdd
52 "By default, the recursion \033[1mdepth\033[22m is one, meaning that this tool assumes that\n" 52 "By default, the recursion \033[1mdepth\033[22m is one, meaning that this tool assumes that\n"
53 "each \033[1mpath\033[22m is either a repository or contains repositories as subdirectories.\n" 53 "each \033[1mpath\033[22m is either a repository or contains repositories as subdirectories.\n"
54 "You can change the \033[1mdepth\033[22m to support other directory structures.\n\n" 54 "You can change the \033[1mdepth\033[22m to support other directory structures.\n\n"
55 "When you do not specify \033[1m--no-pull\033[22m, this tool will execute the pull command\n" 55 "When you do not specify \033[1m--no-pull\033[22m, this tool will execute the pull command\n"
56 "(and for hg the update command) before retrieving the commit log, assuming\n" 56 "(and for hg the update command) before retrieving the commit log, assuming\n"
57 "to be on the default branch with \033[4mno uncommitted changes\033[24m.\n\n" 57 "to be on the default branch with \033[4mno uncommitted changes\033[24m. If pulling leads to\n"
58 "an error, an error message is written to stderr and the process continues\n"
59 "with the repository in its current state. This is also the case when pulling\n"
60 "requires authorization.\n\n"
58 "Afterwards, this tool prints an HTML page to stdout. A separate heap map is\n" 61 "Afterwards, this tool prints an HTML page to stdout. A separate heap map is\n"
59 "generated for each author showing commits across all repositories, unless the\n" 62 "generated for each author showing commits across all repositories, unless the\n"
60 "\033[1m--separate\033[22m option is specified in which case each repository is displayed with\n" 63 "\033[1m--separate\033[22m option is specified in which case each repository is displayed with\n"
61 "its own heat map.\n" 64 "its own heat map.\n"
62 , stderr); 65 , stderr);
158 if (settings.update_repos) { 161 if (settings.update_repos) {
159 for (auto &&repo : repos.list()) { 162 for (auto &&repo : repos.list()) {
160 proc.chdir(repo.path); 163 proc.chdir(repo.path);
161 if (repo.type == fm::HG) { 164 if (repo.type == fm::HG) {
162 proc.setbin(settings.hg); 165 proc.setbin(settings.hg);
163 if (proc.exec({"pull"})) { 166 if (proc.exec({"pull", "-y"})) {
164 fprintf(stderr, "Pulling repo '%s' failed!\nMaybe there is no remote?\n", repo.path.c_str()); 167 fprintf(stderr, "Pulling repo '%s' failed!\nMaybe there is no remote?\n", repo.path.c_str());
165 } else if (proc.exec({"update"})) { 168 } else if (proc.exec({"update"})) {
166 fprintf(stderr, "Updating repo '%s' failed!\nMaybe there are local changes?\n", repo.path.c_str()); 169 fprintf(stderr, "Updating repo '%s' failed!\nMaybe there are local changes?\n", repo.path.c_str());
167 } 170 }
168 } else { 171 } else {
169 proc.setbin(settings.git); 172 proc.setbin(settings.git);
170 if (proc.exec({"pull"})) { 173 if (proc.exec({"pull", "-q"})) {
171 fprintf(stderr, "Pulling repo '%s' failed!\nMaybe there is no remote or there are local changes?\n", repo.path.c_str()); 174 fprintf(stderr, "Pulling repo '%s' failed!\nMaybe there is no remote or there are local changes?\n", repo.path.c_str());
172 } 175 }
173 } 176 }
174 } 177 }
175 } 178 }

mercurial