+void GuiDocument::updateUnknownBranches()
+{
+ list<docstring> used_branches;
+ buffer().getUsedBranches(used_branches);
+ list<docstring>::const_iterator it = used_branches.begin();
+ QStringList unknown_branches;
+ for (; it != used_branches.end() ; ++it) {
+ if (!buffer().params().branchlist().find(*it))
+ unknown_branches.append(toqstr(*it));
+ }
+ branchesModule->setUnknownBranches(unknown_branches);
+}
+
+
+void GuiDocument::branchesRename(docstring const & oldname, docstring const & newname)
+{
+ map<docstring, docstring>::iterator it = changedBranches_.begin();
+ for (; it != changedBranches_.end() ; ++it) {
+ if (it->second == oldname) {
+ // branch has already been renamed
+ it->second = newname;
+ return;
+ }
+ }
+ // store new name
+ changedBranches_[oldname] = newname;
+}
+
+
+void GuiDocument::executeBranchRenaming() const
+{
+ map<docstring, docstring>::const_iterator it = changedBranches_.begin();
+ for (; it != changedBranches_.end() ; ++it) {
+ docstring const arg = '"' + it->first + '"' + " " + '"' + it->second + '"';
+ dispatch(FuncRequest(LFUN_BRANCHES_RENAME, arg));
+ }
+}
+
+