From 9dd22f489261cd37d10bbf3f126c57620f06974c Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 6 Mar 2017 15:54:18 +0200 Subject: snapshot --- 000.yarn | 42 ++++++++++++++++++++++++++++++++++++++++++ yarnhelper.py | 4 ++++ 2 files changed, 46 insertions(+) diff --git a/000.yarn b/000.yarn index a313ae7..c052681 100644 --- a/000.yarn +++ b/000.yarn @@ -144,6 +144,23 @@ Ian makes a bug fix in Qvarn THEN ian can push qvarn FINALLY admin removes things that were created +Ian force-pushes a change +----------------------------------------------------------------------------- + + SCENARIO Ian can force-push a change in Qvarn + WHEN admin creates user ian + AND admin creates group qvarndevs + AND admin adds ian to qvarndevs + AND admin creates repository qvarn + AND admin sets qvarn config writers to qvarndevs + THEN ian can clone qvarn + WHEN ian creates qvarn branch bugfix + AND ian changes qvarn branch bugfix + THEN ian can push qvarn + WHEN ian amends the latest commit in qvarn branch bugfix + THEN ian can force push qvarn + FINALLY admin removes things that were created + Steven can see Qvarn, but not push changes ----------------------------------------------------------------------------- @@ -383,6 +400,19 @@ WHEN a user changes a branch locally cliapp.runcmd(['git', 'add', 'foo.txt'], cwd=dirname) cliapp.runcmd(['git', 'commit', '-mfoo'], cwd=dirname) +WHEN a user amends a commit +----------------------------------------------------------------------------- + + IMPLEMENTS WHEN (\S+) amends the latest commit in (\S+) branch (\S+) + user = helper.get_next_match() + repo = helper.get_next_match() + branch = helper.get_next_match() + dirname = helper.local_checkout_dirname(user, repo) + with open(os.path.join(dirname, 'foo.txt'), 'a') as f: + f.write('foo\n') + cliapp.runcmd(['git', 'checkout', branch], cwd=dirname) + cliapp.runcmd(['git', 'commit', '--amend', '-mamended commit'], cwd=dirname) + THEN a user can push all local branches ----------------------------------------------------------------------------- @@ -393,6 +423,18 @@ THEN a user can push all local branches dirname = helper.local_checkout_dirname(user, repo) helper.git_as_checked(user, ['push', '--all', 'origin'], cwd=dirname) + +THEN a user can force push all local branches +----------------------------------------------------------------------------- + + IMPLEMENTS THEN (\S+) can force push (\S+) + user = helper.get_next_match() + repo = helper.get_next_match() + url = helper.repo_ssh_url(repo) + dirname = helper.local_checkout_dirname(user, repo) + helper.git_as_checked(user, ['push', '--force', '--all', 'origin'], cwd=dirname) + sys.exit(1) + THEN a user can push all local tags ----------------------------------------------------------------------------- diff --git a/yarnhelper.py b/yarnhelper.py index 4cd729a..5d232ea 100644 --- a/yarnhelper.py +++ b/yarnhelper.py @@ -155,6 +155,10 @@ class YarnHelper(object): server = os.environ['GITANO_SERVER'] env = dict(os.environ) env['GIT_SSH_COMMAND'] = self.env_ssh_command(user) + sys.stdout.write('env:\n') + for key in env: + sys.stdout.write(' {}={}\n'.format(key, env[key])) + sys.stdout.write('git args: {}\n'.format(args)) return cliapp.runcmd_unchecked( ['git'] + args, stderr=subprocess.STDOUT, -- cgit v1.2.1