##// END OF EJS Templates
convert: simplify git.similarity parsing
Siddharth Agarwal -
r22511:b1ec65b3 default
parent child Browse files
Show More
@@ -94,10 +94,7 b' class convert_git(converter_source):'
94 if not os.path.exists(path + "/objects"):
94 if not os.path.exists(path + "/objects"):
95 raise NoRepo(_("%s does not look like a Git repository") % path)
95 raise NoRepo(_("%s does not look like a Git repository") % path)
96
96
97 try:
97 similarity = ui.configint('convert', 'git.similarity', default=0)
98 similarity = int(ui.config('convert', 'git.similarity') or 0)
99 except ValueError:
100 raise util.Abort('convert.git.similarity must be a number')
101 if similarity < 0 or similarity > 100:
98 if similarity < 0 or similarity > 100:
102 raise util.Abort(_('similarity must be between 0 and 100'))
99 raise util.Abort(_('similarity must be between 0 and 100'))
103 if similarity > 0:
100 if similarity > 0:
@@ -256,7 +256,7 b' since bar is not touched in this commit,'
256
256
257 input validation
257 input validation
258 $ hg convert --config convert.git.similarity=foo --datesort git-repo2 fullrepo
258 $ hg convert --config convert.git.similarity=foo --datesort git-repo2 fullrepo
259 abort: convert.git.similarity must be a number
259 abort: convert.git.similarity is not an integer ('foo')
260 [255]
260 [255]
261 $ hg convert --config convert.git.similarity=-1 --datesort git-repo2 fullrepo
261 $ hg convert --config convert.git.similarity=-1 --datesort git-repo2 fullrepo
262 abort: similarity must be between 0 and 100
262 abort: similarity must be between 0 and 100
General Comments 0
You need to be logged in to leave comments. Login now