Case Ambiguity When Using CVS Update

We recently ran into an issue when using cvs update from a windows command line that involved case sensitivity. I thought I would share it with everyone.

Scenario: Update code to an older version

Let us compare two tags checked into cvs

  • version1 is the earlier version
/user/dao
      UserDAO.java
  • version2 is the later version
/user/dao
      UserDao.java
      UserRecordDao.java

Basically in version 2 we rename the UserDAO.java to UserRecordDao.java and create a new user dao in the /user/dao package but this time we do NOT capitalize dao, such as UserDao.java

Now suppose we have version2 loaded on our machine and we want to update to the code to version1

Start (version2)

/user/dao
      UserDao.java
      UserRecordDao.java

CVS update back to version1

cvs update -P -d -C -A -r version1

cvs update: Updating .
cvs update: Case ambiguity between UserDAO.java and UserDao.java.  Using UserDao.java.
cvs update: `UserDao.java' is no longer in the repository
cvs update: `UserRecordDao.java' is no longer in the repository

There seems to be an error involving Case Ambiguity

  • If we list the files in the /user/dao/ directory we see
/user/dao
  • It’s empty! We expected to see UserDAO.java (version1)?

What happened?

  1. CVS tried to update UserDAO.java but found UserDao.java Case ambiguity, so it left UserDao.java there instead of updating UserDAO.java
  2. CVS then deleted UserDao.java since it doesn’t exist in version 1
  3. Finally CVS deleted UserRecordDao.java since it doesn’t exist in version 1.

Moral of the story

  • Watch case sensitivity when using cvs update on Windows
  • It’s probably a good idea to delete the source code prior to the cvs update (that would fix the above issue)

Note:

  • We did try the -S flag for cvs update but this did not solve our issue.

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply