1. Friedrich Kastner-Masilko
  2. timestamp
  3. Issues
Issue #1 resolved

Commit a merge fails in TortoiseHg

Anonymous created an issue

If a repository files are managed with hg timestamp using TortoiseHg (1.5.1) two branches are successfully merged, but commit craches with following error:

Too mamy open files: <repo-path>/.hgtimestamp

To overcome the error you need to close TortoiseHg merge process and run "hg commit" manually.

Comments (5)

  1. Anonymous

    Here is the patch that fixes the problem:

    # HG changeset patch
    # Parent 6ea28b25c44fc651bdeb1a04b84d8f14a118d863
    # User Ruslan Yushchenko <yruslan@ukr.net>
    Fixed recursion problem when using togather with TortoiseHg
    
    diff -r 6ea28b25c44f -r 53e5d9ce23cb timestamp.py
    --- a/timestamp.py	Mon Jan 18 19:35:33 2010 +0100
    +++ b/timestamp.py	Sat Apr 03 17:30:24 2010 +0300
    @@ -33,6 +33,7 @@
                     fname = line.strip().split(',')[0]
                     tsdict[fname] = float(-1)
                     tslist.append(fname)
    +    tsfile.close()                
     
         for f, mtime in tsdict.items():
             if mtime>=0:
    @@ -151,6 +152,7 @@
                         fname = line.strip().split(',')[0]
                         tsdict[fname] = float(-1)
                         tslist.append(fname)
    +        tsfile.close()
     
             if matchin and len(matchin.files())>0:            
                 match = matchin.files()
    @@ -174,6 +176,7 @@
                         pm.write("%s\n" % fname)
                     else:                    
                         pm.write("%s,%s\n" % (fname, tsdict[fname]))
    +            pm.close()
                 if (not matchin) or matchin('.hgtimestamp'):
                     pass
                 else:
    @@ -186,11 +189,11 @@
                     matchin.matchfn=matchfn
                     if (len(matchin.files())>0):
                         matchin.files().append('.hgtimestamp')
    -            pm.close()
             else:
                 repo.ui.debug(_('No tracked timestamp\n'))
                                                 
         return repo.timestamp_origcommit(text, user, date, matchin, force, editor, extra)
     
    -localrepo.localrepository.timestamp_origcommit = localrepo.localrepository.commit
    -localrepo.localrepository.commit = _commit
    +if not hasattr(localrepo.localrepository, "timestamp_origcommit"):
    +    localrepo.localrepository.timestamp_origcommit = localrepo.localrepository.commit
    +    localrepo.localrepository.commit = _commit
    
  2. Log in to comment