Issue #8 new

non-deterministic bug in "hg commit" when attic is enabled

tan2
created an issue

When attic is enabled, "hg commit fileA" sometimes will commit all modified files. This happens with hg v1.4.3 and v1.5.1.

See http://mercurial.selenic.com/bts/issue2053 for more information.

Comments (4)

  1. Anonymous

    I do have this issue, too. I have copied my repo to a save place (note to myself /hg/ss10-usb-fuzzing/.hg/attic-add-weirdness/).

    muelli@bigbox /hg/ss10-usb-fuzzing/filter $ hg st -m M filter/usbmachine.py M filter/usbscapy.py M paper/usb-fuzzing.bib M paper/usb-fuzzing.tex muelli@bigbox /hg/ss10-usb-fuzzing/filter $ hg ci usbmachine.py

    Nano opens and shows the followin: HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: Tobias Mueller (bigbox) <muelli@cryptobitch.de> HG: branch 'default' HG: added filter/fuzzingemulator.py HG: changed filter/usbmachine.py HG: changed filter/usbscapy.py HG: changed paper/usb-fuzzing.bib HG: changed paper/usb-fuzzing.tex

    Pressing ctrl+x because I don't want to commit all changes. abort: empty commit message

  2. dergo

    The bug occurs when a patch from the attic is currently applied.

    hg-attic installs a commit wrapper to remove the patch currently applied after committing, but removes any argument (*args) to the commit command, including any specification of files to commit.

    Note that if the code is corrected to keep the arguments of the commit command, the patch should not be removed unconditionally, but should probably be updated to remove the committed changes from it.

    def commitwrapper(orig, ui, repo, *args, * *opts):
        s = repo.attic
        name = s.applied
        if not name:
            orig(ui, repo, *args, **opts)
        else:
            makepatch(ui, repo, name, [], opts)
            data = patch.extract(ui, open(s.join(name), 'r'))
            tmpname, m, u, d, branch, nodeid, p1, p2 = data
            os.unlink(tmpname)
            orig(ui, repo, message = m, logfile = None, user = u, date = d)
    
            if not opts.get('keep'):
                s.remove(name)
            s.resetdefault()
    
  3. Log in to comment