Title: [288967] trunk/Tools
Revision
288967
Author
[email protected]
Date
2022-02-02 10:46:06 -0800 (Wed, 02 Feb 2022)

Log Message

[git-webkit] Improve user prompts (Part 3)
https://bugs.webkit.org/show_bug.cgi?id=235655
<rdar://problem/88082697>

Reviewed by Aakash Jain and Dewei Zhu.

* Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Scripts/libraries/webkitscmpy/webkitscmpy/program/setup.py:
(Setup.git): Make it clear to users that configurations are being set only
on the local repository.
* Scripts/libraries/webkitscmpy/webkitscmpy/test/setup_unittest.py:

Canonical link: https://commits.webkit.org/246696@main

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (288966 => 288967)


--- trunk/Tools/ChangeLog	2022-02-02 18:46:01 UTC (rev 288966)
+++ trunk/Tools/ChangeLog	2022-02-02 18:46:06 UTC (rev 288967)
@@ -1,5 +1,20 @@
 2022-01-26  Jonathan Bedard  <[email protected]>
 
+        [git-webkit] Improve user prompts (Part 3)
+        https://bugs.webkit.org/show_bug.cgi?id=235655
+        <rdar://problem/88082697>
+
+        Reviewed by Aakash Jain and Dewei Zhu.
+
+        * Scripts/libraries/webkitscmpy/setup.py: Bump version.
+        * Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
+        * Scripts/libraries/webkitscmpy/webkitscmpy/program/setup.py:
+        (Setup.git): Make it clear to users that configurations are being set only
+        on the local repository.
+        * Scripts/libraries/webkitscmpy/webkitscmpy/test/setup_unittest.py:
+
+2022-01-26  Jonathan Bedard  <[email protected]>
+
         [git-webkit] Improve user prompts (Part 2)
         https://bugs.webkit.org/show_bug.cgi?id=235655
         <rdar://problem/88082697>

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/setup.py (288966 => 288967)


