[Bug 6721] New: Crash when pushing to a local clone

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Sun Jun 26 19:44:36 UTC 2022


https://bz.mercurial-scm.org/show_bug.cgi?id=6721

            Bug ID: 6721
           Summary: Crash when pushing to a local clone
           Product: Mercurial
           Version: default branch
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: jcea at jcea.es
                CC: mercurial-devel at mercurial-scm.org
    Python Version: ---

I have a project with a default branch and a "debian-bullseye" branch. My
current work area is "BullsEye", but I needed to do a tiny commit to "default".
Since I have a lot of uncommitted changes, instead of switching branches, I
created a local clone of my local clone, some like this:

```
$ cd /tmp
$ hg clone PATH_TO_MY_CURRENT_CLONE
$ cd /tmp/NEW_CLONE
(edit files there)
$ hg commit ...
$ hg push
```

The push should update the original clone. In this way I don't disturb my
original working directory.

When doing the "hg push", I get this traceback.

```
jcea at jcea:/tmp/ram/radio-utopia/radio-utopia$ hg push
pushing to /home/jcea/hg/radio-utopia
searching for changes
adding changesets
adding manifests
adding file changes
** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 3.10.5 (main, Jun 14 2022, 22:30:02) [GCC 9.4.0]
** Mercurial Distributed SCM (version 6.1.4)
** Extensions loaded: absorb, churn, convert, evolve 10.5.1, graphlog, hggit
1.0.0 (dulwich 0.20.25), mq, narrow, rebase, relink, share, show, strip, topic
0.24.1.dev
Traceback (most recent call last):
  File "/home/jcea/.local/bin/hg", line 61, in <module>
    dispatch.run()
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/dispatch.py",
line 144, in run
    status = dispatch(req)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/dispatch.py",
line 250, in dispatch
    status = _rundispatch(req)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/dispatch.py",
line 294, in _rundispatch
    ret = _runcatch(req) or 0
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/dispatch.py",
line 470, in _runcatch
    return _callcatch(ui, _runcatchfunc)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/dispatch.py",
line 480, in _callcatch
    return scmutil.callcatch(ui, func)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/scmutil.py",
line 153, in callcatch
    return func()
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/dispatch.py",
line 460, in _runcatchfunc
    return _dispatch(req)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/dispatch.py",
line 1273, in _dispatch
    return runcommand(
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/dispatch.py",
line 918, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/dispatch.py",
line 1285, in _runcommand
    return cmdfunc()
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/dispatch.py",
line 1271, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/util.py", line
1887, in check
    return func(*args, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/util.py", line
1887, in check
    return func(*args, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/hgext/mq.py", line 4239,
in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/util.py", line
1887, in check
    return func(*args, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/util.py", line
1887, in check
    return func(*args, **kwargs)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/topic/__init__.py",
line 1353, in pushoutgoingwrap
    return orig(ui, repo, *args, **opts)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/util.py", line
1887, in check
    return func(*args, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/util.py", line
1887, in check
    return func(*args, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/topic/flow.py",
line 94, in wrappush
    return orig(repo, remote, *args, **newargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/util.py", line
1887, in check
    return func(*args, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/commands.py",
line 5794, in push
    pushop = exchange.push(
  File "/home/jcea/.local/lib/python3.10/site-packages/hggit/util.py", line 95,
in inner
    return f(*args, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/hggit/gitrepo.py", line
231, in exchangepush
    return orig(
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/evolve/__init__.py",
line 578, in push
    return orig(repo, *args, **opts)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/exchange.py",
line 475, in push
    _pushbundle2(pushop)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/exchange.py",
line 1159, in _pushbundle2
    ).result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 439, in
result
    return self.__get_result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 391, in
__get_result
    raise self._exception
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 284, in callcommand
    result = fn(**pycompat.strkwargs(args))
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 410, in unbundle
    ret = exchange.unbundle(self._repo, bundle, heads, b'push', url)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/exchange.py",
line 2712, in unbundle
    lockandtr[2].close()
  File
"/home/jcea/.local/lib/python3.10/site-packages/mercurial/transaction.py", line
39, in _active
    return func(self, *args, **kwds)
  File
"/home/jcea/.local/lib/python3.10/site-packages/mercurial/transaction.py", line
629, in close
    self._postclosecallback[cat](self)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 2785, in updater
    repo.updatecaches(tr)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 237, in wrapper
    return orig(repo.unfiltered(), *args, **kwargs)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/evolve/obscache.py",
line 484, in updatecaches
    super(obscacherepo, self).updatecaches(tr, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 237, in wrapper
    return orig(repo.unfiltered(), *args, **kwargs)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/evolve/firstmergecache.py",
line 64, in updatecaches
    super(firstmergecacherepo, self).updatecaches(tr, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 237, in wrapper
    return orig(repo.unfiltered(), *args, **kwargs)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/evolve/depthcache.py",
line 91, in updatecaches
    super(depthcacherepo, self).updatecaches(tr, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 237, in wrapper
    return orig(repo.unfiltered(), *args, **kwargs)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/evolve/stablesort.py",
line 971, in updatecaches
    super(stablesortrepo, self).updatecaches(tr, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 237, in wrapper
    return orig(repo.unfiltered(), *args, **kwargs)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/evolve/stablerangecache.py",
line 532, in updatecaches
    super(stablerangerepo, self).updatecaches(tr, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 237, in wrapper
    return orig(repo.unfiltered(), *args, **kwargs)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/evolve/obsdiscovery.py",
line 646, in updatecaches
    super(obshashrepo, self).updatecaches(tr, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 237, in wrapper
    return orig(repo.unfiltered(), *args, **kwargs)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 2829, in updatecaches
    self.filtered(b'served').branchmap()
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/topic/__init__.py",
line 533, in branchmap
    return self.filtered(topicfilter).branchmap()
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/topic/__init__.py",
line 532, in branchmap
    return super(topicrepo, self).branchmap()
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/localrepo.py",
line 2155, in branchmap
    return self._branchcaches[self]
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/branchmap.py",
line 73, in __getitem__
    self.updatecache(repo)
  File
"/home/jcea/.local/lib/python3.10/site-packages/mercurial/extensions.py", line
533, in closure
    return func(*(args + a), **kw)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/topic/topicmap.py",
line 133, in _wrapupdatebmcachemethod
    return _wrapupdatebmcache(orig.__get__(self), repo)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/topic/topicmap.py",
line 144, in _wrapupdatebmcache
    return orig(repo)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/branchmap.py",
line 97, in updatecache
    bcache = self[subset].copy()
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/branchmap.py",
line 73, in __getitem__
    self.updatecache(repo)
  File
"/home/jcea/.local/lib/python3.10/site-packages/mercurial/extensions.py", line
533, in closure
    return func(*(args + a), **kw)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/topic/topicmap.py",
line 133, in _wrapupdatebmcachemethod
    return _wrapupdatebmcache(orig.__get__(self), repo)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/topic/topicmap.py",
line 144, in _wrapupdatebmcache
    return orig(repo)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/branchmap.py",
line 106, in updatecache
    bcache.update(repo, revs)
  File
"/home/jcea/.local/lib/python3.10/site-packages/hgext3rd/topic/topicmap.py",
line 229, in update
    return super(_topiccache, self).update(repo, revgen)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/branchmap.py",
line 589, in update
    for heads in self.iterheads():
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/branchmap.py",
line 409, in iterheads
    self._verifyall()
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/branchmap.py",
line 257, in _verifyall
    self._verifybranch(b)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/branchmap.py",
line 249, in _verifybranch
    _unknownnode(n)
  File "/home/jcea/.local/lib/python3.10/site-packages/mercurial/branchmap.py",
line 163, in _unknownnode
    raise ValueError('node %s does not exist' % pycompat.sysstr(hex(node)))
ValueError: node 225fd4da8337f004ac56eec969dd1476c4e4ab3d does not exist
```

