[Bug 5993] New: absorb -i can crash

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Mon Sep 24 23:17:04 EDT 2018


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

            Bug ID: 5993
           Summary: absorb -i can crash
           Product: Mercurial
           Version: default branch
          Hardware: PC
                OS: Windows
            Status: UNCONFIRMED
          Severity: bug
          Priority: normal
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: matt_harbison at yahoo.com
                CC: mercurial-devel at mercurial-scm.org

I started with a py3 series[1] (prior to rebasing the 9th patch on top of it),
and needed to absorb in several '# re-exports' changes.  I expected there to be
a conflict between the first and second patch, so I tried the -e option,
thinking it would offer to pick which revision.  That crashed, so I removed the
-e, and it still crashed.  (I used -i a few weeks ago, so I can't tell if
something changed, or if this is a different case somehow.)

$ ../hg absorb --config extensions.absorb= -pie
absorb: only the recent 50 changesets will be analysed
diff -r 519492272ab6 contrib/check-code.py
1 hunks, 1 lines changed
examine changes to 'contrib/check-code.py'? [Ynesfdaq?] y

@@ -503,7 +503,7 @@
   [
     (r'os\.environ', "use encoding.environ instead (py3)", r'#.*re-exports'),
     (r'os\.name', "use pycompat.osname instead (py3)"),
-    (r'os\.getcwd', "use encoding.getcwd instead (py3)"),
+    (r'os\.getcwd', "use encoding.getcwd instead (py3)", r'#.*re-exports'),
     (r'os\.sep', "use pycompat.ossep instead (py3)"),
     (r'os\.pathsep', "use pycompat.ospathsep instead (py3)"),
     (r'os\.altsep', "use pycompat.osaltsep instead (py3)"),
record change 1/4 to 'contrib/check-code.py'? [Ynesfdaq?] y

diff -r 519492272ab6 mercurial/encoding.py
3 hunks, 3 lines changed
examine changes to 'mercurial/encoding.py'? [Ynesfdaq?] y

@@ -239,5 +239,5 @@
     if pycompat.osname == b'nt':
         # Python 3 on Windows issues a DeprecationWarning about using the
bytes
         # API when os.getcwdb() is called.
-        getcwd = lambda: strtolocal(os.getcwd())
+        getcwd = lambda: strtolocal(os.getcwd())  # re-exports
     else:
record change 2/4 to 'mercurial/encoding.py'? [Ynesfdaq?] y

@@ -243,3 +243,3 @@
     else:
-        getcwd = os.getcwdb
+        getcwd = os.getcwdb  # re-exports
 else:
record change 3/4 to 'mercurial/encoding.py'? [Ynesfdaq?] y

@@ -245,5 +245,5 @@
 else:
-    getcwd = os.getcwd
+    getcwd = os.getcwd  # re-exports

 # How to treat ambiguous-width characters. Set to 'wide' to treat as wide.
 _wide = _sysstr(environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide"
record change 4/4 to 'mercurial/encoding.py'? [Ynesfdaq?] y

** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64
bit (AMD64)]
** Mercurial Distributed SCM (version 4.7.1+1034-48a1c0848e6a)
** Extensions loaded: eol, rebase, convert, graphlog, patchbomb, extdiff,
strip, mq, evolve, blackbox, phabricator, absorb
Traceback (most recent call last):
  File "../hg", line 43, in <module>
    dispatch.run()
  File "c:\Users\Matt\projects\hg\mercurial\dispatch.py", line 93, in run
    status = dispatch(req)
  File "c:\Users\Matt\projects\hg\mercurial\dispatch.py", line 217, in dispatch
    ret = _runcatch(req) or 0
  File "c:\Users\Matt\projects\hg\mercurial\dispatch.py", line 359, in
_runcatch
    return _callcatch(ui, _runcatchfunc)
  File "c:\Users\Matt\projects\hg\mercurial\dispatch.py", line 367, in
_callcatch
    return scmutil.callcatch(ui, func)
  File "c:\Users\Matt\projects\hg\mercurial\scmutil.py", line 164, in callcatch
    return func()
  File "c:\Users\Matt\projects\hg\mercurial\dispatch.py", line 350, in
_runcatchfunc
    return _dispatch(req)
  File "c:\Users\Matt\projects\hg\mercurial\dispatch.py", line 987, in
_dispatch
    cmdpats, cmdoptions)
  File "c:\Users\Matt\projects\hg\mercurial\dispatch.py", line 733, in
runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "c:\Users\Matt\projects\hg\mercurial\dispatch.py", line 996, in
_runcommand
    return cmdfunc()
  File "c:\Users\Matt\projects\hg\mercurial\dispatch.py", line 984, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "c:\Users\Matt\projects\hg\mercurial\util.py", line 1643, in check
    return func(*args, **kwargs)
  File "c:\Users\Matt\projects\hg\mercurial\util.py", line 1643, in check
    return func(*args, **kwargs)
  File "c:\Users\Matt\projects\hg\hgext\mq.py", line 3602, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "c:\Users\Matt\projects\hg\mercurial\util.py", line 1643, in check
    return func(*args, **kwargs)
  File "c:\Users\Matt\projects\hg\hgext\absorb.py", line 976, in absorbcmd
    state = absorb(ui, repo, pats=pats, opts=opts)
  File "c:\Users\Matt\projects\hg\hgext\absorb.py", line 934, in absorb
    state.diffwith(targetctx, matcher, showchanges=opts.get('print_changes'))
  File "c:\Users\Matt\projects\hg\hgext\absorb.py", line 615, in diffwith
    self.status = self.stack[-1].status(targetctx, match)
  File "c:\Users\Matt\projects\hg\mercurial\context.py", line 351, in status
    listunknown)
  File "c:\Users\Matt\projects\hg\mercurial\context.py", line 142, in
_buildstatus
    elif self[fn].cmp(other[fn]):
  File "c:\Users\Matt\projects\hg\mercurial\context.py", line 780, in cmp
    return self._filelog.cmp(self._filenode, fctx.data())
  File "c:\Users\Matt\projects\hg\mercurial\filelog.py", line 176, in cmp
    samehashes = not self._revlog.cmp(node, t)
  File "c:\Users\Matt\projects\hg\mercurial\revlog.py", line 1376, in cmp
    p1, p2 = self.parents(node)
  File "c:\Users\Matt\projects\hg\mercurial\revlog.py", line 715, in parents
    d = i[self.rev(node)]
  File "c:\Users\Matt\projects\hg\mercurial\revlog.py", line 613, in rev
    return self._nodecache[node]
TypeError: expected string or Unicode object, NoneType found


After dropping -i, it folded the first and fourth hunks into the first patch,
and the second and third hunks into the second patch.  Hunk #3 is the one that
I expected to be an ambiguous change, so IDK if not declaring it ambiguous is a
bug too.

This hg build is based on:

changeset:   46329:d3d333ab167a
bookmark:    @
user:        Gregory Szorc <gregory.szorc at gmail.com>
date:        Mon Sep 17 11:50:59 2018 -0700
summary:     wireprotov2: teach changesetdata to fetch ancestors until depth


[1]
https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-September/122479.html

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


More information about the Mercurial-devel mailing list