--- trunk/Tools/Scripts/libraries/webkitscmpy/setup.py	2022-02-02 18:46:01 UTC (rev 288966)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/setup.py	2022-02-02 18:46:06 UTC (rev 288967)
@@ -29,7 +29,7 @@
 
 setup(
     name='webkitscmpy',
-    version='3.1.5',
+    version='3.1.6',
     description='Library designed to interact with git and svn repositories.',
     long_description=readme(),
     classifiers=[

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py (288966 => 288967)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py	2022-02-02 18:46:01 UTC (rev 288966)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py	2022-02-02 18:46:06 UTC (rev 288967)
@@ -46,7 +46,7 @@
         "Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`"
     )
 
-version = Version(3, 1, 5)
+version = Version(3, 1, 6)
 
 AutoInstall.register(Package('fasteners', Version(0, 15, 0)))
 AutoInstall.register(Package('jinja2', Version(2, 11, 3)))

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/setup.py (288966 => 288967)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/setup.py	2022-02-02 18:46:01 UTC (rev 288966)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/setup.py	2022-02-02 18:46:06 UTC (rev 288967)
@@ -1,4 +1,4 @@
-# Copyright (C) 2021 Apple Inc. All rights reserved.
+# Copyright (C) 2021, 2022 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -86,18 +86,18 @@
         email = os.environ.get('EMAIL_ADDRESS') or global_config.get('user.email')
         log.info('Setting git user email for {}...'.format(repository.root_path))
         if not email or args.defaults is False or (not args.defaults and Terminal.choose(
-            "Set '{}' as the git user email".format(email),
+            "Set '{}' as the git user email for this repository".format(email),
             default='Yes',
         ) == 'No'):
-            email = Terminal.input('Git user email: ')
+            email = Terminal.input('Enter git user email for this repository: ')
 
         if run(
             [local.Git.executable(), 'config', 'user.email', email], capture_output=True, cwd=repository.root_path,
         ).returncode:
-            sys.stderr.write('Failed to set the git user email to {}\n'.format(email))
+            sys.stderr.write('Failed to set the git user email to {} for this repository\n'.format(email))
             result += 1
         else:
-            log.info("Set git user email to '{}'".format(email))
+            log.info("Set git user email to '{}' for this repository".format(email))
 
         name = repository.contributors.get(email)
         if name:
@@ -106,19 +106,19 @@
             name = global_config.get('user.name')
         log.info('Setting git user name for {}...'.format(repository.root_path))
         if not name or args.defaults is False or (not args.defaults and Terminal.choose(
-            "Set '{}' as the git user name".format(name),
+            "Set '{}' as the git user name for this repository".format(name),
             default='Yes',
         ) == 'No'):
-            name = Terminal.input('Git user name: ')
+            name = Terminal.input('Enter git user name for this repository: ')
         if run(
             [local.Git.executable(), 'config', 'user.name', name], capture_output=True, cwd=repository.root_path,
         ).returncode:
-            sys.stderr.write('Failed to set the git user name to {}\n'.format(name))
+            sys.stderr.write('Failed to set the git user name to {} for this repository\n'.format(name))
             result += 1
         else:
-            log.info("Set git user name to '{}'".format(name))
+            log.info("Set git user name to '{}' for this repository".format(name))
 
-        log.info('Setting better Objective-C diffing behavior...')
+        log.info('Setting better Objective-C diffing behavior for this repository...')
         result += run(
             [local.Git.executable(), 'config', 'diff.objcpp.xfuncname', '^[-+@a-zA-Z_].*$'],
             capture_output=True, cwd=repository.root_path,
@@ -127,10 +127,10 @@
             [local.Git.executable(), 'config', 'diff.objcppheader.xfuncname', '^[@a-zA-Z_].*$'],
             capture_output=True, cwd=repository.root_path,
         ).returncode
-        log.info('Set better Objective-C diffing behavior!')
+        log.info('Set better Objective-C diffing behavior for this repository!')
 
         if args.defaults or Terminal.choose(
-            'Auto-color status, diff, and branch?',
+            'Auto-color status, diff, and branch for this repository?',
             default='Yes',
         ) == 'Yes':
             for command in ('status', 'diff', 'branch'):
@@ -139,12 +139,12 @@
                     capture_output=True, cwd=repository.root_path,
                 ).returncode
 
-        log.info('Using {} merge strategy'.format('merge commits as a' if args.merge else 'a rebase'))
+        log.info('Using {} merge strategy for this repository'.format('merge commits as a' if args.merge else 'a rebase'))
         if run(
             [local.Git.executable(), 'config', 'pull.rebase', 'false' if args.merge else 'true'],
             capture_output=True, cwd=repository.root_path,
         ).returncode:
-            sys.stderr.write('Failed to use {} as the merge strategy\n'.format('merge commits' if args.merge else 'rebase'))
+            sys.stderr.write('Failed to use {} as the merge strategy for this repository\n'.format('merge commits' if args.merge else 'rebase'))
             result += 1
 
         if hooks:
@@ -152,7 +152,7 @@
                 source_path = os.path.join(hooks, hook)
                 if not os.path.isfile(source_path):
                     continue