Note that the node "225fd4da8337f004ac56eec969dd1476c4e4ab3d" is the head of
the branch "debian_bullseye". It can be seen with "hg heads", and showed below.

Checking the original clone, I seems to get the changes just fine:

```
jcea at jcea:~/hg/radio-utopia$ hg heads
changeset:   344:53a7967405f6
tag:         tip
parent:      327:d5c93847f58b
user:        Jesus Cea <jcea at jcea.es>
date:        Mon Jun 27 00:56:19 2022 +0200
summary:     Nueva parrilla

changeset:   343:225fd4da8337
branch:      debian_bullseye
user:        Jesus Cea <jcea at jcea.es>
date:        Fri Jun 24 03:07:25 2022 +0200
summary:     Actualizaciones Watchdog
```

A "hg diff -c 344" shows the right changes.

Pushing to the server seems to work fine:

```
jcea at jcea:~/hg/radio-utopia$ hg push
pushing to https://hg.jcea.es/jcea/radio-utopia
searching for changes
abort: push creates new remote branches: debian_bullseye
(use 'hg push --new-branch' to create new remote branches)

jcea at jcea:~/hg/radio-utopia$ hg push --new-branch
pushing to https://hg.jcea.es/jcea/radio-utopia
searching for changes
remote: adding changesets                                                       
remote: adding manifests
remote: adding file changes
remote: added 11 changesets with 21 changes to 19 files (+1 heads)
remote: 6 new obsolescence markers
```

So the work is corrently done, but the first push crashes (fortunately late
enough in the process).

PS: I did new local clones, even limiting the tree depth with "-r" to try the
replicate the original situation, commit changes and "push" locally, but no
more crashes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list