[Bug 5025] New: makepatchname generate empty name when first line of description doesn't contains latin symbols or digits

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Fri Dec 25 10:23:35 UTC 2015


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

            Bug ID: 5025
           Summary: makepatchname generate empty name when first line of
                    description doesn't contains latin symbols or digits
           Product: Mercurial
           Version: default branch
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: easy, regression
          Severity: bug
          Priority: normal
         Component: mq
          Assignee: bugzilla at selenic.com
          Reporter: alexander_sergey at mail.ru
                CC: mercurial-devel at selenic.com

After commit **143b52fce68e5080db4ccb022bc859ae3e65de4e** will introduce
function `makepatchname` which generate patch name from first line of
description. But this function generate empty name when first line of
description doesn't contains latin symbols or digits.

I use Mercurial together with TortoiseHG in my inner development and commit
message writing in Russian. When I try to `qimport` commits, TortoiseHG by
default running command like `hg qimport --rev 0::` without parameter `--name`
and patch name trying to generate automatically.

I think that need to return the old behavior in function `makepathname`: it was
generate patch name on the basis of local revision number, if the patch name is
not determined from the first line of description.

Test case:

  $ hg init
  $ echo test1 > test1
  $ hg add
  adding test
  $ hg commit --message='Русское сообщение фиксации.'
  $ hg qimport --rev 0::
  abort: path contains illegal component:
  # Should be create patch 0.diff instead
  $ echo test2 > test2
  $ hg add
  adding test2
  $ hg commit --message='English commit message.'
  $ hg qimport --rev 1::
  $ hg qimport --rev 0::qparent
  abort: "" already exists as a directory
  # Should be create patch 0.diff instead


This is because function `makepatchname` generate name as

  re.sub('[\s\W_]+', '_', title.lower()).strip('_')

and with string «Русское сообщение фиксации.» it was given empty string.

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


More information about the Mercurial-devel mailing list