Skip to content

Commit e9e5470

Browse files
committed
Merge branch 'develop'
Release kendall.0.4.3: * Bug fixes
2 parents 3944a45 + 785d9e1 commit e9e5470

File tree

5 files changed

+33
-19
lines changed

5 files changed

+33
-19
lines changed

RELEASE_NOTES.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ Gitless's Release Notes
22
=======================
33

44

5+
15th Jan 2014 - kendall.0.4.3
6+
-----------------------------
7+
8+
* Fixed bug that occured when trying to commit after a conflicted rebase/merge.
9+
* Fixed bug that caused error msgs when a commit fails to be incorrect.
10+
11+
512
15th Jan 2014 - kendall.0.4.2
613
-----------------------------
714

gitless/cli/commit_dialog.py

+15-10
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _show(files):
6161
pprint.sep(p=cf.write)
6262
cf.close()
6363
_launch_editor()
64-
return _extract_info()
64+
return _extract_info(5)
6565

6666

6767
def _show_merge(files):
@@ -79,8 +79,11 @@ def _show_merge(files):
7979
pprint.sep(p=cf.write)
8080
pprint.msg(
8181
'Please enter the commit message for your changes above. Lines starting '
82-
'with \'#\' will be ignored, and an empty message aborts the commit.',
82+
'with', p=cf.write)
83+
pprint.msg(
84+
'\'#\' will be ignored, and an empty message aborts the commit.',
8385
p=cf.write)
86+
pprint.blank(p=cf.write)
8487
pprint.msg(
8588
'These are the files that will be commited as part of the merge:',
8689
p=cf.write)
@@ -92,7 +95,7 @@ def _show_merge(files):
9295
pprint.sep(p=cf.write)
9396
cf.close()
9497
_launch_editor()
95-
return _extract_info()
98+
return _extract_info(5)
9699

97100

98101
def _show_rebase(files):
@@ -110,6 +113,7 @@ def _show_rebase(files):
110113
pprint.sep(p=cf.write)
111114
pprint.msg(
112115
'The commit will have the original commit message.', p=cf.write)
116+
pprint.blank(p=cf.write)
113117
pprint.msg(
114118
'These are the files that will be commited as part of the rebase:',
115119
p=cf.write)
@@ -121,7 +125,7 @@ def _show_rebase(files):
121125
pprint.sep(p=cf.write)
122126
cf.close()
123127
_launch_editor()
124-
return _extract_info()
128+
return _extract_info(4)
125129

126130

127131
def _launch_editor():
@@ -130,9 +134,13 @@ def _launch_editor():
130134
raise Exception('Call to editor %s failed' % editor)
131135

132136

133-
def _extract_info():
137+
def _extract_info(exp_lines):
134138
"""Extracts the commit msg and files to commit from the commit file.
135139
140+
Args:
141+
exp_lines: the amount of lines between the separator and when the actual
142+
file list begins.
143+
136144
Returns:
137145
A tuple (msg, files) where msg is the commit msg and files are the files to
138146
commit provided by the user in the editor.
@@ -146,11 +154,8 @@ def _extract_info():
146154
l = cf.readline()
147155
# We reached the separator, this marks the end of the commit msg.
148156
# We exhaust the following lines so that we get to the file list.
149-
cf.readline()
150-
cf.readline()
151-
cf.readline()
152-
cf.readline()
153-
cf.readline()
157+
for i in range(0, exp_lines):
158+
cf.readline()
154159

155160
files = []
156161
l = cf.readline()

gitless/cli/gl_commit.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ def _valid_input(only_files, exc_files, inc_files):
131131

132132
ret = True
133133
err = []
134-
only_files = [file_lib.status(fp) for fp in only_files]
135-
for f in only_files:
134+
for fp in only_files:
135+
f = file_lib.status(fp)
136136
if f == file_lib.FILE_NOT_FOUND:
137137
err.append('File %s doesn\'t exist' % fp)
138138
ret = False
@@ -141,8 +141,8 @@ def _valid_input(only_files, exc_files, inc_files):
141141
'File %s is a tracked file but has no modifications' % fp)
142142
ret = False
143143

144-
exc_files = [file_lib.status(fp) for fp in exc_files]
145-
for f in exc_files:
144+
for fp in exc_files:
145+
f = file_lib.status(fp)
146146
# We check that the files to be excluded are existing tracked files.
147147
if f == file_lib.FILE_NOT_FOUND:
148148
err.append('File %s doesn\'t exist' % fp)
@@ -161,8 +161,8 @@ def _valid_input(only_files, exc_files, inc_files):
161161
err.append('You can\'t exclude a file that has been resolved')
162162
ret = False
163163

164-
inc_files = [file_lib.status(fp) for fp in inc_files]
165-
for f in inc_files:
164+
for fp in inc_files:
165+
f = file_lib.status(fp)
166166
# We check that the files to be included are existing untracked files.
167167
if f == file_lib.FILE_NOT_FOUND:
168168
err.append('File %s doesn\'t exist' % fp)
@@ -210,7 +210,7 @@ def _compute_fs(only_files, exc_files, inc_files):
210210

211211
def _auto_track(files):
212212
"""Tracks those untracked files in the list."""
213-
files = [file_lib.status(fp) for fp in files]
214-
for f in files:
213+
for fp in files:
214+
f = file_lib.status(fp)
215215
if f.type == file_lib.UNTRACKED:
216216
file_lib.track(f.fp)

gitless/tests/test_e2e.py

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def __read_file(self, name):
6060
f.close()
6161
return ret
6262

63+
# TODO(sperezde): add dialog related tests.
64+
6365
def test_e2e(self):
6466
self.__success('init')
6567
self.__write_file('file1', 'Contents of file1')

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='gitless',
8-
version='0.4.2',
8+
version='0.4.3',
99
description='A version control system built on top of Git',
1010
long_description=open('README.md').read(),
1111
author='Santiago Perez De Rosso',

0 commit comments

Comments
 (0)