Page MenuHomePhabricator

Commit imported into wrong repository (as duplicate)
Closed, InvalidPublic

Assigned To
None
Authored By
aik099
Aug 14 2014, 9:08 PM
Referenced Files
F206247: Phabricator_TSIM_RepoConfig.png
Sep 19 2014, 8:59 AM
F206249: Phabricator_TDEF_RepoConfig.png
Sep 19 2014, 8:59 AM
F190643: Phabricator_CommitOnWrongPath.png
Aug 14 2014, 9:08 PM
Subscribers

Description

I have following repository configuration:

  • repository on disk at file:///home/svn
  • 2 repositories created from it in Phabricator:
    • one at /projects/inb sub-path (the INB callsign on the image)
    • another at /projects/atv sub-path (the ATV callsign on the image)

When Phabricator is running and doing repository polling all seems to be ok, but when I update it from shell via update_phrabricator.sh script (all imports demons are stopped and then restarted) the strange commits appear:

Phabricator_CommitOnWrongPath.png (472×801 px, 122 KB)

The 14107 revision which is on sub-path from ATV Phabricator repository is also imported to the INB Phabricator repository by mistake. Since paths in that commit doesn't match any one of the INB Phabricator repository then commit is displayed as "Untitled commit" in recent commit list on Dashboard and author is also missing.

Maybe phabricator upgrade itself isn't what causing this, but fact that commits in INB and ATV were made one after another. This way repository kind of sticks in there and same commit is imported twice under different repositories.

Apparently this was happening for quite some time, but I wasn't aware of this because only recently with new Dashboards it was able to create combined list of commits from all repositories where I've noticed duplication of SVN revisions being imported.

Event Timeline

aik099 raised the priority of this task from to Needs Triage.
aik099 updated the task description. (Show Details)
aik099 added a project: Diffusion.
aik099 added a subscriber: aik099.

This continues to happen. For example:

Here is TSIM repository configuration:

Phabricator_TSIM_RepoConfig.png (897×1 px, 120 KB)

Here is TDEF repository configuration:

Phabricator_TDEF_RepoConfig.png (825×1 px, 109 KB)

As you can see they both share same SVN repository on disk, but each scans only sub-path from it.

So the question stays: why same SVN commit gets imported under 2 repositories.

Some more info I was able to find out. The commits:

  • have importStatus 15 (in contrast to 1039 for all other commits)
  • have "foreign-svn-stub":true in repository_commitdata table in the commitDetails field

Here are 2 options I see:

  1. delete these stub commit if they are not needed
  2. don't show sub commits in any commit lists

What can be the best way to proceed here?

It appears that during commit discovery on a repository (when daemon is looking for new commits) each commit wants to set it's own parent commit. And that parent commit is calculated as commitIdentifier -1 for SVN repositories. This is incorrect when we're dealing with SVN repositories, where only sub-path is imported.

This parent commit lookup only happens when a file was deleted.

This appears to be the problematic line: https://secure.phabricator.com/diffusion/P/browse/master/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php;12f3f6d3a9ef9c7731051815846810cb3c4cd248$102

In the related T6537 task same issue was solved for cases, when Skip Past This Commit link is used on such commit (where parent commit identifier isn't just -1 of current commit).

@epriestley, could you please confirm that a described behavior is a bug?

Another case, when this can be happening is during file/folder coping. Even through I can copy within the repository svn-subpath the revision reported by svn log as copyfrom-rev is last at the moment of copy per whole SVN repository and not just sub-path: https://secure.phabricator.com/diffusion/P/browse/master/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php;fa77fdd168d4f4f0a306e3b9867b5f09481fb6d1$50

So getting previous SVN revision in given repository sub-path (if possible) would be best thing to do.

This report is more than two years old, and we haven't seen other similar reports. If you are still affected by this bug, please file a new request following the guidelines in Contributing Bug Reports. In particular, we need specific reproduction instructions we can follow to reproduce it locally, not just screenshots.