MCPcopy Create free account
hub / github.com/microsoft/debugpy / pull

Function pull

subrepo.py:87–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85
86
87def pull() -> None:
88 # Remove the temporary branch and worktree.
89 invoke_call("git", "subrepo", "clean", "--force", _SUBREPO_NAME)
90
91 invoke_call("git", "subrepo", "fetch", _SUBREPO_NAME)
92 with cwd(_SUBREPO_NAME):
93 new_commit = invoke_output("git", "rev-parse","--verify", "FETCH_HEAD").strip()
94
95 print(f"Updating to pydevd commit {new_commit}.")
96
97 # Pull changes and squash commit them.
98 invoke_call("git", "subrepo", "pull", _SUBREPO_NAME)
99
100 # Now, branch to see if there are any diffs. If not, then we can just reclone.
101 print("Branching to check if the pydevd tree is clean.")
102 invoke_call("git", "subrepo", "clean", _SUBREPO_NAME)
103 invoke_call("git", "subrepo", "branch", _SUBREPO_NAME)
104
105 with cwd(_SUBREPO_TMP):
106 no_diff = invoke_call_ok("git", "diff", "--quiet", new_commit)
107
108 if no_diff:
109 # No diff, so it's safe to manually move the subrepo parent to HEAD.
110 print("pydevd tree is clean, moving subrepo parent.")
111 new_parent = invoke_output("git", "rev-parse", "HEAD", no_log=True).strip()
112 invoke_call(
113 "git",
114 "config",
115 "--file",
116 "src/debugpy/_vendored/pydevd/.gitrepo",
117 "subrepo.parent",
118 new_parent,
119 )
120 invoke_call("git", "commit", "-am", "Update git-subrepo parent")
121 else:
122 print("pydevd tree has changes not pushed upstream.")
123
124
125def branch(message: str) -> None:

Callers 1

mainFunction · 0.85

Calls 4

invoke_callFunction · 0.85
invoke_outputFunction · 0.85
invoke_call_okFunction · 0.85
cwdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…