Пример #1
0
    def output(self):
        terminal.skip_escapes(not sys.stdout.isatty())
        terminal.set_stdout_encoding()
        previous_directory = os.getcwd()

        os.chdir(self.repo)
        absolute_path = basedir.get_basedir_git()
        os.chdir(absolute_path)

        procedure.remove_inspection_branches()
        procedure.create_branches_for_inspection()

        format.output_header()

        sorted_branches = procedure.sort_branches_by_last_update()

        for (commit, branch_name) in sorted_branches:
            if procedure.eligible_for_inspection(commit):
                if procedure.switch_to_branch(branch_name):
                    output = subprocess.Popen(self.command_line, shell=True, bufsize=1, stdout=subprocess.PIPE).stdout
                    print(output.read())
            else:
                print("\n\n ==> All eligible branches have been inspected!")
                break

        procedure.remove_inspection_branches()
        os.chdir(previous_directory)
Пример #2
0
	def output(self):
		if not self.localize_output:
			localization.disable()

		terminal.skip_escapes(not sys.stdout.isatty())
		terminal.set_stdout_encoding()
		previous_directory = os.getcwd()

		os.chdir(self.repo)
		absolute_path = basedir.get_basedir_git()
		os.chdir(absolute_path)
		format.output_header()
		outputable.output(changes.ChangesOutput(self.hard))

		if changes.get(self.hard).get_commits():
			outputable.output(blame.BlameOutput(changes.get(self.hard), self.hard, self.useweeks))

			if self.timeline:
				outputable.output(timeline.Timeline(changes.get(self.hard), self.useweeks))

			if self.include_metrics:
				outputable.output(metrics.Metrics())

			if self.responsibilities:
				outputable.output(responsibilities.ResponsibilitiesOutput(self.hard, self.useweeks))

			outputable.output(filtering.Filtering())

			if self.list_file_types:
				outputable.output(extensions.Extensions())

		format.output_footer()
		os.chdir(previous_directory)
Пример #3
0
	def output(self):
		if not self.localize_output:
			localization.disable()

		terminal.skip_escapes(not sys.stdout.isatty())
		terminal.set_stdout_encoding()
		previous_directory = os.getcwd()

		os.chdir(self.repo)
		absolute_path = basedir.get_basedir_git()
		os.chdir(absolute_path)
		format.output_header()
		outputable.output(changes.ChangesOutput(self.hard))

		if changes.get(self.hard).get_commits():
			outputable.output(blame.BlameOutput(self.hard, self.useweeks))

			if self.timeline:
				outputable.output(timeline.Timeline(changes.get(self.hard), self.useweeks))

			if self.include_metrics:
				outputable.output(metrics.Metrics())

			if self.responsibilities:
				outputable.output(responsibilities.ResponsibilitiesOutput(self.hard, self.useweeks))

			outputable.output(filtering.Filtering())

			if self.list_file_types:
				outputable.output(extensions.Extensions())

		format.output_footer()
		os.chdir(previous_directory)
Пример #4
0
    def output(self):
        if not self.localize_output:
            localization.disable()

        terminal.skip_escapes(not sys.stdout.isatty())
        terminal.set_stdout_encoding()
        previous_directory = os.getcwd()

        os.chdir(self.repo)
        isbare = subprocess.Popen("git rev-parse --is-bare-repository",
                                  shell=True,
                                  bufsize=1,
                                  stdout=subprocess.PIPE).stdout
        isbare = isbare.readlines()
        self.isbare = (isbare[0].decode("utf-8", "replace").strip() == "true")
        absolute_path = ""

        if self.isbare:
            absolute_path = subprocess.Popen("git rev-parse --git-dir",
                                             shell=True,
                                             bufsize=1,
                                             stdout=subprocess.PIPE).stdout
        else:
            absolute_path = subprocess.Popen("git rev-parse --show-toplevel",
                                             shell=True,
                                             bufsize=1,
                                             stdout=subprocess.PIPE).stdout

        absolute_path = absolute_path.readlines()
        if len(absolute_path) == 0:
            sys.exit(_("Unable to determine absolute path of git repository."))

        os.chdir(absolute_path[0].decode("utf-8", "replace").strip())
        format.output_header()
        outputable.output(changes.ChangesOutput(self.hard))

        if changes.get(self.hard).get_commits():
            outputable.output(blame.BlameOutput(self.hard))

            if self.timeline:
                outputable.output(
                    timeline.Timeline(changes.get(self.hard), self.useweeks))

            if self.include_metrics:
                outputable.output(metrics.Metrics())

            if self.responsibilities:
                outputable.output(
                    responsibilities.ResponsibilitiesOutput(self.hard))

            outputable.output(filtering.Filtering())

            if self.list_file_types:
                outputable.output(extensions.Extensions())

        format.output_footer()
        os.chdir(previous_directory)
	def output(self):
		if not self.localize_output:
			localization.disable()

		terminal.skip_escapes(not sys.stdout.isatty())
		terminal.set_stdout_encoding()
		previous_directory = os.getcwd()

		os.chdir(self.repo)
		isbare = subprocess.Popen("git rev-parse --is-bare-repository", shell=True, bufsize=1,
		                          stdout=subprocess.PIPE).stdout
		isbare = isbare.readlines()
		self.isbare = (isbare[0].decode("utf-8", "replace").strip() == "true")
		absolute_path = ""

		if self.isbare:
			absolute_path = subprocess.Popen("git rev-parse --git-dir", shell=True, bufsize=1,
			                                 stdout=subprocess.PIPE).stdout
		else:
			absolute_path = subprocess.Popen("git rev-parse --show-toplevel", shell=True, bufsize=1,
			                                 stdout=subprocess.PIPE).stdout

		absolute_path = absolute_path.readlines()
		if len(absolute_path) == 0:
			sys.exit(_("Unable to determine absolute path of git repository."))

		os.chdir(absolute_path[0].decode("utf-8", "replace").strip())
		format.output_header()
		outputable.output(changes.ChangesOutput(self.hard))

		if changes.get(self.hard).get_commits():
			outputable.output(blame.BlameOutput(self.hard))

			if self.timeline:
				outputable.output(timeline.Timeline(changes.get(self.hard), self.useweeks))

			if self.include_metrics:
				outputable.output(metrics.Metrics())

			if self.responsibilities:
				outputable.output(responsibilities.ResponsibilitiesOutput(self.hard))

			outputable.output(filtering.Filtering())

			if self.list_file_types:
				outputable.output(extensions.Extensions())

		format.output_footer()
		os.chdir(previous_directory)