-                log.info('Configuring and copying hook {}'.format(source_path))
+                log.info('Configuring and copying hook {} for this repository'.format(source_path))
                 with open(source_path, 'r') as f:
                     from jinja2 import Template
                     contents = Template(f.read()).render(
@@ -171,22 +171,22 @@
 
         log.info('Setting git editor for {}...'.format(repository.root_path))
         editor_name = 'default' if args.defaults else Terminal.choose(
-            'Pick a commit message editor',
+            'Pick a commit message editor for this repository',
             options=['default'] + [program.name for program in Editor.programs()],
             default='default',
             numbered=True,
         )
         if editor_name == 'default':
-            log.info('Using the default git editor')
+            log.info('Using the default git editor for this repository')
         elif run(
             [local.Git.executable(), 'config', 'core.editor', ' '.join([arg.replace(' ', '\\ ') for arg in Editor.by_name(editor_name).wait])],
             capture_output=True,
             cwd=repository.root_path,
         ).returncode:
-            sys.stderr.write('Failed to set the git editor to {}\n'.format(editor_name))
+            sys.stderr.write('Failed to set the git editor to {} for this repository\n'.format(editor_name))
             result += 1
         else:
-            log.info("Set git editor to '{}'".format(editor_name))
+            log.info("Set git editor to '{}' for this repository".format(editor_name))
 
         # Pushing to http repositories is difficult, offer to change http checkouts to ssh
         http_remote = local.Git.HTTP_REMOTE.match(repository.url())

Modified: trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/setup_unittest.py (288966 => 288967)


--- trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/setup_unittest.py	2022-02-02 18:46:01 UTC (rev 288966)
+++ trunk/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/setup_unittest.py	2022-02-02 18:46:06 UTC (rev 288967)
@@ -1,4 +1,4 @@
-# Copyright (C) 2021 Apple Inc. All rights reserved.
+# Copyright (C) 2021, 2022 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -85,18 +85,19 @@
         self.assertEqual(
             captured.root.log.getvalue(),
             '''Setting git user email for {repository}...
-Set git user email to '[email protected]'
+Set git user email to '[email protected]' for this repository
 Setting git user name for {repository}...
-Set git user name to 'Tim Apple'
-Setting better Objective-C diffing behavior...
-Set better Objective-C diffing behavior!
-Using a rebase merge strategy
+Set git user name to 'Tim Apple' for this repository
+Setting better Objective-C diffing behavior for this repository...
+Set better Objective-C diffing behavior for this repository!
+Using a rebase merge strategy for this repository
 Setting git editor for {repository}...
-Using the default git editor
+Using the default git editor for this repository
 '''.format(repository=self.path),
         )
 
     def test_github_checkout(self):
+        self.maxDiff = None
         with OutputCapture(level=logging.INFO) as captured, mocks.remote.GitHub() as remote, \
             MockTerminal.input('n', '[email protected]', 'n', 'Committer', 'n', '1', 'y', 'y'), \
             mocks.local.Git(self.path, remote='https://{}.git'.format(remote.remote)) as repo, \
@@ -118,12 +119,12 @@
         programs = ['default'] + [p.name for p in Editor.programs()]
         self.assertEqual(
             captured.stdout.getvalue(),
-            '''Set '[email protected]' as the git user email ([Yes]/No): 
-Git user email: 
-Set 'Tim Apple' as the git user name ([Yes]/No): 
-Git user name: 
-Auto-color status, diff, and branch? ([Yes]/No): 
-Pick a commit message editor:
+            '''Set '[email protected]' as the git user email for this repository ([Yes]/No): 
+Enter git user email for this repository: 
+Set 'Tim Apple' as the git user name for this repository ([Yes]/No): 
+Enter git user name for this repository: 
+Auto-color status, diff, and branch for this repository? ([Yes]/No): 
+Pick a commit message editor for this repository:
     {}
 : 
 http(s) based remotes will prompt for your password every time when pushing,
@@ -139,14 +140,14 @@
         self.assertEqual(
             captured.root.log.getvalue(),
             '''Setting git user email for {repository}...
-Set git user email to '[email protected]'
+Set git user email to '[email protected]' for this repository
 Setting git user name for {repository}...
-Set git user name to 'Committer'
-Setting better Objective-C diffing behavior...
-Set better Objective-C diffing behavior!
-Using a rebase merge strategy
+Set git user name to 'Committer' for this repository
+Setting better Objective-C diffing behavior for this repository...
+Set better Objective-C diffing behavior for this repository!
+Using a rebase merge strategy for this repository
 Setting git editor for {repository}...
-Using the default git editor
+Using the default git editor for this repository
 Saving GitHub credentials in system credential store...
 GitHub credentials saved via Keyring!
 Verifying user owned fork...
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to