comparison mercurial/localrepo.py @ 26322:2cd19782d2d4

commit: remove a mutable default argument Mutable default arguments are know to the state of California to cause bugs.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 24 Sep 2015 00:56:18 -0700
parents db4c192cb9b3
children ed884807dc48
comparison
equal deleted inserted replaced
26321:db4c192cb9b3 26322:2cd19782d2d4
1376 1376
1377 return fparent1 1377 return fparent1
1378 1378
1379 @unfilteredmethod 1379 @unfilteredmethod
1380 def commit(self, text="", user=None, date=None, match=None, force=False, 1380 def commit(self, text="", user=None, date=None, match=None, force=False,
1381 editor=False, extra={}): 1381 editor=False, extra=None):
1382 """Add a new revision to current repository. 1382 """Add a new revision to current repository.
1383 1383
1384 Revision information is gathered from the working directory, 1384 Revision information is gathered from the working directory,
1385 match can be used to filter the committed files. If editor is 1385 match can be used to filter the committed files. If editor is
1386 supplied, it is called to get a commit message. 1386 supplied, it is called to get a commit message.
1387 """ 1387 """
1388 if extra is None:
1389 extra = {}
1388 1390
1389 def fail(f, msg): 1391 def fail(f, msg):
1390 raise util.Abort('%s: %s' % (f, msg)) 1392 raise util.Abort('%s: %s' % (f, msg))
1391 1393
1392 if not match: 1394 if not match: