コード例 #1
0
ファイル: cmds_test.py プロジェクト: Acidburn0zzz/git-cola
    def test_Commit_strip_comments_unicode(self):
        """Ensure that unicode is preserved in stripped commit messages"""

        msg = unichr(0x1234) + '\n\n#comment\nbody'
        expect = unichr(0x1234) + '\n\nbody\n'
        actual = cmds.Commit.strip_comments(msg)
        self.assertEqual(expect, actual)
コード例 #2
0
ファイル: i18n_test.py プロジェクト: timhowes/git-cola
 def test_translates_noun(self):
     """Test that strings with @@noun are translated
     """
     i18n.install("ja_JP")
     expect = unichr(0x30B3) + unichr(0x30DF) + unichr(0x30C3) + unichr(0x30C8)
     actual = N_("Commit@@verb")
     self.assertEqual(expect, actual)
コード例 #3
0
ファイル: cmds_test.py プロジェクト: sbabrass/git-cola
    def test_Commit_strip_comments_unicode(self):
        """Ensure that unicode is preserved in stripped commit messages"""

        msg = unichr(0x1234) + '\n\n#comment\nbody'
        expect = unichr(0x1234) + '\n\nbody\n'
        actual = cmds.Commit.strip_comments(msg)
        self.assertEqual(expect, actual)
コード例 #4
0
ファイル: i18n_test.py プロジェクト: www3838438/git-cola
 def test_translates_noun(self):
     """Test that strings with @@noun are translated
     """
     i18n.install('ja_JP')
     expect = (unichr(0x30b3) + unichr(0x30df) + unichr(0x30c3) +
               unichr(0x30c8))
     actual = N_('Commit@@verb')
     self.assertEqual(expect, actual)
コード例 #5
0
ファイル: i18n_test.py プロジェクト: 007durgesh219/git-cola
 def test_translates_noun(self):
     """Test that strings with @@noun are translated
     """
     i18n.install('ja_JP')
     expect = (unichr(0x30b3) + unichr(0x30df) +
               unichr(0x30c3) + unichr(0x30c8))
     actual = N_('Commit@@verb')
     self.assertEqual(expect, actual)
コード例 #6
0
ファイル: main.py プロジェクト: kewelinho/git-cola
    def _update_callback(self):
        """Update the title with the current branch and directory name."""
        alerts = []
        branch = self.model.currentbranch
        curdir = core.getcwd()
        is_merging = self.model.is_merging
        is_rebasing = self.model.is_rebasing

        msg = N_('Repository: %s') % curdir
        msg += '\n'
        msg += N_('Branch: %s') % branch

        if is_rebasing:
            msg += '\n\n'
            msg += N_('This repository is currently being rebased.\n'
                      'Resolve conflicts, commit changes, and run:\n'
                      '    Rebase > Continue')
            alerts.append(N_('Rebasing'))

        elif is_merging:
            msg += '\n\n'
            msg += N_('This repository is in the middle of a merge.\n'
                      'Resolve conflicts and commit changes.')
            alerts.append(N_('Merging'))

        if self.mode == self.model.mode_amend:
            alerts.append(N_('Amending'))

        l = unichr(0xab)
        r = unichr(0xbb)
        title = ('%s: %s %s%s' % (
                    self.model.project,
                    branch,
                    alerts and ((r+' %s '+l+' ') % ', '.join(alerts)) or '',
                    self.model.git.worktree()))

        self.setWindowTitle(title)
        self.commitdockwidget.setToolTip(msg)
        self.commitmsgeditor.set_mode(self.mode)
        self.update_actions()

        if not self.model.amending():
            # Check if there's a message file in .git/
            merge_msg_path = gitcmds.merge_message_path()
            if merge_msg_path is None:
                return
            merge_msg_hash = utils.checksum(merge_msg_path)
            if merge_msg_hash == self.merge_message_hash:
                return
            self.merge_message_hash = merge_msg_hash
            cmds.do(cmds.LoadCommitMessageFromFile, merge_msg_path)
コード例 #7
0
    def _update_callback(self):
        """Update the title with the current branch and directory name."""
        alerts = []
        branch = self.model.currentbranch
        curdir = core.getcwd()
        is_merging = self.model.is_merging
        is_rebasing = self.model.is_rebasing

        msg = N_('Repository: %s') % curdir
        msg += '\n'
        msg += N_('Branch: %s') % branch

        if is_rebasing:
            msg += '\n\n'
            msg += N_('This repository is currently being rebased.\n'
                      'Resolve conflicts, commit changes, and run:\n'
                      '    Rebase > Continue')
            alerts.append(N_('Rebasing'))

        elif is_merging:
            msg += '\n\n'
            msg += N_('This repository is in the middle of a merge.\n'
                      'Resolve conflicts and commit changes.')
            alerts.append(N_('Merging'))

        if self.mode == self.model.mode_amend:
            alerts.append(N_('Amending'))

        l = unichr(0xab)
        r = unichr(0xbb)
        title = ('%s: %s %s%s' % (
                    self.model.project,
                    branch,
                    alerts and ((r+' %s '+l+' ') % ', '.join(alerts)) or '',
                    self.model.git.worktree()))

        self.setWindowTitle(title)
        self.commitdockwidget.setToolTip(msg)
        self.commitmsgeditor.set_mode(self.mode)
        self.update_actions()

        if not self.model.amending():
            # Check if there's a message file in .git/
            merge_msg_path = gitcmds.merge_message_path()
            if merge_msg_path is None:
                return
            merge_msg_hash = utils.checksum(merge_msg_path)
            if merge_msg_hash == self.merge_message_hash:
                return
            self.merge_message_hash = merge_msg_hash
            cmds.do(cmds.LoadCommitMessageFromFile, merge_msg_path)
