doesn't work at all on linux ubuntu python 2.6, mercurial 1.8.3 (nor 2.5)

Issue #40 resolved
simon_adda_reyss
created an issue

Hello, I installed the extension, hg help timestamps yields:

hg help timestamp hg timestamp_mod [-s | -r] /usr/lib/python2.6/TimestampMod.py (Version 0.2.6) Save or restore file modification times.

but the script actually keeps files from being stored! here is what I did:

echo "hello" >file hg init hg add -> added file hg commit -> HG: .hgtimestamp を追加

The only actually added file is .hgtimestamp! And when I clone the repository, that's the only file that gets copied......

Any ideas? Thank you very much

Comments (19)

  1. Nathan Durnan repo owner

    I'm not a regular Linux user, so I'm not sure how much help I can be. If I need to, I have a Raspberry Pi running a Debian image that I may be able to experiment with this on. But I've never tried to get Mercurial running on it, so I'm not sure how quickly I could get that running. Hopefully I can work with you to troubleshoot this on your end.

    The only think I can think of is that it sounds similar an issue that was reported with the command-line version of Mercurial under Windows. When you set up your Mercurial configuration file to include the extension, did you also add the [paths] reference as described in the README under "4. Additional Steps for Command Line Mercurial"?

    Additionally, have you tried using the "--verbose" switch to see what is going on behind the scenes? Try adding "--verbose" or "-v" to each hg command and capture the extened messages. Maybe I can get a clue from that.

  2. simon_adda_reyss reporter

    Thank you so much for your nice and quick answer! I didn't add the [paths] reference, because I figured it wouldn't be necessary since the path is hardcoded in python. I have to admit I wasn't totally sure, but I've included it since in my .hgrc (PythonLibPath = /usr/lib/python2.6). Same thing exactly

    TimestampMod|Wrap_Commit accessed!

    Executing timestamp_mod function


    Saving timestamps to JSON file...


    TimestampMod|Wrap_Commit finished!

    .hgtimestamp

    コミット対象リビジョン 0:3c9e215cd287

    I'm pretty sure that it's fairly easy to get Mercurial running on your debian image. Just a matter of opening a terminal, "su", then "apt-get install mercurial". Maybe you'll need to add editor=vim and username=<email address> to your .hgrc. Thanks so much

  3. Nathan Durnan repo owner

    simon_adda_reyss,

    Thank you for checking the [paths] reference for me. I'm disappointed that it did not help. To make sure I'm testing this problem correctly, I'd like to confirm as much information as possible.

    Commands to reproduce issue:

    echo "hello" > testfile
    hg init 
    hg add 
    hg commit --message "testing..."  --debug
    hg manifest
    type .hgtimestamp
    

    Results:

    • manifest result only displays '.hgtimestamp'
    • '.hgtimestamp' file contents are ???

    Can you re-test for me with the --debug switch this time, and make note of the contents of the '.hgtimestamp' file? I'm curious if the extension is completing its operations correctly.

    I am assuming that when you are using Mercurial without the TimestampMod extension that everything works normally? I will attempt to get my Rasberry Pi set up with Mercurial later this week. Unfortunately, I don't have access to any Linux machines at work, so I'll have to work on this at home. And my home internet service is down for a few days. Still, I'm excited to get this working cross-platform. So please be patient with me, and I appreciate your help in troubleshooting this issue!

  4. simon_adda_reyss reporter

    Thank you again!

    I'm sorry that I don't have time to dig into the extension myself right now.... But I'm glad to help as much as I can!

    So:

    1) of course it works without the extension.... I wouldn't have bothered you otherwise..

    2) output of the commands you asked me to type:

    simon@simon-1015CX:/tmp/ess$ hg commit --message "testing..." --debug                                                        
    * Loading TimestampMod reposetup                                                                                             
    TimestampMod|Wrap_Commit accessed!                                                                                           
    Executing timestamp_mod function                                                                                             
    -----                                                                                                                        
    match: []                                                                                                                    
    ______                                                                                                                       
    Generating file list from repo...                                                                                            
    ------                                                                                                                       
    Tracking:  testfile                                                                                                          
    ______                                                                                                                       
    Saving timestamps to JSON file...                                                                                            
    ------                                                                                                                       
    get_mtime: 2013.03.04 23:55:52  testfile                                                                                     
    Wrap_Commit: .hgtimestamp not in repo.dirstate  Adding...                                                                    
    Match Files: ['.hgtimestamp']                                                                                                
    TimestampMod|Wrap_Commit finished!                                                                                           
    .hgtimestamp                                                                                                                 
    コミット対象リビジョン 0:13f669225efde0b3ba701d9fb1752ad4150c3e87  
    
    simon@simon-1015CX:/tmp/ess$ hg manifest                                                                                     
    .hgtimestamp                                                                                                                 
    Appuyez sur une touche pour continuer...  
    
    cat .hgtimestamp
    
    {                                                                                                                            
    "Version": "0.2.6",                                                                                                          
    "FileData":{                                                                                                                 
    "testfile": {"timestamp": 1362437752.15},                                                                                    
    "TimestampMod_LastRecord": {"timestamp": 0}                                                                                  
    }                                                                                                                            
    } 
    
  5. Nathan Durnan repo owner

    NOTES

    Ignore the following paragraph - this is mostly just notes for myself:

    OK, that tells me something significant. The testfile is making it into the WrapCommit function, and the timestamp is getting saved. But testfile is not making it back out of the WrapCommit function to the original commit.

    ACTIONS

    simon_adda_reyss, I'd like you to try one more test for me.

    Uncomment Line 71:

        '''ui.setconfig("hooks", "pre-commit.TimestampMod", Hook_Pre_Commit)'''
    

    Uncomment Lines 234-239:

    '''def Hook_Pre_Commit(repo, **kwargs):
        repo.ui.note('Pre-Commit Hook accessed!\n')
        repo.ui.debug('kwargs = ',kwargs, "\n")
        timestamp_mod(repo.ui, repo, **dict({'save': True, 'restore': None}))
        kwargs['pats'].append(File_TimestampRecords)
    ''' # Hook_Pre_Commit is depreciated
    

    And comment out lines 126-128

            localrepo.localrepository.timestamp_origcommit = \
                localrepo.localrepository.commit
            localrepo.localrepository.commit = Wrap_Commit
    

    The pre-commit hook method has not been kept up-to date because it has not functioned correctly with TortoiseHg under Windows. So I expect it to not be completely functional. Namely, I believe the .hgtimestamp file will not get added to the commit automatically and will not show up in the manifest. But I would expect the timestamp for testfile to get updated in .hgtimestamp, and that testfile will be in the manifest. Please run the test sequence again and report what you observe.

    Side Note

    I am intrigued by the different languages that are showing up in your command outputs. It looks like you are running a French Linux with a Japanese Mercurial. I really doubt that has anything to do with the current issue, but I'm just curious how you ended up with that combination.

  6. Takahiro KITAHARA

    HI, simon_adda_reyss, Nathan.

    Exactly the words 'を追加' and 'コミット対象リビジョン', appear the log is Japanese.

     'を追加' means Add (or Added).
     'コミット対象リビジョン' means The revision for commit.
    

    So I try these commands my ubuntu later, and I will report the results.

    Thank you.

    • edit for syntax-hilight style change
  7. Takahiro KITAHARA

    the problem was reproduced Ubuntu 12.04 python 2.7.3 mercurial 2.0.2

    and, after commit, file was already ADD status like following

    $ hg commit -m 'hello.....'
    $ hg status
    A file
    $ ls -a
    . .. .hg .hgtimestamp file
    
    • edit for syntax-hilight style change
  8. Takahiro KITAHARA

    I try following commands. the command hg debugrebuild is rebuild repository status.

    the first time, repository was comitted for .hgtimestamp file (and other files were ignored). second time and third time, repository was not commited because of .hgtimestamp was already commited (and other files were ignored ).

    $ ls
    file
    $ hg init
    $ hg add
    file を追加登録中
    $ hg status
    A file
    $ hg commit -m 'test...' --verbose --debug
    * Loading TimestampMod reposetup
    TimestampMod|Wrap_Commit accessed!
    Executing timestamp_mod function
    -----
    match: []
    ______
    Generating file list from repo...
    ------
    Tracking:  file
    ______
    Saving timestamps to JSON file...
    ------
    get_mtime: 2013.03.11 23:19:27  file
    Wrap_Commit: .hgtimestamp not in repo.dirstate  Adding...
    Match Files: ['.hgtimestamp']
    TimestampMod|Wrap_Commit finished!
    .hgtimestamp
    コミット対象リビジョン 0:102a35120f56600006c528d97c271532ef950d44
    $ hg status
    A file
    $ hg debugrebuild
    $ hg status
    ? file
    $ hg add
    file を追加登録中
    $ hg commit -m 'test2...' --verbose --debug
    * Loading TimestampMod reposetup
    TimestampMod|Wrap_Commit accessed!
    Executing timestamp_mod function
    -----
    match: []
    ______
    Generating file list from repo...
    ------
    Tracking:  file
    Tracking:  .hgtimestamp
    ______
    Retrieving timestamps from JSON record file:
    ------
    testEncoding = utf_8
    UTC: 1363011567.33      : file
    ______
    Saving timestamps to JSON file...
    ------
    get_mtime: 2013.03.11 23:19:27  file
    Match Files: ['.hgtimestamp']
    TimestampMod|Wrap_Commit finished!
    変更なし
    
    $ export LANG=C
    $ hg debugrebuild
    $ hg status
    ? file
    $ hg add
    adding file
    $ hg commit -m 'test with no japanese' --verbose --debug
    * Loading TimestampMod reposetup
    TimestampMod|Wrap_Commit accessed!
    Executing timestamp_mod function
    -----
    match: []
    ______
    Generating file list from repo...
    ------
    Tracking:  file
    Tracking:  .hgtimestamp
    ______
    Retrieving timestamps from JSON record file:
    ------
    testEncoding = utf_8
    UTC: 1363011567.33      : file
    ______
    Saving timestamps to JSON file...
    ------
    get_mtime: 2013.03.11 23:19:27  file
    Match Files: ['.hgtimestamp']
    TimestampMod|Wrap_Commit finished!
    nothing changed
    $ hg status
    A file
    

    next, I try ACTIONS and I will report again.

  9. Takahiro KITAHARA

    I modify TimestampMod.py

    uncomment

        ui.setconfig("hooks", "pre-commit.TimestampMod", Hook_Pre_Commit)
    

    uncomment

    def Hook_Pre_Commit(repo, **kwargs):
        repo.ui.note('Pre-Commit Hook accessed!\n')
        repo.ui.debug('kwargs = ',kwargs, "\n")
        timestamp_mod(repo.ui, repo, **dict({'save': True, 'restore': None}))
        kwargs['pats'].append(File_TimestampRecords)
    # Hook_Pre_Commit is depreciated
    

    commented out and add pass

            '''localrepo.localrepository.timestamp_origcommit = \
                localrepo.localrepository.commit
            localrepo.localrepository.commit = Wrap_Commit
            '''
            pass
    

    And here are three kinds of command result ( normal, export LANG and commit twice ). With this TimestampMod.py, source file ( named 'file' ) was added and committed to repository, but .hgtimestap wasn't.

    $ echo 'Hello...' > file
    $ hg init
    $ hg add
    file を追加登録中
    $ hg commit -m 'test with modified py' --verbose --debug
    * Loading TimestampMod reposetup
    フック pre-commit.TimestampMod:<function Hook_Pre_Commit at 0x9f84b1c> 呼び出し中
    Pre-Commit Hook accessed!
    kwargs = {'pats': [], 'args': 'commit -m test with modified py --verbose --debug', 'ui': <mercurial.ui.ui object at 0x9eed80c>, 'hooktype': 'pre-commit', 'opts': {'exclude': [], 'message': 'test with modified py', 'addremove': None, 'subrepos': None, 'include': [], 'close_branch': None, 'user': '', 'date': '', 'logfile': ''}}
    Executing timestamp_mod function
    -----
    match argument not specified
    ______
    Generating file list from repo...
    ------
    Tracking:  file
    ______
    Saving timestamps to JSON file...
    ------
    get_mtime: 2013.03.12 00:44:09  file
    file
    コミット対象リビジョン 0:07ba023ab97dd032a5eab1e4d01335d18a67bf0c
    $ hg status
    ? .hgtimestamp
    
    $ export LANG=C
    $ echo 'abc' > file
    $ hg init
    $ hg add
    adding file
    $ hg commit -m 'abc' --verbose --debug
    * Loading TimestampMod reposetup
    calling hook pre-commit.TimestampMod: <function Hook_Pre_Commit at 0x90ad2cc>
    Pre-Commit Hook accessed!
    kwargs = {'pats': [], 'args': 'commit -m abc --verbose --debug', 'ui': <mercurial.ui.ui object at 0xb76998ac>, 'hooktype': 'pre-commit', 'opts': {'exclude': [], 'message': 'abc', 'addremove': None, 'subrepos': None, 'include': [], 'close_branch': None, 'user': '', 'date': '', 'logfile': ''}}
    Executing timestamp_mod function
    -----
    match argument not specified
    ______
    Generating file list from repo...
    ------
    Tracking:  file
    ______
    Saving timestamps to JSON file...
    ------
    get_mtime: 2013.03.12 01:13:16  file
    file
    committed changeset 0:495f5c34afc28ac1d3bae00b13b0a96055e0e163
    $ cat .hgtimestamp
    {
    "Version": "0.2.6",
    "FileData":{
    "file": {"timestamp": 1363018396.53},
    "TimestampMod_LastRecord": {"timestamp": 0}
    }
    }
    
    $ export LANG=C
    $ echo 'abc' > file
    $ hg init
    $ hg add
    adding file
    $ hg commit -m 'AAA' --debug
    * Loading TimestampMod reposetup
    calling hook pre-commit.TimestampMod: <function Hook_Pre_Commit at 0xa10d2cc>
    Pre-Commit Hook accessed!
    kwargs = {'pats': [], 'args': 'commit -m AAA --debug', 'ui': <mercurial.ui.ui object at 0xb76dd88c>, 'hooktype': 'pre-commit', 'opts': {'exclude': [], 'message': 'AAA', 'addremove': None, 'subrepos': None, 'include': [], 'close_branch': None, 'user': '', 'date': '', 'logfile': ''}}
    Executing timestamp_mod function
    -----
    match argument not specified
    ______
    Generating file list from repo...
    ------
    Tracking:  file
    ______
    Saving timestamps to JSON file...
    ------
    get_mtime: 2013.03.12 00:48:05  file
    file
    committed changeset 0:3d44b261d0818dbf97a15bc87ac994cb096f074d
    $ hg status
    ? .hgtimestamp
    $ hg commit -m 'EFG' --debug
    * Loading TimestampMod reposetup
    calling hook pre-commit.TimestampMod: <function Hook_Pre_Commit at 0x947e2cc>
    Pre-Commit Hook accessed!
    kwargs = {'pats': [], 'args': 'commit -m EFG --debug', 'ui': <mercurial.ui.ui object at 0xb76bb88c>, 'hooktype': 'pre-commit', 'opts': {'exclude': [], 'message': 'EFG', 'addremove': None, 'subrepos': None, 'include': [], 'close_branch': None, 'user': '', 'date': '', 'logfile': ''}}
    Executing timestamp_mod function
    -----
    match argument not specified
    ______
    Generating file list from repo...
    ------
    Tracking:  file
    ______
    Retrieving timestamps from JSON record file:
    ------
    testEncoding = utf_8
    UTC: 1363016885.68      : file
    ______
    Saving timestamps to JSON file...
    ------
    nothing changed
    $ hg status
    ? .hgtimestamp
    $ cat .hgtimestamp
    {
    "Version": "0.2.6",
    "FileData":{
    "file": {"timestamp": 1363016885.68},
    "TimestampMod_LastRecord": {"timestamp": 0}
    }
    }
    

    I hope these help you. thank you.

    • edit for append cat .hgtimestamp result
  10. Nathan Durnan repo owner
    • changed status to open

    @Takahiro KITAHARA, Thanks for testing this for me. I was unable to get my Rapsberry Pi out this weekend, so did not make any progress on this issue.

    Today, I have been experimenting with trying to make the Wrapper method and the precommit hook method work together. If the precommit method is able to run, then the Wrapper will be bypassed. I still need to leave the Wrapper functional since it seems to be the only method that works reliably with TortoseHg so far. I am working under the assumtion that there is someting about the Wrapper method that the Linux version of Mercurial just does not like.

    So far, I have been able to almost get it to work, but breaks part of what was fixed in Issue #37 for only committing one file when multiple files have been changed.

    • The specified file gets committed,
    • Its timestamp is the only one that is updated,
    • But now the .hgtimestamp file does not get included in the commit.

    I will keep exploring this more tomorrow.

  11. Takahiro KITAHARA

    I modify TimestampMod.py (0.2.6) again

    uncomment

        ui.setconfig("hooks", "pre-commit.TimestampMod", Hook_Pre_Commit)
    

    uncomment and modefied

    def Hook_Pre_Commit(repo, **kwargs):
            repo.ui.note('Pre-Commit Hook accessed!\n')
            repo.ui.debug('kwargs = ',kwargs, "\n")
            timestamp_mod(repo.ui, repo, **dict({'save': True, 'restore': None}))
            # kwargs['pats'].append(File_TimestampRecords) #!! this line will remove !!
            # if .hgtimestamp isnot exist, add to workingcontext.
            # notice: in precommit hook,repo.changectx(None) isnot changectx, that is
            # workingctx.
            if not '.hgtimestamp' in repo.changectx(None).files():
                    repo.changectx(None).add(['.hgtimestamp'])
    
    # Hook_Pre_Commit is depreciated
    

    commented out ( pass doesn't need )

                    '''localrepo.localrepository.timestamp_origcommit = \
                            localrepo.localrepository.commit
                    localrepo.localrepository.commit = Wrap_Commit
                    '''
    

    /tmp/tmsm2$ echo 'abc' > file
    /tmp/tmsm2$ hg init
    /tmp/tmsm2$ hg add
    file を追加登録中
    /tmp/tmsm2$ hg commit -m 'testing..' --verbose --debug
    * Loading TimestampMod reposetup
    フック pre-commit.TimestampMod:<function Hook_Pre_Commit at 0x9093b1c> 呼び出し中
    Pre-Commit Hook accessed!
    kwargs = {'pats': [], 'args': 'commit -m testing.. --verbose --debug', 'ui': <mercurial.ui.ui object at 0x8ffc86c>, 'hooktype': 'pre-commit', 'opts': {'exclude': [], 'message': 'testing..', 'addremove': None, 'subrepos': None, 'include': [], 'close_branch': None, 'user': '', 'date': '', 'logfile': ''}}
    Executing timestamp_mod function
    -----
    match argument not specified
    ______
    Generating file list from repo...
    ------
    Tracking:  file
    ______
    Saving timestamps to JSON file...
    ------
    get_mtime: 2013.03.13 01:49:01  file
    .hgtimestamp
    file
    コミット対象リビジョン 0:663c58c8bd4c0a7065d474e130b92bedf22b2afb
    /tmp/tmsm2$ hg status
    /tmp/tmsm2$ echo 'efg' >> file
    /tmp/tmsm2$ hg commit -m '2nd commit' --verbose --debug
    * Loading TimestampMod reposetup
    フック pre-commit.TimestampMod:<function Hook_Pre_Commit at 0x956db1c> 呼び出し中
    Pre-Commit Hook accessed!
    kwargs = {'pats': [], 'args': 'commit -m 2nd commit --verbose --debug', 'ui': <mercurial.ui.ui object at 0x94d686c>, 'hooktype': 'pre-commit', 'opts': {'exclude': [], 'message': '2nd commit', 'addremove': None, 'subrepos': None, 'include': [], 'close_branch': None, 'user': '', 'date': '', 'logfile': ''}}
    Executing timestamp_mod function
    -----
    match argument not specified
    ______
    Generating file list from repo...
    ------
    Tracking:  file
    Tracking:  .hgtimestamp
    ______
    Retrieving timestamps from JSON record file:
    ------
    testEncoding = utf_8
    UTC: 1363106941.43      : file
    ______
    Saving timestamps to JSON file...
    ------
    get_mtime: 2013.03.13 01:49:43  file
    .hgtimestamp
    file
    コミット対象リビジョン 1:0f4cd7e9d77555ad51400cc20fd86f3a30a9b47b
    
    
    /tmp/tmsm2$ cd ..
    /tmp$ mkdir tmsm3
    /tmp$ cd tmsm3
    /tmp/tmsm3$ hg clone ../tmsm2 .
    ブランチ default へ更新中
    ファイル状態: 更新数 2、 マージ数 0、 削除数 0、 衝突未解消数 0
    /tmp/tmsm3$ ls -al
    合計 20
    drwxrwxr-x  3 takahiro takahiro 4096  313 01:51 .
    drwxrwxrwt 15 root     root     4096  313 01:50 ..
    drwxrwxr-x  4 takahiro takahiro 4096  313 01:51 .hg
    -rw-rw-r--  1 takahiro takahiro  120  313 01:51 .hgtimestamp
    -rw-rw-r--  1 takahiro takahiro    8  313 01:49 file
    /tmp/tmsm3$
    

    It looks like success. it will perhaps fail when specify commit file. ( I noticed now. ) when kwargs['pats'] != [] , we must call original code kwargs['pats'].append(File_TimestampRecords).

    I'll try to think more. Thank you.

  12. Nathan Durnan repo owner

    I think I have a working release canidate to address this issue. Please grab the TimestampMod.py file off the tip of the BBI#40... issue branch, or download it from the following link:

    TimestampMod.py

    @Takahiro KITAHARA, could you please test this on Linux for me? If possible, could you run through the other test cases in the Tests folder as well to make sure that nothing else is broken? I really appreciate all the time you have put into this.

    Once this has been tested successfully, I will close and merge the issue branch and release the new version.

  13. Takahiro KITAHARA

    I post 4 results

    $ export LANG=C
    $ ./BBI36_CheckTimestampFileExists_Test.sh
    
    ===========================================
    Test
    
    ----------
    Initializing Test Repository...
    change directory failed
    Create file (abc.txt)
    hg commit -m abc
    
    
    hg status
    
    --------------------------------------------
    CHECK: no error message should be displayed.
    hg status result should be empty
    ============================================
    hit enter
    
    
    
    =============================================
    Test
    
    ----------
    Initializing Test Repository...
    change directory failed
    Create file (abc.txt)
    hg commit -m abc --debug
    * Loading TimestampMod reposetup
    ______
    TimestampMod|Wrap_Commit accessed!
    Executing timestamp_mod function
    -----
    match: []
    ------ Generating file list from repo...
    Tracking:  abc.txt
    ------ Saving timestamps to JSON file...
    get_mtime: 2013.03.14 02:38:33  abc.txt
    _save_TimestampsJSON: .hgtimestamp not in repo.dirstate  Adding...
    Wrap_Commit: no match specified
    Match Files: []
    TimestampMod|Wrap_Commit finished!
    ______
    .hgtimestamp
    abc.txt
    committed changeset 0:ec319a174baeb813be5230f1bbd907958a07d417
    
    
    hg status
    
    --------------------------------------------
    CHECK: no error message should be displayed,
    just a simple notification messages.
    hg status result should be empty
    ============================================
    hit enter
    
  14. Takahiro KITAHARA
    $ ./BBI37_SaveOnlyCommittedTimestamps_Test.sh
    change directory failed
    Initializing Test Repository...
    Create first file (abc.txt)
    Create second file (bcd.txt)
    
    ============================================
    Test
    
    ----------
    Timestamps before changes
    {
    "Version": "0.3.0-rc1",
    "FileData":{
    "abc.txt": {"timestamp": 1363196344.49},
    "bcd.txt": {"timestamp": 1363196344.96},
    "TimestampMod_LastRecord": {"timestamp": 0}
    }
    }
    
    hg commit -m commit bcd only bcd.txt
    
    ----------
    Timestamps after committing only bcd.txt
    {
    "Version": "0.3.0-rc1",
    "FileData":{
    "abc.txt": {"timestamp": 1363196344.49},
    "bcd.txt": {"timestamp": 1363196345.45},
    "TimestampMod_LastRecord": {"timestamp": 0}
    }
    }
    
    hg status
    M abc.txt
    
    ------------------------------------------------------
    CHECK: ONLY the bcd.txt timestamp should have changed.
    hg status result should show abc.txt as Modified (M)
    ======================================================
    hit enter
    
    
    
    ==============================================
    Test
    
    ----------
    Timestamps before commit
    {
    "Version": "0.3.0-rc1",
    "FileData":{
    "abc.txt": {"timestamp": 1363196344.49},
    "bcd.txt": {"timestamp": 1363196345.45},
    "TimestampMod_LastRecord": {"timestamp": 0}
    }
    }
    
    hg commit -m commit all (no match)
    
    ----------
    Timestamps after committing with no Match
    {
    "Version": "0.3.0-rc1",
    "FileData":{
    "abc.txt": {"timestamp": 1363196348.34},
    "bcd.txt": {"timestamp": 1363196348.34},
    "TimestampMod_LastRecord": {"timestamp": 0}
    }
    }
    
    hg status
    
    -------------------------------------------
    CHECK: BOTH timestamps should have changed.
    hg status result should be empty
    ===========================================
    hit enter
    
  15. Takahiro KITAHARA
    $ ./BBI38_EmptyUpdate_Test.sh
    
    Initializing Test Repository...
    Create file (abc.txt)
    hg commit -m add abc.txt
    hg remove abc.txt
    hg commit -m remove abc.txt
    
    =============================================
    Test
    
    ----------
    hg update 0
    2 files updated, 0 files merged, 0 files removed, 0 files unresolved
    
    
    hg update 1
    1 files updated, 0 files merged, 1 files removed, 0 files unresolved
    
    ----------------------------------------------
    CHECK: no error messages should be displayed.
    It should not try to open .hgtimestamp as CSV.
    ==============================================
    hit enter
    
    
    
    ===============================================
    Test
    
    ----------
    hg update 0 --debug
    * Loading TimestampMod reposetup
    resolving manifests
     overwrite False partial False
     ancestor f897ae1cb134 local f897ae1cb134+ remote 055aca5686ba
     .hgtimestamp: remote is newer -> g
     abc.txt: remote created -> g
    updating: .hgtimestamp 1/2 files (50.00%)
    getting .hgtimestamp
    updating: abc.txt 2/2 files (100.00%)
    getting abc.txt
    calling hook update.TimestampMod: <function Hook_Update at 0x89de304>
    ______
    TimestampMod|Hook_Update accessed!
    Executing timestamp_mod function
    -----
    match argument not specified
    ------ Generating file list from repo...
    Tracking:  .hgtimestamp
    Tracking:  abc.txt
    ------ Retrieving timestamps from JSON record file:
    testEncoding = utf_8
    UTC: 1363196389.8       : abc.txt
    ------ Restoring timestamps...
    set_mtime: 2013.03.14 02:39:49  abc.txt
    .hgtimestamp - skipped - no timestamp recorded
    TimestampMod|Hook_Update finished!
    ______
    2 files updated, 0 files merged, 0 files removed, 0 files unresolved
    
    
    hg update 1 --debug
    * Loading TimestampMod reposetup
      searching for copies back to rev 1
    resolving manifests
     overwrite False partial False
     ancestor 055aca5686ba local 055aca5686ba+ remote f897ae1cb134
     abc.txt: other deleted -> r
     .hgtimestamp: remote is newer -> g
    updating: abc.txt 1/2 files (50.00%)
    removing abc.txt
    updating: .hgtimestamp 2/2 files (100.00%)
    getting .hgtimestamp
    calling hook update.TimestampMod: <function Hook_Update at 0x8b15304>
    ______
    TimestampMod|Hook_Update accessed!
    Executing timestamp_mod function
    -----
    match argument not specified
    ------ Generating file list from repo...
    Tracking:  .hgtimestamp
    ------ Retrieving timestamps from JSON record file:
    testEncoding = utf_8
    .hgtimestamp contains no file records - Working Directory is empty?
    ------ Restoring timestamps...
    .hgtimestamp - skipped - no timestamp recorded
    TimestampMod|Hook_Update finished!
    ______
    1 files updated, 0 files merged, 1 files removed, 0 files unresolved
    
    ---------------------------------------------
    CHECK: no error messages should be displayed.
    It should not try to open .hgtimestamp as CSV.
    =============================================
    hit enter
    
  16. Takahiro KITAHARA
    $ ./BBI40_LINUX_TEST.sh
    
    ===========================================
    Test
    
    ----------
    Initializing Test Repository...
    Create file (abc.txt)
    hg commit -m abc
    
    --------------------------------------------
    CHECK: no error message should be displayed.
    ============================================
    hit enter
    
    
    hg status
    
    hg manifest
    .hgtimestamp
    abc.txt
    
    
    cat .hgtimestamp
    {
    "Version": "0.3.0-rc1",
    "FileData":{
    "abc.txt": {"timestamp": 1363196437.36},
    "TimestampMod_LastRecord": {"timestamp": 0}
    }
    }
    --------------------------------------------
    CHECK:
    hg status result should be empty
    Manifest should contain .hgtimestamp and testfile
    .hgtimestamp should contain testfile entry
    ============================================
    hit enter
    
  17. Log in to comment