##// END OF EJS Templates
transactions: don't show a backtrace when journal exists...
Matt Mackall -
r5865:e7127f66 default
parent child Browse files
Show More
@@ -0,0 +1,12 b''
1 #!/bin/bash
2
3 hg init
4 echo a > a
5 hg ci -Am0
6
7 touch .hg/store/journal
8
9 echo foo > a
10 hg ci -Am0
11
12 hg recover
@@ -0,0 +1,8 b''
1 adding a
2 abort: journal already exists - run hg recover!
3 rolling back interrupted transaction
4 checking changesets
5 checking manifests
6 crosschecking files in changesets and manifests
7 checking files
8 1 files, 1 changesets, 1 total revisions
@@ -519,6 +519,10 b' class localrepository(repo.repository):'
519 if self._transref and self._transref():
519 if self._transref and self._transref():
520 return self._transref().nest()
520 return self._transref().nest()
521
521
522 # abort here if the journal already exists
523 if os.path.exists(self.sjoin("journal")):
524 raise repo.RepoError(_("journal already exists - run hg recover"))
525
522 # save dirstate for rollback
526 # save dirstate for rollback
523 try:
527 try:
524 ds = self.opener("dirstate").read()
528 ds = self.opener("dirstate").read()
@@ -18,10 +18,6 b' class transaction(object):'
18 def __init__(self, report, opener, journal, after=None):
18 def __init__(self, report, opener, journal, after=None):
19 self.journal = None
19 self.journal = None
20
20
21 # abort here if the journal already exists
22 if os.path.exists(journal):
23 raise AssertionError(_("journal already exists - run hg recover"))
24
25 self.count = 1
21 self.count = 1
26 self.report = report
22 self.report = report
27 self.opener = opener
23 self.opener = opener
General Comments 0
You need to be logged in to leave comments. Login now