Saturday, September 12, 2020

Creating a SVN branch from given commit id


Simple as following.  {where 123 is the revison number}


>svn copy -r123 http://svn.example.com/repos/calc/trunk  http://svn.example.com/repos/calc/branches/my-calc-branch


Share Article : Creating a SVN branch from given commit id
Share/Save/Bookmark

Revert SVN commit - Most sure way to get it done


Say you got some old repo on svn, you hate that it is on svn but not git. Yet you want to revert a commit/s cleanly like you would do it in git 😃 This is how  

  You will have to use both svn command line and TortiseSVN to make it simple and clear. 

1. First go inside the folder from command line and updae the code base to latest revison as following.  

>svn up -r HEAD # get latest revision


2. Then go to TortiseSVN "Show Log" and copy the revision ids(to notepad) that need to be removed from latest to oldest.

3. Say revison 120 and 118 need to be removed. First we should remove 120 and commit it, then proceed to 118. Why ? So each commit related issued fixed individually. Clean and ATOMIC.

4. Go to command line and revert 120 commit

>svn merge -c -120 . # undo revision 120



Then go to TortiseSVN select commit, check the diff and see it is as intended, add a commit message like "revert of commit 120" and commit.

5. Do the same for 118
>svn merge -c -118 .  # undo revision 118
Commit with TortiseSVN same as for commit 120. You don't have to use TortiseSVN for the commit. You can just use following command. 
> svn commit           # after solving problems (if any) 
But I personally like to cross check the change from another tool before releasing to production.
  

Share Article : Revert SVN commit - Most sure way to get it done
Share/Save/Bookmark

Saturday, June 20, 2020


MySQL Tips - Before delete trigger for logging


  • Before delete trigger for archiving 
    CREATE TRIGGER ARCHIVE_ON_DELETE
    BEFORE DELETE
    ON TASK_SHEET FOR EACH ROW
    BEGIN
    
    INSERT INTO TASK_SHEET_ARCHIVE
    (id,task_id, asking_time, given, received, comments, status, last_updated, task_sheet_number, channel_id)
    
    
    
    SELECT id, task_id, asking_time, given, received, comments, status, last_updated, task_sheet_number, channel_id
    FROM  TASK_SHEET WHERE id=OLD.id;
    
    
    END
  • Set auto-increment value (due to some change you want to do, need to skip some ids)
    ALTER TABLE contacts AUTO_INCREMENT = 50;



Share Article :
Share/Save/Bookmark