コード例 #8
0
ファイル: main.py プロジェクト: wmwong/git-cola
 def build_recent_menu(self):
     recent = settings.Settings().recent
     cmd = cmds.OpenRepo
     menu = self.open_recent_menu
     menu.clear()
     for r in recent:
         name = os.path.basename(r)
         directory = os.path.dirname(r)
         text = '%s %s %s' % (name, unichr(0x2192), directory)
         menu.addAction(text, cmds.run(cmd, r))
コード例 #9
0
ファイル: main.py プロジェクト: jaiqc/git-cola
    def _update_callback(self):
        """Update the title with the current branch and directory name."""
        alerts = []
        branch = self.model.currentbranch
        curdir = core.getcwd()
        is_merging = self.model.is_merging
        is_rebasing = self.model.is_rebasing

        msg = N_("Repository: %s") % curdir
        msg += "\n"
        msg += N_("Branch: %s") % branch

        if is_rebasing:
            msg += "\n\n"
            msg += N_(
                "This repository is currently being rebased.\n"
                "Resolve conflicts, commit changes, and run:\n"
                "    Rebase > Continue"
            )
            alerts.append(N_("Rebasing"))

        elif is_merging:
            msg += "\n\n"
            msg += N_("This repository is in the middle of a merge.\n" "Resolve conflicts and commit changes.")
            alerts.append(N_("Merging"))

        if self.mode == self.model.mode_amend:
            alerts.append(N_("Amending"))

        l = unichr(0xAB)
        r = unichr(0xBB)
        title = "%s: %s %s%s" % (
            self.model.project,
            branch,
            alerts and ((r + " %s " + l + " ") % ", ".join(alerts)) or "",
            self.model.git.worktree(),
        )

        self.setWindowTitle(title)
        self.commitdockwidget.setToolTip(msg)
        self.commitmsgeditor.set_mode(self.mode)
        self.update_actions()
コード例 #10
0
ファイル: main.py プロジェクト: TommyCTantrum/git-cola
    def _update_callback(self):
        """Update the title with the current branch and directory name."""
        alerts = []
        branch = self.model.currentbranch
        curdir = core.getcwd()
        is_merging = self.model.is_merging
        is_rebasing = self.model.is_rebasing

        msg = N_('Repository: %s') % curdir
        msg += '\n'
        msg += N_('Branch: %s') % branch

        if is_rebasing:
            msg += '\n\n'
            msg += N_('This repository is currently being rebased.\n'
                      'Resolve conflicts, commit changes, and run:\n'
                      '    Rebase > Continue')
            alerts.append(N_('Rebasing'))

        elif is_merging:
            msg += '\n\n'
            msg += N_('This repository is in the middle of a merge.\n'
                      'Resolve conflicts and commit changes.')
            alerts.append(N_('Merging'))

        if self.mode == self.model.mode_amend:
            alerts.append(N_('Amending'))

        l = unichr(0xab)
        r = unichr(0xbb)
        title = ('%s: %s %s%s' % (
                    self.model.project,
                    branch,
                    alerts and ((r+' %s '+l+' ') % ', '.join(alerts)) or '',
                    self.model.git.worktree()))

        self.setWindowTitle(title)
        self.commitdockwidget.setToolTip(msg)
        self.commitmsgeditor.set_mode(self.mode)
        self.update_actions()
コード例 #11
0
ファイル: main.py プロジェクト: Jobava/git-cola
    def _update_callback(self):
        """Update the title with the current branch and directory name."""
        alerts = []
        branch = self.model.currentbranch
        curdir = core.getcwd()
        is_merging = self.model.is_merging
        is_rebasing = self.model.is_rebasing

        msg = N_('Repository: %s') % curdir
        msg += '\n'
        msg += N_('Branch: %s') % branch

        if is_rebasing:
            msg += '\n\n'
            msg += N_('This repository is currently being rebased.\n'
                      'Resolve conflicts, commit changes, and run:\n'
                      '    Rebase > Continue')
            alerts.append(N_('Rebasing'))

        elif is_merging:
            msg += '\n\n'
            msg += N_('This repository is in the middle of a merge.\n'
                      'Resolve conflicts and commit changes.')
            alerts.append(N_('Merging'))

        if self.mode == self.model.mode_amend:
            alerts.append(N_('Amending'))

        l = unichr(0xab)
        r = unichr(0xbb)
        title = ('%s: %s %s%s' % (
                    self.model.project,
                    branch,
                    alerts and ((r+' %s '+l+' ') % ', '.join(alerts)) or '',
                    self.model.git.worktree()))

        self.setWindowTitle(title)
        self.commitdockwidget.setToolTip(msg)
        self.commitmsgeditor.set_mode(self.mode)
        self.update_actions()