Mercurial > hg
annotate hgext/bookflow.py @ 47866:4162f6b40f2c stable
windows: degrade to py2 behavior when reading a non-symlink as a symlink
While waiting for the push to hg-committed in WSL to complete, I ran a
`phabimport` from Windows and got this traceback:
$ hg phabimport 11313
** Unknown exception encountered with possibly-broken third-party extension "mercurial_keyring" (version N/A)
** which supports versions unknown of Mercurial.
** Please disable "mercurial_keyring" and try your action again.
** If that fixes the bug please report it to https://foss.heptapod.net/mercurial/mercurial_keyring/issues
** Python 3.9.5 (default, May 6 2021, 17:29:31) [MSC v.1928 64 bit (AMD64)]
** Mercurial Distributed SCM (version 5.9rc1+hg32.0e2f5733563d)
** Extensions loaded: absorb, blackbox, evolve 10.3.3, extdiff, fastannotate, fix, mercurial_keyring, mq, phabblocker 20210126, phabricator, rebase, show, strip, topic 0.22.3
Traceback (most recent call last):
File "mercurial.lock", line 279, in _trylock
File "mercurial.vfs", line 202, in makelock
File "mercurial.util", line 2147, in makelock
FileExistsError: [WinError 183] Cannot create a file when that file already exists: b'hp-omen:78348' -> b'C:\\Users\\Matt\\hg/.hg/store/lock'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 24, in <module>
File "mercurial.dispatch", line 144, in run
File "mercurial.dispatch", line 250, in dispatch
File "mercurial.dispatch", line 294, in _rundispatch
File "mercurial.dispatch", line 470, in _runcatch
File "mercurial.dispatch", line 480, in _callcatch
File "mercurial.scmutil", line 153, in callcatch
File "mercurial.dispatch", line 460, in _runcatchfunc
File "mercurial.dispatch", line 1273, in _dispatch
File "mercurial.dispatch", line 918, in runcommand
File "mercurial.dispatch", line 1285, in _runcommand
File "mercurial.dispatch", line 1271, in <lambda>
File "mercurial.util", line 1886, in check
File "mercurial.util", line 1886, in check
File "hgext.mq", line 4239, in mqcommand
File "mercurial.util", line 1886, in check
File "mercurial.util", line 1886, in check
File "hgext.phabricator", line 314, in inner
File "hgext.phabricator", line 2222, in phabimport
File "hgext.phabricator", line 2123, in readpatch
File "hgext.phabricator", line 2199, in _write
File "mercurial.localrepo", line 2956, in lock
File "mercurial.localrepo", line 2918, in _lock
File "mercurial.lock", line 152, in trylock
File "mercurial.lock", line 283, in _trylock
File "mercurial.lock", line 314, in _readlock
File "mercurial.vfs", line 221, in readlock
File "mercurial.util", line 2163, in readlock
File "mercurial.windows", line 619, in readlink
ValueError: not a symbolic link
Both exceptions look accurate (the file exists, and the Windows side can't read
WSL side symlinks). I didn't try to reproduce this entirely within the Windows
side, but we can do better than a cryptic stacktrace. With this change, the
same scenario results in this abort:
abort: C:\Users\Matt\hg/.hg/store/lock: The file cannot be accessed by the system
When both the `push` and `phabimport` are done on the Windows side, it prints a
message about waiting for the lock, and successfully applies the patch after the
push completes.
I'm not sure if there's enough info to be able to convert the abort into the
wait scenario. As it stands now, we don't support symlinks on Windows, which
requires either a UAC Administrator level process or an opt-in in developer
mode, and there are several places where the new symlink on Windows support in
py3 was explicitly disabled in order to get tests to pass quicker.
Differential Revision: https://phab.mercurial-scm.org/D11333
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 22 Aug 2021 17:59:21 -0400 |
parents | 9f70512ae2cf |
children | 6000f5b25c9b |
rev | line source |
---|---|
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
1 """implements bookmark-based branching (EXPERIMENTAL) |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
2 |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
3 - Disables creation of new branches (config: enable_branches=False). |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
4 - Requires an active bookmark on commit (config: require_bookmark=True). |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
5 - Doesn't move the active bookmark on update, only on commit. |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
6 - Requires '--rev' for moving an existing bookmark. |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
7 - Protects special bookmarks (config: protect=@). |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
8 |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
9 flow related commands |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
10 |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
11 :hg book NAME: create a new bookmark |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
12 :hg book NAME -r REV: move bookmark to revision (fast-forward) |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
13 :hg up|co NAME: switch to bookmark |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
14 :hg push -B .: push active bookmark |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
15 """ |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
16 from __future__ import absolute_import |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
17 |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
18 from mercurial.i18n import _ |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
19 from mercurial import ( |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
20 bookmarks, |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
21 commands, |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
22 error, |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
23 extensions, |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
24 registrar, |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
25 ) |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
26 |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
27 MY_NAME = b'bookflow' |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
28 |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
29 configtable = {} |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
30 configitem = registrar.configitem(configtable) |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
31 |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
32 configitem(MY_NAME, b'protect', [b'@']) |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
33 configitem(MY_NAME, b'require-bookmark', True) |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
34 configitem(MY_NAME, b'enable-branches', False) |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
35 |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
36 cmdtable = {} |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
37 command = registrar.command(cmdtable) |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
38 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
39 |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
40 def commit_hook(ui, repo, **kwargs): |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
41 active = repo._bookmarks.active |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
42 if active: |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
43 if active in ui.configlist(MY_NAME, b'protect'): |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
44 raise error.Abort( |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
45 _(b'cannot commit, bookmark %s is protected') % active |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
46 ) |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
47 if not cwd_at_bookmark(repo, active): |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
48 raise error.Abort( |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
49 _( |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
50 b'cannot commit, working directory out of sync with active bookmark' |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
51 ), |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
52 hint=_(b"run 'hg up %s'") % active, |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
53 ) |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
54 elif ui.configbool(MY_NAME, b'require-bookmark', True): |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
55 raise error.Abort(_(b'cannot commit without an active bookmark')) |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
56 return 0 |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
57 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
58 |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
59 def bookmarks_update(orig, repo, parents, node): |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
60 if len(parents) == 2: |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
61 # called during commit |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
62 return orig(repo, parents, node) |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
63 else: |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
64 # called during update |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
65 return False |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
66 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
67 |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
68 def bookmarks_addbookmarks( |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
69 orig, repo, tr, names, rev=None, force=False, inactive=False |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
70 ): |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
71 if not rev: |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
72 marks = repo._bookmarks |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
73 for name in names: |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
74 if name in marks: |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
75 raise error.Abort( |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
76 _( |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
77 b"bookmark %s already exists, to move use the --rev option" |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
78 ) |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
79 % name |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
80 ) |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
81 return orig(repo, tr, names, rev, force, inactive) |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
82 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
83 |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
84 def commands_commit(orig, ui, repo, *args, **opts): |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
85 commit_hook(ui, repo) |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
86 return orig(ui, repo, *args, **opts) |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
87 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
88 |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
89 def commands_pull(orig, ui, repo, *args, **opts): |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
90 rc = orig(ui, repo, *args, **opts) |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
91 active = repo._bookmarks.active |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
92 if active and not cwd_at_bookmark(repo, active): |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
93 ui.warn( |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
94 _( |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
95 b"working directory out of sync with active bookmark, run " |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
96 b"'hg up %s'" |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
97 ) |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
98 % active |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
99 ) |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
100 return rc |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
101 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
102 |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
103 def commands_branch(orig, ui, repo, label=None, **opts): |
43506
9f70512ae2cf
cleanup: remove pointless r-prefixes on single-quoted strings
Augie Fackler <augie@google.com>
parents:
43077
diff
changeset
|
104 if label and not opts.get('clean') and not opts.get('rev'): |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
105 raise error.Abort( |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
106 _( |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
107 b"creating named branches is disabled and you should use bookmarks" |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
108 ), |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
109 hint=b"see 'hg help bookflow'", |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
110 ) |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
111 return orig(ui, repo, label, **opts) |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
112 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
113 |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
114 def cwd_at_bookmark(repo, mark): |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
115 mark_id = repo._bookmarks[mark] |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
116 cur_id = repo.lookup(b'.') |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
117 return cur_id == mark_id |
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
118 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
41031
diff
changeset
|
119 |
40834
9cec7a36bab8
bookflow: new extension for bookmark-based branching
idlsoft <idlsoft@gmail.com>
parents:
diff
changeset
|
120 def uisetup(ui): |
43077
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
121 extensions.wrapfunction(bookmarks, b'update', bookmarks_update) |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
122 extensions.wrapfunction(bookmarks, b'addbookmarks', bookmarks_addbookmarks) |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
123 extensions.wrapcommand(commands.table, b'commit', commands_commit) |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
124 extensions.wrapcommand(commands.table, b'pull', commands_pull) |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
125 if not ui.configbool(MY_NAME, b'enable-branches'): |
687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents:
43076
diff
changeset
|
126 extensions.wrapcommand(commands.table, b'branch', commands_branch) |