##// END OF EJS Templates
absorb: aborting if another operation is in progress...
Rodrigo Damazio Bovendorp -
r42297:537a8aeb default
parent child Browse files
Show More
@@ -0,0 +1,30 b''
1 $ cat >> $HGRCPATH << EOF
2 > [extensions]
3 > absorb=
4 > EOF
5
6 Abort absorb if there is an unfinished operation.
7
8 $ hg init abortunresolved
9 $ cd abortunresolved
10
11 $ echo "foo1" > foo.whole
12 $ hg commit -Aqm "foo 1"
13
14 $ hg update null
15 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
16 $ echo "foo2" > foo.whole
17 $ hg commit -Aqm "foo 2"
18
19 $ hg --config extensions.rebase= rebase -r 1 -d 0
20 rebasing 1:c3b6dc0e177a "foo 2" (tip)
21 merging foo.whole
22 warning: conflicts while merging foo.whole! (edit, then use 'hg resolve --mark')
23 unresolved conflicts (see hg resolve, then hg rebase --continue)
24 [1]
25
26 $ hg --config extensions.rebase= absorb
27 abort: rebase in progress
28 (use 'hg rebase --continue' or 'hg rebase --abort')
29 [255]
30
@@ -682,13 +682,12 b' class fixupstate(object):'
682 682
683 683 def commit(self):
684 684 """commit changes. update self.finalnode, self.replacemap"""
685 with self.repo.wlock(), self.repo.lock():
686 with self.repo.transaction('absorb') as tr:
687 self._commitstack()
688 self._movebookmarks(tr)
689 if self.repo['.'].node() in self.replacemap:
690 self._moveworkingdirectoryparent()
691 self._cleanupoldcommits()
685 with self.repo.transaction('absorb') as tr:
686 self._commitstack()
687 self._movebookmarks(tr)
688 if self.repo['.'].node() in self.replacemap:
689 self._moveworkingdirectoryparent()
690 self._cleanupoldcommits()
692 691 return self.finalnode
693 692
694 693 def printchunkstats(self):
@@ -1006,6 +1005,11 b' def absorbcmd(ui, repo, *pats, **opts):'
1006 1005 Returns 0 on success, 1 if all chunks were ignored and nothing amended.
1007 1006 """
1008 1007 opts = pycompat.byteskwargs(opts)
1009 state = absorb(ui, repo, pats=pats, opts=opts)
1010 if sum(s[0] for s in state.chunkstats.values()) == 0:
1011 return 1
1008
1009 with repo.wlock(), repo.lock():
1010 if not opts['dry_run']:
1011 cmdutil.checkunfinished(repo)
1012
1013 state = absorb(ui, repo, pats=pats, opts=opts)
1014 if sum(s[0] for s in state.chunkstats.values()) == 0:
1015 return 1
General Comments 0
You need to be logged in to leave comments. Login now