diff --git a/.install/linux/faceswap_setup_x64.sh b/.install/linux/faceswap_setup_x64.sh index cf9894a872..93ec68c144 100644 --- a/.install/linux/faceswap_setup_x64.sh +++ b/.install/linux/faceswap_setup_x64.sh @@ -368,7 +368,7 @@ clone_faceswap() { # Clone the faceswap repo delete_faceswap info "Downloading Faceswap..." - yellow ; git clone --depth 1 --no-single-branch "$DL_FACESWAP" "$DIR_FACESWAP" + yellow ; git clone --depth 1 --single-branch --branch r1.0 "$DL_FACESWAP" "$DIR_FACESWAP" } setup_faceswap() { diff --git a/.install/windows/install.nsi b/.install/windows/install.nsi index 8b146b2479..90bc1fac0b 100644 --- a/.install/windows/install.nsi +++ b/.install/windows/install.nsi @@ -21,7 +21,7 @@ InstallDir $PROFILE\faceswap # Install cli flags !define flagsConda "/S /RegisterPython=0 /AddToPath=0 /D=$PROFILE\MiniConda3" -!define flagsRepo "--depth 1 --no-single-branch ${wwwRepo}" +!define flagsRepo "--depth 1 --single-branch --branch r1.0 ${wwwRepo}" !define flagsEnv "-y python=3.7" # Folders diff --git a/lib/gui/menu.py b/lib/gui/menu.py index 61e336e9d5..a6a480f957 100644 --- a/lib/gui/menu.py +++ b/lib/gui/menu.py @@ -248,8 +248,6 @@ def build(self): self.add_command(label="Update Faceswap...", underline=0, command=lambda action="update": self.in_thread(action)) - if self._build_branches_menu(): - self.add_cascade(label="Switch Branch", underline=7, menu=self._branches_menu) self.add_separator() self._build_recources_menu() self.add_cascade(label="Resources", underline=0, menu=self.recources_menu) @@ -259,105 +257,6 @@ def build(self): command=lambda action="output_sysinfo": self.in_thread(action)) logger.debug("Built help menu") - def _build_branches_menu(self): - """ Build branch selection menu. - - Queries git for available branches and builds a menu based on output. - - Returns - ------- - bool - ``True`` if menu was successfully built otherwise ``False`` - """ - stdout = self._get_branches() - if stdout is None: - return False - - branches = self._filter_branches(stdout) - if not branches: - return False - - for branch in branches: - self._branches_menu.add_command( - label=branch, - command=lambda b=branch: self._switch_branch(b)) - return True - - @staticmethod - def _get_branches(): - """ Get the available github branches - - Returns - ------- - str - The list of branches available. If no branches were found or there was an - error then `None` is returned - """ - gitcmd = "git branch -a" - cmd = Popen(gitcmd, shell=True, stdout=PIPE, stderr=STDOUT, cwd=_WORKING_DIR) - stdout, _ = cmd.communicate() - retcode = cmd.poll() - if retcode != 0: - logger.debug("Unable to list git branches. return code: %s, message: %s", - retcode, stdout.decode().strip().replace("\n", " - ")) - return None - return stdout.decode(locale.getpreferredencoding()) - - @staticmethod - def _filter_branches(stdout): - """ Filter the branches, remove duplicates and the current branch and return a sorted - list. - - Parameters - ---------- - stdout: str - The output from the git branch query converted to a string - - Returns - ------- - list - Unique list of available branches sorted in alphabetical order - """ - current = None - branches = set() - for line in stdout.splitlines(): - branch = line[line.rfind("/") + 1:] if "/" in line else line.strip() - if branch.startswith("*"): - branch = branch.replace("*", "").strip() - current = branch - continue - branches.add(branch) - logger.debug("Found branches: %s", branches) - if current in branches: - logger.debug("Removing current branch from output: %s", current) - branches.remove(current) - - branches = sorted(list(branches), key=str.casefold) - logger.debug("Final branches: %s", branches) - return branches - - @staticmethod - def _switch_branch(branch): - """ Change the currently checked out branch, and return a notification. - - Parameters - ---------- - str - The branch to switch to - """ - logger.info("Switching branch to '%s'...", branch) - gitcmd = "git checkout {}".format(branch) - cmd = Popen(gitcmd, shell=True, stdout=PIPE, stderr=STDOUT, cwd=_WORKING_DIR) - stdout, _ = cmd.communicate() - retcode = cmd.poll() - if retcode != 0: - logger.error("Unable to switch branch. return code: %s, message: %s", - retcode, stdout.decode().strip().replace("\n", " - ")) - return - logger.info("Succesfully switched to '%s'. You may want to check for updates to make sure " - "that you have the latest code.", branch) - logger.info("Please restart Faceswap to complete the switch.") - def _build_recources_menu(self): """ Build resources menu """ # pylint: disable=cell-var-from-loop @@ -402,6 +301,9 @@ def check(self): encoding = locale.getpreferredencoding() logger.debug("Encoding: %s", encoding) self.check_for_updates(encoding, check=True) + logger.info("NB: You are on release 1.0 of Faceswap, which is unlikely to receive further " + "updates. You can upgrade to the latest Faceswap by visiting " + "https://faceswap.dev") self.root.config(cursor="") def update(self): @@ -416,6 +318,9 @@ def update(self): update_deps.main(logger=logger) if success: logger.info("Please restart Faceswap to complete the update.") + logger.info("NB: You are on release 1.0 of Faceswap, which is unlikely to receive further " + "updates. You can upgrade to the latest Faceswap by visiting " + "https://faceswap.dev") self.root.config(cursor="") @staticmethod