diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -178,7 +178,7 @@ def commit(ui, repo, *files, **opts): try: text = open(opts['logfile']).read() except IOError: pass - repo.commit(relpath(repo, files), text) + repo.commit(relpath(repo, files), text, opts['user'], opts['date']) def debugaddchangegroup(ui, repo): data = sys.stdin.read() @@ -524,7 +524,9 @@ table = { "cat|dump": (cat, [], 'hg cat [rev]'), "commit|ci": (commit, [('t', 'text', "", 'commit text'), - ('l', 'logfile', "", 'commit text file')], + ('l', 'logfile', "", 'commit text file'), + ('d', 'date', "", 'data'), + ('u', 'user', "", 'user')], 'hg commit [files]'), "debugaddchangegroup": (debugaddchangegroup, [], 'debugaddchangegroup'), "debugchangegroup": (debugchangegroup, [], 'debugchangegroup [roots]'), diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -462,7 +462,7 @@ class localrepository: n = self.changelog.add(mnode, files, text, tr, p1, p2, user, date) tr.close() - def commit(self, files = None, text = ""): + def commit(self, files = None, text = "", user = None, date = None): commit = [] remove = [] if files: @@ -529,7 +529,7 @@ class localrepository: return 1 text = edittext - n = self.changelog.add(mn, new, text, tr, p1, p2) + n = self.changelog.add(mn, new, text, tr, p1, p2, user, date) tr.close() self.dirstate.setparents(n) diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py --- a/mercurial/mdiff.py +++ b/mercurial/mdiff.py @@ -67,7 +67,11 @@ def diff(a, b, sorted=0): for i in a: p.append(p[-1] + len(i)) if sorted: - d = sortdiff(a, b) + try: + d = sortdiff(a, b) + except: + print a, b + raise else: d = difflib.SequenceMatcher(None, a, b).get_matching_blocks() la = 0