Ejemplo n.º 1
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)
Ejemplo n.º 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(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)
Ejemplo n.º 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)
        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)