Home 

Checking in to the repository

Once the sandbox is filled, changes to the project will be applied by the developer. As soon as the developer is confident with the changes, he is about to promote these changes to the other developers. He does that by checking the changes back into the repository.

Checking changes back into the repository should start by performing an update procedure as described in the next section. This may seem strange, but updateing your sandbox will transfer changes performed by other developers in the meantime to your sandbox. It is good practice to re-compile the project if you notice that updateing the sandbox changes it's contents. This assures that the project is still compilable when you check-in your changes.

The next step is to identify the changes you really want to promote. This can be performed by the diff operation supported by CVS.

Example A.3. Promote changes to the repository

For the following example, I assume a single file that has been changed in the sandbox (~/kmymoney2/kmymoney2/knewbankdlg.cpp) and that the current directory is ~/kmymoney2/kmymoney2. Also, it is assumed, that the file README has been updated by another person in the repository. Since the README file has no influence on the compile process, we omit recompiling in this example.

The part of the original file that has been changed is shown here to understand the output of the cvs diff command shown below. The beginning of the file is not included here as it is not changed.


void KNewBankDlg::okClicked()
{
  if (nameEdit->text().isEmpty()) {
    KMessageBox::information(this, i18n("The institution name field is empty.  Please enter the name."), i18n("Adding New Institution"));
    nameEdit->setFocus();
    return;
  }

  m_name = nameEdit->text();
  m_city = cityEdit->text();
  m_street = streetEdit->text();
  m_postcode = postcodeEdit->text();
  m_telephone = telephoneEdit->text();
  m_managerName = managerEdit->text();
  m_sortCode = sortCodeEdit->text();
  accept();
}


The changed version of the method is included here.


void KNewBankDlg::okClicked()
{
  if (nameEdit->text().isEmpty()) {
    KMessageBox::information(this, i18n("The institution name field is empty.  Please enter the name."), i18n("Adding New Institution"));
    nameEdit->setFocus();

  } else {
    m_name = nameEdit->text();
    m_city = cityEdit->text();
    m_street = streetEdit->text();
    m_postcode = postcodeEdit->text();
    m_telephone = telephoneEdit->text();
    m_managerName = managerEdit->text();
    m_sortCode = sortCodeEdit->text();
    accept();
  }
}


Now as the file has been changed, the changes should be promoted to the repository. As explained above, the process starts with checking for changes made by other people.


  thb:~> cvs -q upd
  U README
  M knewbankdlg.cpp
  thb:~> 


The above shown output has the following meaning: the file README is udpated (U) from the repository to the sandbox because it has been changed by someone else in the meantime. The contents of the file in the sandbox will be replaced by the contents of the file in the repository, because it has not been altered in the sandbox. The file knewbankdlg.cpp has been modified (M) in the sandbox and needs to be returned to the repository.

As the next step, one should check what has been changed in the file knewbankdlg.cpp. This is done using the following command:


  thb:~> cvs -q diff knewbankdlg.cpp
  74,75d73
  <     return;
  <   }
  77,84c75,84
  <   m_name = nameEdit->text();
  <   m_city = cityEdit->text();
  <   m_street = streetEdit->text();
  <   m_postcode = postcodeEdit->text();
  <   m_telephone = telephoneEdit->text();
  <   m_managerName = managerEdit->text();
  <   m_sortCode = sortCodeEdit->text();
  <   accept();
  ---
  >   } else {
  >     m_name = nameEdit->text();
  >     m_city = cityEdit->text();
  >     m_street = streetEdit->text();
  >     m_postcode = postcodeEdit->text();
  >     m_telephone = telephoneEdit->text();
  >     m_managerName = managerEdit->text();
  >     m_sortCode = sortCodeEdit->text();
  >     accept();
  >   }
  thb:~> 


The output shows the changes between the current and the original revision of the file. If this is what needs to be changed then the next step can be started, which is checking the changes back into the repository.


  thb:~> cvs -q ci -m "Avoid return in the middle of a function" knewbankdlg.cpp
  Checking in knewbankdlg.cpp;
  kmymoney2/kmymoney2/knewbankdlg.cpp,v  <--  knewbankdlg.cpp
  new revision: 1.10; previous revision: 1.9
  done
  thb:~> 


Note

If the option -m and the descriptive text is omitted on the command line, CVS starts an editor where the developer has to enter a descriptive text about the changes and save that file. Performing checkin operations that way is meaningful, if the description is longer or covers more than one file.

At this point, the changes are stored in the repository. An automatic mail is generated and send to the kmymoney2-developer mailing list . This mail informs all other developers about your changes and is an indication for them to update their sandboxes. The contents of the mail looks something like this:


  From: Thomas Baumgart <ipwizard@users.sourceforge.net>
  To: kmymoney2-developer@lists.sourceforge.net
  Date: Sat, 24 Nov 2001 12:23:00 -0800
  Subject: [Kmymoney2-developer] CVS update:
 
  Update of /cvsroot/kmymoney2/kmymoney2/kmymoney2
  In directory usw-pr-cvs1:/tmp/cvs-serv6662

  Modified Files:
           knewbankdlg.cpp
  Log Message:
  Avoid return in the middle of a function
  _______________________________________________
  Kmymoney2-developer mailing list
  Kmymoney2-developer@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/kmymoney2-developer



While you checkin your changes, you should maintain the file kmymoney2/ChangeLog. You could probably use the same comments that you use for checkin in your changes or a more general note for many changes. That depends on your changes. Once all your changes are checked in, you also checkin kmymoney2/ChangeLog.