@@ -55,12 +55,12 @@
_inhibitmarkers(repo, [newnode])
return newnode
- # Wrapping this to inhibit obsolete revs resulting from a transaction
- extensions.wrapfunction(localrepo.localrepository,
- 'transaction', transactioncallback)
-
repo.__class__ = obsinhibitedrepo
repo._explicitaccess = set()
+ if not ui.configbool('inhibit', 'onlydirectaccess', False):
+ # Wrapping this to inhibit obsolete revs resulting from a transaction
+ extensions.wrapfunction(localrepo.localrepository,
+ 'transaction', transactioncallback)
def _update(orig, ui, repo, *args, **kwargs):
@@ -206,25 +206,26 @@
obs.discard(getrev(n))
return obs
obsolete.cachefuncs['obsolete'] = _computeobsoleteset
- # drop divergence computation since it is incompatible with "light revive"
- obsolete.cachefuncs['divergent'] = lambda repo: set()
- # drop bumped computation since it is incompatible with "light revive"
- obsolete.cachefuncs['bumped'] = lambda repo: set()
# wrap create marker to make it able to lift the inhibition
extensions.wrapfunction(obsolete, 'createmarkers', _createmarkers)
extensions.wrapfunction(repoview, '_getdynamicblockers', _accessvisible)
extensions.wrapfunction(revset, 'posttreebuilthook', _posttreebuilthook)
- # wrap update to make sure that no obsolete commit is visible after an
- # update
- extensions.wrapcommand(commands.table, 'update', _update)
- # There are two ways to save bookmark changes during a transation, we
- # wrap both to add inhibition markers.
- extensions.wrapfunction(bookmarks.bmstore, 'recordchange', _bookmarkchanged)
- extensions.wrapfunction(bookmarks.bmstore, 'write', _bookmarkchanged)
- # Add bookmark -D option
- entry = extensions.wrapcommand(commands.table, 'bookmark', _bookmark)
- entry[1].append(('D','prune',None,
- _('delete the bookmark and prune the commits underneath')))
+ if not ui.configbool('inhibit', 'onlydirectaccess', False):
+ # drop divergence computation since it is incompatible with "light revive"
+ obsolete.cachefuncs['divergent'] = lambda repo: set()
+ # drop bumped computation since it is incompatible with "light revive"
+ obsolete.cachefuncs['bumped'] = lambda repo: set()
+ # wrap update to make sure that no obsolete commit is visible after an
+ # update
+ extensions.wrapcommand(commands.table, 'update', _update)
+ # There are two ways to save bookmark changes during a transation, we
+ # wrap both to add inhibition markers.
+ extensions.wrapfunction(bookmarks.bmstore, 'recordchange', _bookmarkchanged)
+ extensions.wrapfunction(bookmarks.bmstore, 'write', _bookmarkchanged)
+ # Add bookmark -D option
+ entry = extensions.wrapcommand(commands.table, 'bookmark', _bookmark)
+ entry[1].append(('D','prune',None,
+ _('delete the bookmark and prune the commits underneath')))
@@ -489,7 +489,6 @@
o 0:54ccbc537fc2 add cA
Check that rebasing a commit twice makes the commit visible again
-
$ hg rebase -d 18 -r 16 --keep
rebasing 16:a438c045eb37 "add cN"
$ hg log -r 14:: -G
@@ -533,3 +532,36 @@
|
@ 14:d66ccb8c5871 add cL foo
|
+
+Only allow direct access and check that evolve works like before
+ $ cat >> $HGRCPATH <<EOF
+ > [inhibit]
+ > onlydirectaccess = True
+ > EOF
+
+ $ hg up 15
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ echo "CM" > cM
+ $ hg amend
+ 1 new unstable changesets
+ $ hg log -G
+ @ 21:721c3c279519 add cM
+ |
+ | o 16:a438c045eb37 add cN
+ | |
+ | x 15:2d66e189f5b5 add cM
+ |/
+ o 14:d66ccb8c5871 add cL
+ |
+ | o 9:55c73a90e4b4 add cJ
+ | |
+ o | 7:18214586bf78 add cJ
+ |/
+ o 6:cf5c4f4554ce add cH
+ |
+ o 5:5419eb264a33 add cG
+ |
+ o 4:98065434e5c6 add cE
+ |
+ o 0:54ccbc537fc2 add cA
+